From 6953dc96a74f62432f631944ce7170bdddb3632c Mon Sep 17 00:00:00 2001 From: martyewings Date: Thu, 22 Apr 2021 12:28:29 +0100 Subject: [PATCH] (SUP-2386) updating documentation and dependancies --- .ruby-version | 2 +- Gemfile | 1 + REFERENCE.md | 77 +++++++++++++++++++-------------- functions/get_postgres_hosts.pp | 2 + functions/get_puppet_servers.pp | 2 + functions/get_puppetdb_hosts.pp | 2 + functions/license_uuid.pp | 5 ++- manifests/exporter.pp | 10 ++--- manifests/remove_exporter.pp | 4 +- metadata.json | 8 +--- 10 files changed, 65 insertions(+), 48 deletions(-) diff --git a/.ruby-version b/.ruby-version index e70b452..37c2961 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.0 +2.7.2 diff --git a/Gemfile b/Gemfile index deb898e..ed20695 100644 --- a/Gemfile +++ b/Gemfile @@ -30,6 +30,7 @@ group :development do gem "puppet-module-win-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "toml-rb", require: false gem "rspec-puppet-facts", '>= 2.0.1', require: false + gem 'aws-partitions', '>= 1.446.0' end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/REFERENCE.md b/REFERENCE.md index 82561c1..1f69c09 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -6,17 +6,17 @@ ### Classes -* [`rsan::exporter`](#rsanexporter) +* [`rsan::exporter`](#rsanexporter): Sets up target nodes with nessary services and access for RSAN When Applied to the Infrastruture Agent Node group, Will dynamically configure * [`rsan::importer`](#rsanimporter): Class to consume the resources provided by the exporter class. when applied to a node, all tooling agttributed to RSAN will be set up -* [`rsan::remove_exporter`](#rsanremove_exporter): A short summary of the purpose of this class +* [`rsan::remove_exporter`](#rsanremove_exporter): disables and removes services and components enabled by the exporter class ### Functions -* [`rsan::get_postgres_hosts`](#rsanget_postgres_hosts) -* [`rsan::get_puppet_servers`](#rsanget_puppet_servers) +* [`rsan::get_postgres_hosts`](#rsanget_postgres_hosts): Function to provide a list of pe_postgresql hosts to RSAN +* [`rsan::get_puppet_servers`](#rsanget_puppet_servers): Function to return a list of components running pe_puppetserver to RSAN * [`rsan::get_puppetdb_hosts`](#rsanget_puppetdb_hosts) * [`rsan::get_rsan_importer_ips`](#rsanget_rsan_importer_ips) -* [`rsan::license_uuid`](#rsanlicense_uuid): return the uuid from a Puppet license file supplied in $content If no $content parameter specified, tries to read the license file from /etc/ +* [`rsan::license_uuid`](#rsanlicense_uuid): If no $content parameter specified, tries to read the license file from /etc/puppetlabs/license.key ### Tasks @@ -24,31 +24,45 @@ ## Classes -### `rsan::exporter` +### `rsan::exporter` -The rsan::exporter class. +Sets up target nodes with nessary services and access for RSAN +When Applied to the Infrastruture Agent Node group, +Will dynamically configure all matching nodes to allow access to key elements of Puppet Enterprise to the RSAN node + +#### Examples + +##### + +```puppet +include rsan::exporter +``` #### Parameters -The following parameters are available in the `rsan::exporter` class. +The following parameters are available in the `rsan::exporter` class: -##### `rsan_importer_ips` +* [`rsan_importer_ips`](#rsan_importer_ips) +* [`rsan_host`](#rsan_host) -Data type: `Array` +##### `rsan_importer_ips` +Data type: `Array` +An array of rsan ip addresses +Defaults to the output of a PuppetDB query Default value: `rsan::get_rsan_importer_ips()` -##### `rsan_host` +##### `rsan_host` Data type: `Optional[String]` - +The certname of the rsan node Default value: ``undef`` -### `rsan::importer` +### `rsan::importer` Class to consume the resources provided by the exporter class. when applied to a node, all tooling agttributed to RSAN will be set up @@ -61,9 +75,9 @@ when applied to a node, all tooling agttributed to RSAN will be set up include rsan::importer ``` -### `rsan::remove_exporter` +### `rsan::remove_exporter` -A description of what this class does +In the event RSAN should be uninstalled on all or some of the exporter nodes, this will stop NFS service, and remove the database components if applied to a postgres node #### Examples @@ -75,31 +89,31 @@ include rsan::remove_exporter ## Functions -### `rsan::get_postgres_hosts` +### `rsan::get_postgres_hosts` Type: Puppet Language -The rsan::get_postgres_hosts function. +Function to provide a list of pe_postgresql hosts to RSAN #### `rsan::get_postgres_hosts()` -The rsan::get_postgres_hosts function. +Function to provide a list of pe_postgresql hosts to RSAN -Returns: `Any` +Returns: `Array` List of FQDN -### `rsan::get_puppet_servers` +### `rsan::get_puppet_servers` Type: Puppet Language -The rsan::get_puppet_servers function. +Function to return a list of components running pe_puppetserver to RSAN #### `rsan::get_puppet_servers()` -The rsan::get_puppet_servers function. +Function to return a list of components running pe_puppetserver to RSAN -Returns: `Any` +Returns: `Array` List of Fqdn of nodes with the Master profile -### `rsan::get_puppetdb_hosts` +### `rsan::get_puppetdb_hosts` Type: Puppet Language @@ -109,9 +123,9 @@ The rsan::get_puppetdb_hosts function. The rsan::get_puppetdb_hosts function. -Returns: `Any` +Returns: `Array` List of node running Puppetdb -### `rsan::get_rsan_importer_ips` +### `rsan::get_rsan_importer_ips` Type: Puppet Language @@ -123,31 +137,30 @@ The rsan::get_rsan_importer_ips function. Returns: `Array` List of IP addresses for RSAN nodes or an empty array -### `rsan::license_uuid` +### `rsan::license_uuid` Type: Puppet Language -return the uuid from a Puppet license file supplied in $content If no $content parameter specified, tries to read the license file from /etc/puppetlabs/license.key #### `rsan::license_uuid(Optional[String] $content)` -return the uuid from a Puppet license file supplied in $content If no $content parameter specified, tries to read the license file from /etc/puppetlabs/license.key -Returns: `String` +Returns: `String` the uuid from a Puppet license file supplied in $content ##### `content` Data type: `Optional[String]` - +An array of rsan ip addresses +Defaults to the output of a PuppetDB query ## Tasks -### `supportuser` +### `supportuser` Creates pesupport user and PE Support Role, generated password should be shared with Puppet Enterprise Support personnel diff --git a/functions/get_postgres_hosts.pp b/functions/get_postgres_hosts.pp index 4068927..aedb152 100644 --- a/functions/get_postgres_hosts.pp +++ b/functions/get_postgres_hosts.pp @@ -1,3 +1,5 @@ +# Function to provide a list of pe_postgresql hosts to RSAN +# @return [Array] List of FQDN function rsan::get_postgres_hosts() { $postgres_hosts = puppetdb_query('resources[certname] { diff --git a/functions/get_puppet_servers.pp b/functions/get_puppet_servers.pp index 9cab419..937965b 100644 --- a/functions/get_puppet_servers.pp +++ b/functions/get_puppet_servers.pp @@ -1,3 +1,5 @@ +# Function to return a list of components running pe_puppetserver to RSAN +# @return [Array] List of Fqdn of nodes with the Master profile function rsan::get_puppet_servers() { $puppet_servers = puppetdb_query('nodes[certname] { diff --git a/functions/get_puppetdb_hosts.pp b/functions/get_puppetdb_hosts.pp index 6508fc3..8f7477a 100644 --- a/functions/get_puppetdb_hosts.pp +++ b/functions/get_puppetdb_hosts.pp @@ -1,3 +1,5 @@ + +# @return [Array] List of node running Puppetdb function rsan::get_puppetdb_hosts() { if $settings::storeconfigs { $puppetdb_hosts = diff --git a/functions/license_uuid.pp b/functions/license_uuid.pp index f74b6c0..09f7786 100644 --- a/functions/license_uuid.pp +++ b/functions/license_uuid.pp @@ -1,6 +1,9 @@ -# return the uuid from a Puppet license file supplied in $content +# @return [String] the uuid from a Puppet license file supplied in $content # If no $content parameter specified, tries to read the license file # from /etc/puppetlabs/license.key +# @param [Optional[String]] content +# An array of rsan ip addresses +# Defaults to the output of a PuppetDB query function rsan::license_uuid(Optional[String] $content) >> String { $license_file_path = '/etc/puppetlabs/license.key' if $content { diff --git a/manifests/exporter.pp b/manifests/exporter.pp index f43cc7d..9bcd273 100644 --- a/manifests/exporter.pp +++ b/manifests/exporter.pp @@ -1,15 +1,13 @@ -# +# Sets up target nodes with nessary services and access for RSAN # When Applied to the Infrastruture Agent Node group, -#Will dynamically configure all matching nodes to allow access to key elements of Puppet Enterprise to the RSAN node -# @param [Array] rsan_ip_list +# Will dynamically configure all matching nodes to allow access to key elements of Puppet Enterprise to the RSAN node +# @param [Array] rsan_importer_ips # An array of rsan ip addresses # Defaults to the output of a PuppetDB query -# @param [String] rsan_host +# @param [Optional[String]] rsan_host # The certname of the rsan node -# # @example # include rsan::exporter - class rsan::exporter ( Array $rsan_importer_ips = rsan::get_rsan_importer_ips(), Optional[String] $rsan_host = undef, diff --git a/manifests/remove_exporter.pp b/manifests/remove_exporter.pp index 0614f74..8a30fc2 100644 --- a/manifests/remove_exporter.pp +++ b/manifests/remove_exporter.pp @@ -1,6 +1,6 @@ -# @summary A short summary of the purpose of this class +# @summary disables and removes services and components enabled by the exporter class # -# A description of what this class does +# In the event RSAN should be uninstalled on all or some of the exporter nodes, this will stop NFS service, and remove the database components if applied to a postgres node # # @example # include rsan::remove_exporter diff --git a/metadata.json b/metadata.json index 5df6d96..c24c8dd 100644 --- a/metadata.json +++ b/metadata.json @@ -12,10 +12,6 @@ "name": "puppetlabs/postgresql", "version_requirement": ">= 6.6.0 < 7.0.0" }, - { - "name": "puppetlabs/puppet_metrics_collector", - "version_requirement": ">= 6.1.0 < 7.0.0" - }, { "name": "puppetlabs/puppet_metrics_dashboard", "version_requirement": ">= 2.3.0 < 3.0.0" @@ -62,10 +58,10 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 6.0.0 < 7.0.0" + "version_requirement": ">= 6.16.0 < 8.0.0" } ], - "pdk-version": "1.18.1", + "pdk-version": "2.1.0", "template-url": "https://github.com/puppetlabs/pdk-templates#master", "template-ref": "remotes/origin/master-0-ga58fd92" }