Skip to content

Commit

Permalink
feat(plans): add peadm::add_compiler plan
Browse files Browse the repository at this point in the history
- Introduced a new plan `peadm::add_compiler` as a proxy for `peadm::add_compilers`.
- Added documentation for the new plan in REFERENCE.md.
- Parameters include `avail_group_letter`, `compiler_host`, `dns_alt_names`, `primary_host`, and `primary_postgresql_host`.
- The plan outputs a deprecation message and calls `peadm::add_compilers` with the provided parameters.
  • Loading branch information
CoMfUcIoS committed Oct 9, 2024
1 parent ff397bf commit c8fba11
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
51 changes: 51 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@

#### Public Plans

* [`peadm::add_compiler`](#peadm--add_compiler): Proxy plan for peadm::add_compilers.
* [`peadm::add_compilers`](#peadm--add_compilers): Add new compilers to a PE architecture or replace an existing with new configuration.
* [`peadm::add_database`](#peadm--add_database)
* [`peadm::add_replica`](#peadm--add_replica): Add or replace a replica host.
Expand Down Expand Up @@ -1594,6 +1595,56 @@ Which port to query the status API on

## Plans

### <a name="peadm--add_compiler"></a>`peadm::add_compiler`

Proxy plan for peadm::add_compilers.

#### Parameters

The following parameters are available in the `peadm::add_compiler` plan:

* [`avail_group_letter`](#-peadm--add_compiler--avail_group_letter)
* [`compiler_hosts`](#-peadm--add_compiler--compiler_hosts)
* [`dns_alt_names`](#-peadm--add_compiler--dns_alt_names)
* [`primary_host`](#-peadm--add_compiler--primary_host)
* [`primary_postgresql_host`](#-peadm--add_compiler--primary_postgresql_host)

##### <a name="-peadm--add_compiler--avail_group_letter"></a>`avail_group_letter`

Data type: `Enum['A', 'B']`

_ Either A or B; whichever of the two letter designations the compilers are being assigned to

Default value: `'A'`

##### <a name="-peadm--add_compiler--compiler_hosts"></a>`compiler_hosts`

Data type: `TargetSpec`

_ The hostnames and certnames of the new compilers

##### <a name="-peadm--add_compiler--dns_alt_names"></a>`dns_alt_names`

Data type: `Optional[Array[String[1]]]`

_ An array of strings, where each string is a comma-separated list of DNS alt names for the compilers. Order matters; if a compiler doesn't need dns_alt_names, use "undef" as string.

Default value: `undef`

##### <a name="-peadm--add_compiler--primary_host"></a>`primary_host`

Data type: `Peadm::SingleTargetSpec`

_ The hostname and certname of the primary Puppet server

##### <a name="-peadm--add_compiler--primary_postgresql_host"></a>`primary_postgresql_host`

Data type: `Optional[Peadm::SingleTargetSpec]`

_ The hostname and certname of the PE-PostgreSQL server with availability group $avail_group_letter

Default value: `undef`

### <a name="peadm--add_compilers"></a>`peadm::add_compilers`

Add new compilers to a PE architecture or replace an existing with new configuration.
Expand Down
24 changes: 24 additions & 0 deletions plans/add_compiler.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# @api public
#
# @summary Proxy plan for peadm::add_compiler.
# @param avail_group_letter _ Either A or B; whichever of the two letter designations the compiler are being assigned to
# @param compiler_host _ The hostname and certname of the new compiler
# @param dns_alt_names _ A comma-separated list of DNS alt names for the compiler.
# @param primary_host _ The hostname and certname of the primary Puppet server
# @param primary_postgresql_host _ The hostname and certname of the PE-PostgreSQL server with availability group $avail_group_letter
plan peadm::add_compiler(
Enum['A', 'B'] $avail_group_letter = 'A' ,
Optional[String[1]] $dns_alt_names = undef,
Peadm::SingleTargetSpec $compiler_host,
Peadm::SingleTargetSpec $primary_host,
Optional[Peadm::SingleTargetSpec] $primary_postgresql_host = undef,
) {
out::message('Warning: The add_compiler plan is deprecated and will be removed in a future release. Please use the add_compilers plan instead. ')
run_plan('peadm::add_compilers',
avail_group_letter => $avail_group_letter,
dns_alt_names => $dns_alt_names ? { undef => undef, default => Array($dns_alt_names) },
compiler_hosts => $compiler_host,
primary_host => $primary_host,
primary_postgresql_host => $primary_postgresql_host,
)
}

0 comments on commit c8fba11

Please sign in to comment.