From 5861b958d070ed122145e8d1dbc602ccf3103059 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 9 Sep 2024 16:45:43 -0700 Subject: [PATCH 1/3] Add the maxrc configuration option --- REFERENCE.md | 9 +++++++++ manifests/init.pp | 3 +++ spec/classes/clustershell_spec.rb | 1 + templates/clush.conf.erb | 1 + 4 files changed, 14 insertions(+) diff --git a/REFERENCE.md b/REFERENCE.md index dfc4d61..2d94175 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -38,6 +38,7 @@ The following parameters are available in the `clustershell` class: * [`color`](#-clustershell--color) * [`fd_max`](#-clustershell--fd_max) * [`history_size`](#-clustershell--history_size) +* [`maxrc`](#-clustershell--maxrc) * [`node_count`](#-clustershell--node_count) * [`verbosity`](#-clustershell--verbosity) * [`ssh_user`](#-clustershell--ssh_user) @@ -116,6 +117,14 @@ Value for clush.conf history_size Default value: `100` +##### `maxrc` + +Data type: `String` + +Value for clush.conf maxrc + +Default value: `'no'` + ##### `node_count` Data type: `String` diff --git a/manifests/init.pp b/manifests/init.pp index 5ce1da3..1deb76e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -15,6 +15,8 @@ # Value for clush.conf fd_max # @param history_size # Value for clush.conf history_size +# @param maxrc +# Value for clush.conf maxrc # @param node_count # Value for clush.conf node_count # @param verbosity @@ -80,6 +82,7 @@ String $color = 'auto', Integer $fd_max = 8192, Integer $history_size = 100, + String $maxrc = 'no', String $node_count = 'yes', String $verbosity = '1', Optional[String] $ssh_user = undef, diff --git a/spec/classes/clustershell_spec.rb b/spec/classes/clustershell_spec.rb index f3c6859..00e78ca 100644 --- a/spec/classes/clustershell_spec.rb +++ b/spec/classes/clustershell_spec.rb @@ -67,6 +67,7 @@ 'color: auto', 'fd_max: 8192', 'history_size: 100', + 'maxrc: no', 'node_count: yes', 'verbosity: 1', 'ssh_path: ssh', diff --git a/templates/clush.conf.erb b/templates/clush.conf.erb index 01dda00..c6f262c 100644 --- a/templates/clush.conf.erb +++ b/templates/clush.conf.erb @@ -13,6 +13,7 @@ command_timeout: <%= @command_timeout %> color: <%= @color %> fd_max: <%= @fd_max %> history_size: <%= @history_size %> +maxrc: <%= @maxrc %> node_count: <%= @node_count %> verbosity: <%= @verbosity %> From 045f7b909fc12dc324a1c698cdcea61e66f9376a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 9 Sep 2024 17:04:23 -0700 Subject: [PATCH 2/3] Add the confdir configuration option --- REFERENCE.md | 18 ++++++++++++++++++ manifests/init.pp | 12 ++++++++++++ spec/classes/clustershell_spec.rb | 1 + templates/clush.conf.erb | 1 + 4 files changed, 32 insertions(+) diff --git a/REFERENCE.md b/REFERENCE.md index 2d94175..4168e83 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -41,6 +41,7 @@ The following parameters are available in the `clustershell` class: * [`maxrc`](#-clustershell--maxrc) * [`node_count`](#-clustershell--node_count) * [`verbosity`](#-clustershell--verbosity) +* [`confdir`](#-clustershell--confdir) * [`ssh_user`](#-clustershell--ssh_user) * [`ssh_path`](#-clustershell--ssh_path) * [`ssh_options`](#-clustershell--ssh_options) @@ -68,6 +69,7 @@ The following parameters are available in the `clustershell` class: * [`group_yaml`](#-clustershell--group_yaml) * [`include_genders_groups`](#-clustershell--include_genders_groups) * [`manage_genders`](#-clustershell--manage_genders) +* [`clush_conf_dir`](#-clustershell--clush_conf_dir) ##### `fanout` @@ -141,6 +143,14 @@ Value for clush.conf verbosity Default value: `'1'` +##### `confdir` + +Data type: `String` + +Value for clush.conf confdir + +Default value: `'/etc/clustershell/clush.conf.d $CFGDIR/clush.conf.d'` + ##### `ssh_user` Data type: `Optional[String]` @@ -357,6 +367,14 @@ Manage genders class when including genders group source Default value: `true` +##### `clush_conf_dir` + +Data type: `Stdlib::Absolutepath` + + + +Default value: `'/etc/clustershell/clush.conf.d'` + ## Defined types ### `clustershell::group_source` diff --git a/manifests/init.pp b/manifests/init.pp index 1deb76e..2ab4961 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -21,6 +21,8 @@ # Value for clush.conf node_count # @param verbosity # Value for clush.conf verbosity +# @param confdir +# Value for clush.conf confdir # @param ssh_user # SSH user # @param ssh_path @@ -85,6 +87,7 @@ String $maxrc = 'no', String $node_count = 'yes', String $verbosity = '1', + String $confdir = '/etc/clustershell/clush.conf.d $CFGDIR/clush.conf.d', Optional[String] $ssh_user = undef, String $ssh_path = 'ssh', String $ssh_options = '-oStrictHostKeyChecking=no', @@ -96,6 +99,7 @@ String[1] $python_package_name = 'python3-clustershell', Stdlib::Absolutepath $conf_dir = '/etc/clustershell', Stdlib::Absolutepath $conf = '/etc/clustershell/clush.conf', + Stdlib::Absolutepath $clush_conf_dir = '/etc/clustershell/clush.conf.d', String[1] $conf_template = 'clustershell/clush.conf.erb', Stdlib::Absolutepath $defaults_conf = '/etc/clustershell/defaults.conf', String[1] $defaults_conf_template = 'clustershell/defaults.conf.erb', @@ -182,6 +186,14 @@ content => template($conf_template), } + file { '/etc/clustershell/clush.conf.d': + ensure => 'directory', + path => $clush_conf_dir, + owner => 'root', + group => 'root', + mode => '0755', + } + file { '/etc/clustershell/defaults.conf': ensure => 'file', path => $defaults_conf, diff --git a/spec/classes/clustershell_spec.rb b/spec/classes/clustershell_spec.rb index 00e78ca..1bb17af 100644 --- a/spec/classes/clustershell_spec.rb +++ b/spec/classes/clustershell_spec.rb @@ -70,6 +70,7 @@ 'maxrc: no', 'node_count: yes', 'verbosity: 1', + 'confdir: /etc/clustershell/clush.conf.d $CFGDIR/clush.conf.d', 'ssh_path: ssh', 'ssh_options: -oStrictHostKeyChecking=no', ],) diff --git a/templates/clush.conf.erb b/templates/clush.conf.erb index c6f262c..44c5ea6 100644 --- a/templates/clush.conf.erb +++ b/templates/clush.conf.erb @@ -16,6 +16,7 @@ history_size: <%= @history_size %> maxrc: <%= @maxrc %> node_count: <%= @node_count %> verbosity: <%= @verbosity %> +confdir: <%= @confdir %> # Add always all remote hosts to known_hosts without confirmation <% if @ssh_user -%> From ce3b421947e58f0acb52b48828bb05061939d7eb Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 10 Sep 2024 11:31:24 -0700 Subject: [PATCH 3/3] Add doc for clush_conf_dir --- REFERENCE.md | 18 +++++++++--------- manifests/init.pp | 2 ++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 4168e83..32aaedd 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -53,6 +53,7 @@ The following parameters are available in the `clustershell` class: * [`python_package_name`](#-clustershell--python_package_name) * [`conf_dir`](#-clustershell--conf_dir) * [`conf`](#-clustershell--conf) +* [`clush_conf_dir`](#-clustershell--clush_conf_dir) * [`conf_template`](#-clustershell--conf_template) * [`defaults_conf`](#-clustershell--defaults_conf) * [`defaults_conf_template`](#-clustershell--defaults_conf_template) @@ -69,7 +70,6 @@ The following parameters are available in the `clustershell` class: * [`group_yaml`](#-clustershell--group_yaml) * [`include_genders_groups`](#-clustershell--include_genders_groups) * [`manage_genders`](#-clustershell--manage_genders) -* [`clush_conf_dir`](#-clustershell--clush_conf_dir) ##### `fanout` @@ -239,6 +239,14 @@ Path to clush.conf Default value: `'/etc/clustershell/clush.conf'` +##### `clush_conf_dir` + +Data type: `Stdlib::Absolutepath` + +path to clush.conf.d + +Default value: `'/etc/clustershell/clush.conf.d'` + ##### `conf_template` Data type: `String[1]` @@ -367,14 +375,6 @@ Manage genders class when including genders group source Default value: `true` -##### `clush_conf_dir` - -Data type: `Stdlib::Absolutepath` - - - -Default value: `'/etc/clustershell/clush.conf.d'` - ## Defined types ### `clustershell::group_source` diff --git a/manifests/init.pp b/manifests/init.pp index 2ab4961..fec2eee 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -45,6 +45,8 @@ # Path to clustershell configuration directory # @param conf # Path to clush.conf +# @param clush_conf_dir +# path to clush.conf.d # @param conf_template # clush.conf template # @param defaults_conf