From c8fba1167e787d3756c1fbab119ea67e65bd9952 Mon Sep 17 00:00:00 2001 From: Ioannis Karasavvaidis Date: Wed, 9 Oct 2024 17:36:09 +0100 Subject: [PATCH] feat(plans): add peadm::add_compiler plan - 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. --- REFERENCE.md | 51 +++++++++++++++++++++++++++++++++++++++++++ plans/add_compiler.pp | 24 ++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 plans/add_compiler.pp diff --git a/REFERENCE.md b/REFERENCE.md index 4275c69f..df2ac06c 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -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. @@ -1594,6 +1595,56 @@ Which port to query the status API on ## Plans +### `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) + +##### `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'` + +##### `compiler_hosts` + +Data type: `TargetSpec` + +_ The hostnames and certnames of the new compilers + +##### `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` + +##### `primary_host` + +Data type: `Peadm::SingleTargetSpec` + +_ The hostname and certname of the primary Puppet server + +##### `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` + ### `peadm::add_compilers` Add new compilers to a PE architecture or replace an existing with new configuration. diff --git a/plans/add_compiler.pp b/plans/add_compiler.pp new file mode 100644 index 00000000..aabae495 --- /dev/null +++ b/plans/add_compiler.pp @@ -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, + ) +}