From b219258a141eba790b81045b5e8ea59ef88c6502 Mon Sep 17 00:00:00 2001 From: Jake Reynolds Date: Mon, 24 Feb 2020 17:15:51 +0000 Subject: [PATCH] Support corosync v3 on RedHat8 --- REFERENCE.md | 657 ++++++++++++++++++++++++-------------------- manifests/init.pp | 4 +- manifests/params.pp | 10 +- metadata.json | 6 +- 4 files changed, 371 insertions(+), 306 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 5386a035..3daf8a99 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -1,20 +1,21 @@ # Reference + ## Table of Contents -**Classes** +### Classes * [`corosync`](#corosync): Configures the Pacemaker+Corosync stack to provide high-availability. * [`corosync::params`](#corosyncparams): Configures sane defaults based on the operating system. * [`corosync::qdevice`](#corosyncqdevice): Performs basic initial configuration of the qdevice daemon on a node. * [`corosync::reprobe`](#corosyncreprobe): Triggers re-probe for changes any of the native cs_* types. -**Defined types** +### Defined types * [`corosync::service`](#corosyncservice): Declare services within /etc/corosync/service.d/ (Corosync 1.x) -**Resource types** +### Resource types * [`cs_clone`](#cs_clone): Type for manipulating corosync/pacemaker resource clone. More information on Corosync/Pacemaker colocation can be found here: * http://www.c * [`cs_colocation`](#cs_colocation): Type for manipulating corosync/pacemaker colocation. Colocation is the grouping together of a set of primitives so that they travel together @@ -23,22 +24,22 @@ * [`cs_location`](#cs_location): Type for manipulating corosync/pacemaker resource location. More information on Corosync/Pacemaker colocation can be found here: * http://ww * [`cs_order`](#cs_order): Type for manipulating Corosync/Pacemkaer ordering entries. Order entries are another type of constraint that can be put on sets of primitive * [`cs_primitive`](#cs_primitive): Type for manipulating Corosync/Pacemaker primitives. Primitives are probably the most important building block when creating highly availabl -* [`cs_property`](#cs_property): Type for manipulating corosync/pacemaker configuration properties. Besides the configuration file that is managed by the module the contains +* [`cs_property`](#cs_property): Type for manipulating corosync/pacemaker configuration properties. Besides the configuration file that is managed by the module the contains * [`cs_rsc_defaults`](#cs_rsc_defaults): Type for manipulating corosync/pacemaker global defaults for resource options. The type is pretty simple interface for setting key/value pair -* [`cs_shadow`](#cs_shadow): cs_shadow resources represent a Corosync shadow CIB. Any corosync resources defined with 'cib' set to the title of a cs_shadow resource will +* [`cs_shadow`](#cs_shadow): cs_shadow resources represent a Corosync shadow CIB. Any corosync resources defined with 'cib' set to the title of a cs_shadow resource will -**Data types** +### Data types -* [`Corosync::ArrayRing`](#corosyncarrayring): +* [`Corosync::ArrayRing`](#corosyncarrayring) * [`Corosync::CryptoCipher`](#corosynccryptocipher): Defines the allowed cipher types for secure corosync communication -* [`Corosync::CryptoHash`](#corosynccryptohash): -* [`Corosync::IpStringIp`](#corosyncipstringip): -* [`Corosync::QuorumAlgorithm`](#corosyncquorumalgorithm): -* [`Corosync::Syslogpriority`](#corosyncsyslogpriority): +* [`Corosync::CryptoHash`](#corosynccryptohash) +* [`Corosync::IpStringIp`](#corosyncipstringip) +* [`Corosync::QuorumAlgorithm`](#corosyncquorumalgorithm) +* [`Corosync::Syslogpriority`](#corosyncsyslogpriority) ## Classes -### corosync +### `corosync` This class will set up corosync for use by the Puppet Enterprise console to facilitate an active/standby configuration for high availability. It is @@ -76,7 +77,7 @@ Data type: `Boolean` Controls corosync's ability to authenticate and encrypt multicast messages. -Default value: $corosync::params::enable_secauth +Default value: `$corosync::params::enable_secauth` ##### `authkey_source` @@ -84,17 +85,17 @@ Data type: `Enum['file', 'string']` Allows to use either a file or a string as a authkey. -Default value: $corosync::params::authkey_source +Default value: `$corosync::params::authkey_source` ##### `authkey` -Data type: `Variant[Stdlib::Absolutepath,Stdlib::Base64]` +Data type: `Variant[Stdlib::Filesource,Stdlib::Base64]` Specifies the path to the CA which is used to sign Corosync's certificate if authkey_source is 'file' or a base64 encoded version of the actual authkey if 'string' is used instead. -Default value: $corosync::params::authkey +Default value: `$corosync::params::authkey` ##### `crypto_hash` @@ -103,7 +104,7 @@ Data type: `Corosync::CryptoHash` Hashing algorithm used by corosync for intra-cluster communication. Valid values are none, md5, sha1, sha256, sha384, and sha512 -Default value: 'sha1' +Default value: `'sha1'` ##### `crypto_cipher` @@ -112,7 +113,7 @@ Data type: `Corosync::CryptoCipher` Encryption cipher used by corosync for intra-cluster communication. Valid values are none, aes256, aes192, aes128, and 3des -Default value: 'aes256' +Default value: `'aes256'` ##### `threads` @@ -122,7 +123,7 @@ How many threads you are going to let corosync use to encode and decode multicast messages. If you turn off secauth then corosync will ignore threads. -Default value: `undef` +Default value: ``undef`` ##### `bind_address` @@ -131,7 +132,7 @@ Data type: `Corosync::IpStringIp` The ip address we are going to bind the corosync daemon too. Can be specified as an array to have multiple rings. -Default value: $corosync::params::bind_address +Default value: `$corosync::params::bind_address` ##### `port` @@ -141,7 +142,7 @@ The UDP port that corosync will use to do its multicast communication. Be aware that corosync used this defined port plus minus one. Can be specified as an array to have multiple rings. -Default value: $corosync::params::port +Default value: `$corosync::params::port` ##### `multicast_address` @@ -152,7 +153,7 @@ default way that Corosync accomplishes communication across the cluster. Use 'broadcast' to have broadcast instead Can be specified as an array to have multiple rings (multicast only). -Default value: `undef` +Default value: ``undef`` ##### `unicast_addresses` @@ -165,7 +166,7 @@ make this possible. You can also have an array of arrays to have multiple rings. In that case, each subarray matches a host IP addresses. -Default value: `undef` +Default value: ``undef`` ##### `force_online` @@ -174,7 +175,7 @@ Data type: `Boolean` Boolean parameter specifying whether to force nodes that have been put in standby back online. -Default value: $corosync::params::force_online +Default value: `$corosync::params::force_online` ##### `check_standby` @@ -183,7 +184,7 @@ Data type: `Boolean` Boolean parameter specifying whether puppet should return an error log message if a node is in standby. Useful for monitoring node state. -Default value: $corosync::params::check_standby +Default value: `$corosync::params::check_standby` ##### `log_timestamp` @@ -192,7 +193,7 @@ Data type: `Boolean` Boolean parameter specifying whether a timestamp should be placed on all log messages. -Default value: $corosync::params::log_timestamp +Default value: `$corosync::params::log_timestamp` ##### `log_file` @@ -201,7 +202,7 @@ Data type: `Boolean` Boolean parameter specifying whether Corosync should produce debug output in a logfile. -Default value: $corosync::params::log_file +Default value: `$corosync::params::log_file` ##### `log_file_name` @@ -210,7 +211,7 @@ Data type: `Optional[Stdlib::Absolutepath]` Absolute path to the logfile Corosync should use when `$log_file` (see above) is true. -Default value: `undef` +Default value: ``undef`` ##### `debug` @@ -219,7 +220,7 @@ Data type: `Boolean` Boolean parameter specifying whether Corosync should produce debug output in its logs. -Default value: $corosync::params::debug +Default value: `$corosync::params::debug` ##### `log_stderr` @@ -228,7 +229,7 @@ Data type: `Boolean` Boolean parameter specifying whether Corosync should log errors to stderr. -Default value: $corosync::params::log_stderr +Default value: `$corosync::params::log_stderr` ##### `syslog_priority` @@ -237,7 +238,7 @@ Data type: `Corosync::SyslogPriority` String parameter specifying the minimal log level for Corosync syslog messages. Allowed values: debug|info|notice|warning|err|emerg. -Default value: $corosync::params::syslog_priority +Default value: `$corosync::params::syslog_priority` ##### `log_function_name` @@ -246,7 +247,7 @@ Data type: `Boolean` Boolean parameter specifying whether Corosync should log called function names to. -Default value: $corosync::params::log_function_name +Default value: `$corosync::params::log_function_name` ##### `rrp_mode` @@ -254,7 +255,7 @@ Data type: `Optional[Enum['none', 'active', 'passive']]` Mode of redundant ring. May be none, active, or passive. -Default value: `undef` +Default value: ``undef`` ##### `netmtu` @@ -262,7 +263,7 @@ Data type: `Optional[Integer]` This specifies the network maximum transmit unit. -Default value: `undef` +Default value: ``undef`` ##### `ttl` @@ -270,7 +271,7 @@ Data type: `Optional[Integer[0,255]]` Time To Live. -Default value: `undef` +Default value: ``undef`` ##### `vsftype` @@ -278,7 +279,7 @@ Data type: `Optional[Enum['ykd', 'none']]` Virtual synchrony filter type. -Default value: `undef` +Default value: ``undef`` ##### `package_corosync` @@ -286,7 +287,7 @@ Data type: `Boolean` Define if package corosync should be managed. -Default value: $corosync::params::package_corosync +Default value: `$corosync::params::package_corosync` ##### `package_crmsh` @@ -294,9 +295,9 @@ Data type: `Boolean` Define if package crmsh should be managed. Default (Debian): true -Default: false +Default: false -Default value: $corosync::params::package_crmsh +Default value: `$corosync::params::package_crmsh` ##### `package_pacemaker` @@ -304,17 +305,17 @@ Data type: `Boolean` Define if package pacemaker should be managed. -Default value: $corosync::params::package_pacemaker +Default value: `$corosync::params::package_pacemaker` ##### `package_pcs` Data type: `Boolean` Define if package pcs should be managed. -Default (Red Hat based): true -Default (otherwise): false +Default (Debian): false +Default: true -Default value: $corosync::params::package_pcs +Default value: `$corosync::params::package_pcs` ##### `package_fence_agents` @@ -324,7 +325,7 @@ Define if package fence-agents should be managed. Default (Red Hat based): true Default (otherwise): false -Default value: $corosync::params::package_fence_agents +Default value: `$corosync::params::package_fence_agents` ##### `packageopts_corosync` @@ -333,7 +334,7 @@ Data type: `Optional[Array[String[1]]]` Additional install-options for the corosync package resource. Default: undef -Default value: $corosync::params::package_install_options +Default value: `$corosync::params::package_install_options` ##### `packageopts_crmsh` @@ -342,7 +343,7 @@ Data type: `Optional[Array[String[1]]]` Additional install-options for the crmsh package resource. Default: undef -Default value: $corosync::params::package_install_options +Default value: `$corosync::params::package_install_options` ##### `packageopts_pacemaker` @@ -351,7 +352,7 @@ Data type: `Optional[Array[String[1]]]` Additional install-options for the pacemaker package resource. Default: undef -Default value: $corosync::params::package_install_options +Default value: `$corosync::params::package_install_options` ##### `packageopts_pcs` @@ -360,7 +361,7 @@ Data type: `Optional[Array[String[1]]]` Additional install-options for the pcs package resource. Default: undef -Default value: $corosync::params::package_install_options +Default value: `$corosync::params::package_install_options` ##### `packageopts_fence_agents` @@ -369,7 +370,7 @@ Data type: `Optional[Array[String[1]]]` Additional install-options for the pcs package resource. Default: undef -Default value: $corosync::params::package_install_options +Default value: `$corosync::params::package_install_options` ##### `version_corosync` @@ -378,7 +379,7 @@ Data type: `String[1]` Define what version of the corosync package should be installed. Default: 'present' -Default value: $corosync::params::version_corosync +Default value: `$corosync::params::version_corosync` ##### `version_crmsh` @@ -387,7 +388,7 @@ Data type: `String[1]` Define what version of the crmsh package should be installed. Default: 'present' -Default value: $corosync::params::version_crmsh +Default value: `$corosync::params::version_crmsh` ##### `version_pacemaker` @@ -396,7 +397,7 @@ Data type: `String[1]` Define what version of the pacemaker package should be installed. Default: 'present' -Default value: $corosync::params::version_pacemaker +Default value: `$corosync::params::version_pacemaker` ##### `version_pcs` @@ -405,7 +406,7 @@ Data type: `String[1]` Define what version of the pcs package should be installed. Default: 'present' -Default value: $corosync::params::version_pcs +Default value: `$corosync::params::version_pcs` ##### `version_fence_agents` @@ -414,7 +415,7 @@ Data type: `String[1]` Define what version of the fence-agents-all package should be installed. Default: 'present' -Default value: $corosync::params::version_fence_agents +Default value: `$corosync::params::version_fence_agents` ##### `set_votequorum` @@ -425,7 +426,7 @@ Default (Red Hat based): true Default (Ubuntu >= 14.04): true Default (otherwise): false -Default value: $corosync::params::set_votequorum +Default value: `$corosync::params::set_votequorum` ##### `votequorum_expected_votes` @@ -434,7 +435,7 @@ Data type: `Optional[Integer]` Overrides the automatic calculation of expected votes which is normally derived from the number of nodes. -Default value: `undef` +Default value: ``undef`` ##### `quorum_members` @@ -445,7 +446,7 @@ is set to true. You can also have an array of arrays to have multiple rings. In that case, each subarray matches a member IP addresses. -Default value: ['localhost'] +Default value: `['localhost']` ##### `quorum_members_ids` @@ -455,7 +456,7 @@ Array of quorum member IDs. Persistent IDs are required for the dynamic config of a corosync cluster and when_set_votequorum is set to true. Should be used only with the quorum_members parameter. -Default value: `undef` +Default value: ``undef`` ##### `quorum_members_names` @@ -464,7 +465,7 @@ Data type: `Optional[Array]` Array of quorum member names. Persistent names are required when you define IP addresses in quorum_members. -Default value: `undef` +Default value: ``undef`` ##### `token` @@ -472,7 +473,7 @@ Data type: `Optional[Integer]` Time (in ms) to wait for a token -Default value: `undef` +Default value: ``undef`` ##### `token_retransmits_before_loss_const` @@ -480,7 +481,7 @@ Data type: `Optional[Integer]` How many token retransmits before forming a new configuration. -Default value: `undef` +Default value: ``undef`` ##### `compatibility` @@ -489,7 +490,7 @@ Data type: `Optional[String]` Older versions of corosync allowed a config-file directive to indicate backward compatibility. This sets that. -Default value: `undef` +Default value: ``undef`` ##### `enable_corosync_service` @@ -497,7 +498,7 @@ Data type: `Boolean` Whether the module should enable the corosync service. -Default value: $corosync::params::enable_corosync_service +Default value: `$corosync::params::enable_corosync_service` ##### `manage_corosync_service` @@ -506,7 +507,7 @@ Data type: `Boolean` Whether the module should try to manage the corosync service. If set to false, the service will need to be specified in the catalog elsewhere. -Default value: $corosync::params::manage_corosync_service +Default value: `$corosync::params::manage_corosync_service` ##### `enable_pacemaker_service` @@ -514,7 +515,7 @@ Data type: `Boolean` Whether the module should enable the pacemaker service. -Default value: $corosync::params::enable_pacemaker_service +Default value: `$corosync::params::enable_pacemaker_service` ##### `manage_pacemaker_service` @@ -525,7 +526,7 @@ Default (Red Hat based >= 7): true Default (Ubuntu >= 14.04): true Default (otherwise): false -Default value: $corosync::params::manage_pacemaker_service +Default value: `$corosync::params::manage_pacemaker_service` ##### `enable_pcsd_service` @@ -533,7 +534,7 @@ Data type: `Boolean` Whether the module should enable the pcsd service. -Default value: $corosync::params::enable_pcsd_service +Default value: `$corosync::params::enable_pcsd_service` ##### `manage_pcsd_service` @@ -543,7 +544,7 @@ Whether the module should try to manage the pcsd service in addition to the corosync service. pcsd service is the GUI and the remote configuration interface. -Default value: `false` +Default value: ``false`` ##### `manage_pcsd_auth` @@ -556,7 +557,7 @@ the entries in quorum_members match the trusted certnames of the nodes in the environment or the IP addresses of the primary adapters. $sensitive_hacluster_password is mandatory if this parameter is set. -Default value: `false` +Default value: ``false`` ##### `manage_pcsd_auth_node` @@ -567,7 +568,7 @@ work. Note that only one node 'should' do the work and nodes are chosen by matching local facts to the contents of quorum_members. When manage_pcsd_auth is disabled this parameter has no effect. -Default value: 'first' +Default value: `'first'` ##### `sensitive_hacluster_password` @@ -578,7 +579,7 @@ password for the hacluster user. If both $manage_pcsd_service and $manage_pcsd_auth are both set to true the cluster will use this credential to authorize all nodes. -Default value: `undef` +Default value: ``undef`` ##### `sensitive_hacluster_hash` @@ -588,7 +589,7 @@ This parameter expects a valid password hash of sensitive_hacluster_password. If provided, the hash provided the hash will be used to set the password for the hacluster user on each node. -Default value: `undef` +Default value: ``undef`` ##### `manage_quorum_device` @@ -600,7 +601,7 @@ fencing by providing an external network vote. Additionally, this allows symmentric clusters to continue operation in the event that 50% of their nodes have failed. -Default value: `false` +Default value: ``false`` ##### `quorum_device_host` @@ -609,7 +610,7 @@ Data type: `Optional[Stdlib::Fqdn]` The fully qualified hostname of the quorum device. This parameter is mandatory when manage_quorum_device is true. -Default value: `undef` +Default value: ``undef`` ##### `quorum_device_algorithm` @@ -621,7 +622,7 @@ last-man-standing. See the [corosync-qdevice man page](https://www.systutorials.com/docs/linux/man/8-corosync-qdevice/) for details. -Default value: 'ffsplit' +Default value: `'ffsplit'` ##### `package_quorum_device` @@ -630,7 +631,7 @@ Data type: `Optional[String]` The name of the package providing the quorum device functionality. This parameter is mandatory if manage_quorum_device is true. -Default value: $corosync::params::package_quorum_device +Default value: `$corosync::params::package_quorum_device` ##### `sensitive_quorum_device_password` @@ -639,7 +640,7 @@ Data type: `Optional[Sensitive[String]]` The plain text password for the hacluster user on the quorum_device_host. This parameter is mandatory if manage_quorum_device is true. -Default value: `undef` +Default value: ``undef`` ##### `cluster_name` @@ -648,7 +649,7 @@ Data type: `Optional[String[1]]` This specifies the name of cluster and it's used for automatic generating of multicast address. -Default value: `undef` +Default value: ``undef`` ##### `join` @@ -657,7 +658,7 @@ Data type: `Optional[Integer]` This timeout specifies in milliseconds how long to wait for join messages in the membership protocol. -Default value: `undef` +Default value: ``undef`` ##### `consensus` @@ -669,7 +670,7 @@ The minimum value for consensus must be 1.2 * token. This value will be automatically calculated at 1.2 * token if the user doesn't specify a consensus value. -Default value: `undef` +Default value: ``undef`` ##### `ip_version` @@ -684,7 +685,7 @@ list if there is such address, otherwise use first IPv4 address). Default (if unspecified) is ipv6-4 for knet and udpu transports and ipv4 for udp. -Default value: `undef` +Default value: ``undef`` ##### `clear_node_high_bit` @@ -699,7 +700,7 @@ the high bit to be zero and therefor ensure the nodeid is a positive signed WARNING: The clusters behavior is undefined if this option is enabled on only a subset of the cluster (for example during a rolling upgrade). -Default value: `undef` +Default value: ``undef`` ##### `max_messages` @@ -709,7 +710,7 @@ This constant specifies the maximum number of messages that may be sent by one processor on receipt of the token. The max_messages parameter is limited to 256000 / netmtu to prevent overflow of the kernel transmit buffers. -Default value: `undef` +Default value: ``undef`` ##### `test_corosync_config` @@ -718,13 +719,21 @@ Data type: `Boolean` Whether we should test new configuration files with `corosync -t`. (requires corosync 2.3.4) -Default value: $corosync::params::test_corosync_config +Default value: `$corosync::params::test_corosync_config` + +##### `test_corosync_config_cmd` + +Data type: `String[1]` + + -### corosync::params +Default value: `$corosync::params::test_corosync_config_cmd` + +### `corosync::params` Configures sane defaults based on the operating system. -### corosync::qdevice +### `corosync::qdevice` This class performs the configuration of the qdevice daemon on a target node. Note that this requires corosync 2.x and must never be deployed on a node @@ -733,7 +742,7 @@ correct firewall ports for both pcs, and the actual quorum device as shown in the included example. * **See also** -https://www.systutorials.com/docs/linux/man/8-corosync-qnetd/ + * https://www.systutorials.com/docs/linux/man/8-corosync-qnetd/ #### Examples @@ -783,7 +792,7 @@ The password hash for the hacluster user on this quorum device node. This is currently a mandatory parameter because pcsd must be used to perform the quorum node configuration. -Default value: `undef` +Default value: ``undef`` ##### `package_pcs` @@ -791,7 +800,7 @@ Data type: `String[1]` Name of the PCS package on this system. -Default value: 'pcs' +Default value: `'pcs'` ##### `package_corosync_qnetd` @@ -799,9 +808,9 @@ Data type: `String[1]` Name of the corosync qnetd package for this system. -Default value: 'corosync-qnetd' +Default value: `'corosync-qnetd'` -### corosync::reprobe +### `corosync::reprobe` Include this class to reprobe the corosync cluster when there are changes in any of the native cs_* types. Useful for multi-node provisioning when the @@ -820,7 +829,7 @@ include corosync::reprobe ## Defined types -### corosync::service +### `corosync::service` Models a Corosync service. Corosync services are plugins that provide functionality for monitoring cluster resources. One of the most common @@ -865,7 +874,7 @@ Version of the protocol used by this service. This is currently unused. ## Resource types -### cs_clone +### `cs_clone` Type for manipulating corosync/pacemaker resource clone. More information on Corosync/Pacemaker colocation can be found here: @@ -876,88 +885,80 @@ More information on Corosync/Pacemaker colocation can be found here: The following properties are available in the `cs_clone` type. -##### `ensure` - -Valid values: present, absent - -The basic property that the resource should be in. - -Default value: present - -##### `primitive` - -The corosync resource primitive to be cloned. - -##### `group` - -The corosync resource group to be cloned. - ##### `clone_max` -Valid values: %r{\d+}, absent +Valid values: `%r{\d+}`, `absent` How many copies of the resource to start. Defaults to the number of nodes in the cluster. -Default value: absent +Default value: `absent` ##### `clone_node_max` -Valid values: %r{\d+}, absent +Valid values: `%r{\d+}`, `absent` How many copies of the resource can be started on a single node. Defaults to 1. -Default value: absent +Default value: `absent` -##### `notify_clones` +##### `ensure` -Valid values: `true`, `false`, absent +Valid values: `present`, `absent` -When stopping or starting a copy of the clone, tell all the other copies beforehand -and when the action was successful. -Allowed values: true, false +The basic property that the resource should be in. -Default value: absent +Default value: `present` ##### `globally_unique` -Valid values: `true`, `false`, absent +Valid values: ``true``, ``false``, `absent` Does each copy of the clone perform a different function? Allowed values: true, false -Default value: absent - -##### `ordered` +Default value: `absent` -Valid values: `true`, `false`, absent - -Should the copies be started in series (instead of in parallel). Allowed values: true, false +##### `group` -Default value: absent +The corosync resource group to be cloned. ##### `interleave` -Valid values: `true`, `false`, absent +Valid values: ``true``, ``false``, `absent` Changes the behavior of ordering constraints (between clones/masters) so that instances can start/stop as soon as their peer instance has (rather than waiting for every instance of the other clone has). Allowed values: true, false -Default value: absent +Default value: `absent` -#### Parameters +##### `notify_clones` -The following parameters are available in the `cs_clone` type. +Valid values: ``true``, ``false``, `absent` -##### `name` +When stopping or starting a copy of the clone, tell all the other copies beforehand +and when the action was successful. +Allowed values: true, false -namevar +Default value: `absent` -Identifier of the clone entry. This value needs to be unique -across the entire Corosync/Pacemaker configuration since it doesn't have -the concept of name spaces per type. +##### `ordered` + +Valid values: ``true``, ``false``, `absent` + +Should the copies be started in series (instead of in parallel). Allowed values: true, false + +Default value: `absent` + +##### `primitive` + +The corosync resource primitive to be cloned. + +#### Parameters + +The following parameters are available in the `cs_clone` type. ##### `cib` @@ -970,7 +971,20 @@ This paramater sets the CIB this colocation should be created in. A cs_shadow resource with a title of the same name as this value should also be added to your manifest. -### cs_colocation +##### `name` + +namevar + +Identifier of the clone entry. This value needs to be unique +across the entire Corosync/Pacemaker configuration since it doesn't have +the concept of name spaces per type. + +##### `provider` + +The specific backend to use for this `cs_clone` resource. You will seldom need to specify this --- Puppet will usually +discover the appropriate provider for your platform. + +### `cs_colocation` Type for manipulating corosync/pacemaker colocation. Colocation is the grouping together of a set of primitives so that they travel @@ -988,11 +1002,11 @@ The following properties are available in the `cs_colocation` type. ##### `ensure` -Valid values: present, absent +Valid values: `present`, `absent` The basic property that the resource should be in. -Default value: present +Default value: `present` ##### `primitives` @@ -1021,20 +1035,12 @@ primitives get priority when forcing the move of other primitives. This value can be an integer but is often defined as the string INFINITY. -Default value: INFINITY +Default value: `INFINITY` #### Parameters The following parameters are available in the `cs_colocation` type. -##### `name` - -namevar - -Identifier of the colocation entry. This value needs to be unique -across the entire Corosync/Pacemaker configuration since it doesn't have -the concept of name spaces per type. - ##### `cib` Corosync applies its configuration immediately. Using a CIB allows @@ -1046,7 +1052,20 @@ This paramater sets the CIB this colocation should be created in. A cs_shadow resource with a title of the same name as this value should also be added to your manifest. -### cs_commit +##### `name` + +namevar + +Identifier of the colocation entry. This value needs to be unique +across the entire Corosync/Pacemaker configuration since it doesn't have +the concept of name spaces per type. + +##### `provider` + +The specific backend to use for this `cs_colocation` resource. You will seldom need to specify this --- Puppet will +usually discover the appropriate provider for your platform. + +### `cs_commit` Final commit statement which triggers the syncronous application of all primitive changes which reference this CIB. Do not generate more @@ -1067,7 +1086,12 @@ namevar Name of the CIB to commit. See the cib parameter for more detail. -### cs_group +##### `provider` + +The specific backend to use for this `cs_commit` resource. You will seldom need to specify this --- Puppet will usually +discover the appropriate provider for your platform. + +### `cs_group` Type for manipulating Corosync/Pacemkaer group entries. Groups are a set or resources (primitives) that need to be @@ -1083,11 +1107,11 @@ The following properties are available in the `cs_group` type. ##### `ensure` -Valid values: present, absent +Valid values: `present`, `absent` The basic property that the resource should be in. -Default value: present +Default value: `present` ##### `primitives` @@ -1098,14 +1122,6 @@ order that you wish them to start. The following parameters are available in the `cs_group` type. -##### `name` - -namevar - -Name identifier of this group entry. This value needs to be unique -across the entire Corosync/Pacemaker configuration since it doesn't have -the concept of name spaces per type. - ##### `cib` Corosync applies its configuration immediately. Using a CIB allows @@ -1117,7 +1133,20 @@ This paramater sets the CIB this order should be created in. A cs_shadow resource with a title of the same name as this value should also be added to your manifest. -### cs_location +##### `name` + +namevar + +Name identifier of this group entry. This value needs to be unique +across the entire Corosync/Pacemaker configuration since it doesn't have +the concept of name spaces per type. + +##### `provider` + +The specific backend to use for this `cs_group` resource. You will seldom need to specify this --- Puppet will usually +discover the appropriate provider for your platform. + +### `cs_location` Type for manipulating corosync/pacemaker resource location. More information on Corosync/Pacemaker colocation can be found here: @@ -1130,36 +1159,26 @@ The following properties are available in the `cs_location` type. ##### `ensure` -Valid values: present, absent +Valid values: `present`, `absent` The basic property that the resource should be in. -Default value: present - -##### `primitive` - -The corosync resource primitive to have a location applied. +Default value: `present` ##### `node_name` The corosync node_name where the resource should be located. +##### `primitive` + +The corosync resource primitive to have a location applied. + ##### `resource_discovery` Whether Pacemaker should perform resource discovery on this node for the specified resource. It matches the resource-discovery location property in pacemaker -##### `score` - -The priority of this location. Primitives can be a part of -multiple location groups and so there is a way to control which -primitives get priority when forcing the move of other primitives. -This value can be an integer but is often defined as the string -INFINITY. - -Default value: INFINITY - ##### `rules` The rules of this location. This is an array of hashes where @@ -1190,17 +1209,19 @@ Example: ], } -#### Parameters +##### `score` -The following parameters are available in the `cs_location` type. +The priority of this location. Primitives can be a part of +multiple location groups and so there is a way to control which +primitives get priority when forcing the move of other primitives. +This value can be an integer but is often defined as the string +INFINITY. -##### `name` +Default value: `INFINITY` -namevar +#### Parameters -Identifier of the location entry. This value needs to be unique -across the entire Corosync/Pacemaker configuration since it doesn't have -the concept of name spaces per type. +The following parameters are available in the `cs_location` type. ##### `cib` @@ -1213,7 +1234,20 @@ This paramater sets the CIB this colocation should be created in. A cs_shadow resource with a title of the same name as this value should also be added to your manifest. -### cs_order +##### `name` + +namevar + +Identifier of the location entry. This value needs to be unique +across the entire Corosync/Pacemaker configuration since it doesn't have +the concept of name spaces per type. + +##### `provider` + +The specific backend to use for this `cs_location` resource. You will seldom need to specify this --- Puppet will +usually discover the appropriate provider for your platform. + +### `cs_order` Type for manipulating Corosync/Pacemkaer ordering entries. Order entries are another type of constraint that can be put on sets of @@ -1231,11 +1265,11 @@ The following properties are available in the `cs_order` type. ##### `ensure` -Valid values: present, absent +Valid values: `present`, `absent` The basic property that the resource should be in. -Default value: present +Default value: `present` ##### `first` @@ -1243,21 +1277,6 @@ First Corosync primitive. Just like colocation, our primitives for ording come in pairs but this time order matters so we need to define which primitive starts the desired state change chain. -##### `second` - -Second Corosync primitive. Our second primitive will move to the -desired state after the first primitive. - -##### `score` - -The priority of the this ordered grouping. Primitives can be a part -of multiple order groups and so there is a way to control which -primitives get priority when forcing the order of state changes on -other primitives. This value can be an integer but is often defined -as the string INFINITY. - -Default value: INFINITY - ##### `kind` How to enforce the constraint. @@ -1274,27 +1293,34 @@ the resources. First and then can start in either order, but one must complete starting before the other can be started. A typical use case is when resource start-up puts a high load on the host. -Default value: Mandatory +Default value: `Mandatory` + +##### `score` + +The priority of the this ordered grouping. Primitives can be a part +of multiple order groups and so there is a way to control which +primitives get priority when forcing the order of state changes on +other primitives. This value can be an integer but is often defined +as the string INFINITY. +When using pcs as provider this value is not used. +It is generally preferred to use the `kind` parameter. + +##### `second` + +Second Corosync primitive. Our second primitive will move to the +desired state after the first primitive. ##### `symmetrical` Boolean specifying if the resources should stop in reverse order. Default value: true. -Default value: true +Default value: `true` #### Parameters The following parameters are available in the `cs_order` type. -##### `name` - -namevar - -Name identifier of this ordering entry. This value needs to be unique -across the entire Corosync/Pacemaker configuration since it doesn't have -the concept of name spaces per type. - ##### `cib` Corosync applies its configuration immediately. Using a CIB allows @@ -1306,7 +1332,20 @@ This paramater sets the CIB this order should be created in. A cs_shadow resource with a title of the same name as this value should also be added to your manifest. -### cs_primitive +##### `name` + +namevar + +Name identifier of this ordering entry. This value needs to be unique +across the entire Corosync/Pacemaker configuration since it doesn't have +the concept of name spaces per type. + +##### `provider` + +The specific backend to use for this `cs_order` resource. You will seldom need to specify this --- Puppet will usually +discover the appropriate provider for your platform. + +### `cs_primitive` Type for manipulating Corosync/Pacemaker primitives. Primitives are probably the most important building block when creating highly @@ -1329,22 +1368,27 @@ The following properties are available in the `cs_primitive` type. ##### `ensure` -Valid values: present, absent +Valid values: `present`, `absent` The basic property that the resource should be in. -Default value: present +Default value: `present` -##### `parameters` +##### `metadata` -A hash of params for the primitive. Parameters in a primitive are -used by the underlying resource agent, each class using them slightly -differently. In ocf scripts they are exported and pulled into the -script as variables to be used. Since the list of these parameters -are completely arbitrary and validity not enforced we simply defer -defining a model and just accept a hash. +A hash of metadata for the primitive. A primitive can have a set of +metadata that doesn't affect the underlying Corosync type/provider but +affect that concept of a resource. This metadata is similar to Puppet's +resources resource and some meta-parameters, they change resource +behavior but have no affect of the data that is synced or manipulated. + +Default value: `Hash.new` + +##### `ms_metadata` -Default value: Hash.new +A hash of metadata for the master/slave primitive state. + +Default value: `Hash.new` ##### `operations` @@ -1356,40 +1400,22 @@ and just accept a hash. There maybe room to model this one but it would require a review of all resource agents to see if each operation is valid. -Default value: Hash.new - -##### `utilization` - -A hash of utilization attributes for the primitive. If nodes are -also configured with available resources, and Pacemaker's placement -stratgey is set appropriately, then Pacemaker can place primitives on -nodes only where resources are available. - -See the Pacemaker documentation: - -http://clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Pacemaker_Explained/ch11.html - -Default value: Hash.new - -##### `metadata` - -A hash of metadata for the primitive. A primitive can have a set of -metadata that doesn't affect the underlying Corosync type/provider but -affect that concept of a resource. This metadata is similar to Puppet's -resources resource and some meta-parameters, they change resource -behavior but have no affect of the data that is synced or manipulated. - -Default value: Hash.new +Default value: `Hash.new` -##### `ms_metadata` +##### `parameters` -A hash of metadata for the master/slave primitive state. +A hash of params for the primitive. Parameters in a primitive are +used by the underlying resource agent, each class using them slightly +differently. In ocf scripts they are exported and pulled into the +script as variables to be used. Since the list of these parameters +are completely arbitrary and validity not enforced we simply defer +defining a model and just accept a hash. -Default value: Hash.new +Default value: `Hash.new` ##### `promotable` -Valid values: `true`, `false` +Valid values: ``true``, ``false`` Designates if the primitive is capable of being managed in a master/slave state. This will create a new ms resource in your Corosync config and add @@ -1398,12 +1424,36 @@ your colocation and order resources too but Puppet won't. Currenlty we unmunge configuraiton entries that start with ms_ so that you don't have to account for name change in all our manifests. -Default value: false +Default value: `false` + +##### `utilization` + +A hash of utilization attributes for the primitive. If nodes are +also configured with available resources, and Pacemaker's placement +stratgey is set appropriately, then Pacemaker can place primitives on +nodes only where resources are available. + +See the Pacemaker documentation: + +http://clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Pacemaker_Explained/ch11.html + +Default value: `Hash.new` #### Parameters The following parameters are available in the `cs_primitive` type. +##### `cib` + +Corosync applies its configuration immediately. Using a CIB allows +you to group multiple primitives and relationships to be applied at +once. This can be necessary to insert complex configurations into +Corosync correctly. + +This paramater sets the CIB this primitive should be created in. A +cs_shadow resource with a title of the same name as this value should +also be added to your manifest. + ##### `name` namevar @@ -1440,25 +1490,19 @@ from the command line has Corosync installed: * `crm configure ra providers ` -##### `cib` - -Corosync applies its configuration immediately. Using a CIB allows -you to group multiple primitives and relationships to be applied at -once. This can be necessary to insert complex configurations into -Corosync correctly. +##### `provider` -This paramater sets the CIB this primitive should be created in. A -cs_shadow resource with a title of the same name as this value should -also be added to your manifest. +The specific backend to use for this `cs_primitive` resource. You will seldom need to specify this --- Puppet will +usually discover the appropriate provider for your platform. ##### `unmanaged_metadata` Metadata options that should not be managed by Puppet. Examples: ['target-role', 'is-managed'] -Default value: Array.new +Default value: `Array.new` -### cs_property +### `cs_property` Type for manipulating corosync/pacemaker configuration properties. Besides the configuration file that is managed by the module the contains @@ -1483,11 +1527,11 @@ The following properties are available in the `cs_property` type. ##### `ensure` -Valid values: present, absent +Valid values: `present`, `absent` The basic property that the resource should be in. -Default value: present +Default value: `present` ##### `value` @@ -1499,13 +1543,6 @@ cluster properties can range the gambit. The following parameters are available in the `cs_property` type. -##### `name` - -namevar - -Name identifier of this property. Simply the name of the cluster -property. Happily most of these are unique. - ##### `cib` Corosync applies its configuration immediately. Using a CIB allows @@ -1517,18 +1554,30 @@ This paramater sets the CIB this parameter should be created in. A cs_shadow resource with a title of the same name as this value should also be added to your manifest. +##### `name` + +namevar + +Name identifier of this property. Simply the name of the cluster +property. Happily most of these are unique. + +##### `provider` + +The specific backend to use for this `cs_property` resource. You will seldom need to specify this --- Puppet will +usually discover the appropriate provider for your platform. + ##### `replace` -Valid values: `true`, `false`, yes, no +Valid values: ``true``, ``false``, `yes`, `no` Whether to replace a property that already exists on the cluster whose value doesn't match what the `value` attribute specifies. Setting this to false allows cs_property resources to initialize properties without overwriting future changes. Defaults to `true`. -Default value: `true` +Default value: ``true`` -### cs_rsc_defaults +### `cs_rsc_defaults` Type for manipulating corosync/pacemaker global defaults for resource options. The type is pretty simple interface for setting @@ -1546,11 +1595,11 @@ The following properties are available in the `cs_rsc_defaults` type. ##### `ensure` -Valid values: present, absent +Valid values: `present`, `absent` The basic property that the resource should be in. -Default value: present +Default value: `present` ##### `value` @@ -1562,13 +1611,6 @@ resource options can range the gambit. The following parameters are available in the `cs_rsc_defaults` type. -##### `name` - -namevar - -Name identifier of this property. Simply the name of the resource -option. Happily most of these are unique. - ##### `cib` Corosync applies its configuration immediately. Using a CIB allows @@ -1580,7 +1622,19 @@ This paramater sets the CIB this rsc_defaults should be created in. A cs_shadow resource with a title of the same name as this value should also be added to your manifest. -### cs_shadow +##### `name` + +namevar + +Name identifier of this property. Simply the name of the resource +option. Happily most of these are unique. + +##### `provider` + +The specific backend to use for this `cs_rsc_defaults` resource. You will seldom need to specify this --- Puppet will +usually discover the appropriate provider for your platform. + +### `cs_shadow` cs_shadow resources represent a Corosync shadow CIB. Any corosync resources defined with 'cib' set to the title of a cs_shadow resource @@ -1595,30 +1649,35 @@ The following properties are available in the `cs_shadow` type. Implementation detail. DO NOT SET DIRECTLY. -Default value: latest +Default value: `latest` #### Parameters The following parameters are available in the `cs_shadow` type. +##### `autocommit` + +Valid values: ``true``, ``false``, `yes`, `no` + +Whether to generate a cs_commit or not. Can be used to create shadow +CIB without committing them. + +Default value: ``true`` + ##### `cib` namevar Name of the CIB to begin tracking changes against. -##### `autocommit` - -Valid values: `true`, `false`, yes, no +##### `provider` -Whether to generate a cs_commit or not. Can be used to create shadow -CIB without committing them. - -Default value: `true` +The specific backend to use for this `cs_shadow` resource. You will seldom need to specify this --- Puppet will usually +discover the appropriate provider for your platform. ## Data types -### Corosync::ArrayRing +### `Corosync::ArrayRing` The Corosync::ArrayRing data type. @@ -1626,19 +1685,19 @@ Alias of `Variant[Array[Stdlib::IP::Address], Array[ Array[Stdlib::IP::Address] ]]` -### Corosync::CryptoCipher +### `Corosync::CryptoCipher` Defines the allowed cipher types for secure corosync communication Alias of `Enum['aes256', 'aes192', 'aes128', '3des']` -### Corosync::CryptoHash +### `Corosync::CryptoHash` The Corosync::CryptoHash data type. Alias of `Enum['md5', 'sha1', 'sha256', 'sha384', 'sha512']` -### Corosync::IpStringIp +### `Corosync::IpStringIp` The Corosync::IpStringIp data type. @@ -1646,13 +1705,13 @@ Alias of `Variant[Stdlib::IP::Address, Array[ Stdlib::IP::Address ]]` -### Corosync::QuorumAlgorithm +### `Corosync::QuorumAlgorithm` The Corosync::QuorumAlgorithm data type. Alias of `Enum['ffsplit', 'lms']` -### Corosync::Syslogpriority +### `Corosync::Syslogpriority` The Corosync::Syslogpriority data type. diff --git a/manifests/init.pp b/manifests/init.pp index c265c649..16f6907b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -400,6 +400,7 @@ Optional[Enum['yes', 'no']] $clear_node_high_bit = undef, Optional[Integer] $max_messages = undef, Boolean $test_corosync_config = $corosync::params::test_corosync_config, + String[1] $test_corosync_config_cmd = $corosync::params::test_corosync_config_cmd, ) inherits corosync::params { if $set_votequorum and (empty($quorum_members) and empty($multicast_address) and !$cluster_name) { fail('set_votequorum is true, so you must set either quorum_members, or one of multicast_address or cluster_name.') @@ -678,11 +679,10 @@ # - $max_messages if $test_corosync_config { # corosync -t is only included since 2.3.4 - $config_validate_cmd = '/usr/bin/env COROSYNC_MAIN_CONFIG_FILE=% /usr/sbin/corosync -t' + $config_validate_cmd = $test_corosync_config_cmd } else { $config_validate_cmd = undef } - file { '/etc/corosync/corosync.conf': ensure => file, mode => '0644', diff --git a/manifests/params.pp b/manifests/params.pp index 6b9e3838..93b5fce6 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -28,20 +28,25 @@ $set_votequorum = true $manage_pacemaker_service = true $test_corosync_config = true + $package_install_options = undef case $facts['os']['family'] { 'RedHat': { $package_crmsh = false $package_pcs = true $package_fence_agents = true - $package_install_options = undef + if versioncmp($facts['os']['release']['major'], '8') >= 0 { + $test_corosync_config_cmd = '/usr/sbin/corosync -c % -t' + } else { + $test_corosync_config_cmd = '/usr/bin/env COROSYNC_MAIN_CONFIG_FILE=% /usr/sbin/corosync -t' + } } 'Debian': { $package_crmsh = true $package_pcs = false $package_fence_agents = false - $package_install_options = undef + $test_corosync_config_cmd = '/usr/bin/env COROSYNC_MAIN_CONFIG_FILE=% /usr/sbin/corosync -t' } 'Suse': { @@ -50,7 +55,6 @@ $package_crmsh = true $package_pcs = false $package_fence_agents = false - $package_install_options = undef } default: { fail("Unsupported flavour of ${facts['os']['family']}: ${facts['os']['name']}") diff --git a/metadata.json b/metadata.json index 36c68459..bf71190b 100644 --- a/metadata.json +++ b/metadata.json @@ -11,13 +11,15 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "7" + "7", + "8" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "7" + "7", + "8" ] }, {