diff --git a/REFERENCE.md b/REFERENCE.md index dfc4d61..32aaedd 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -38,8 +38,10 @@ 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) +* [`confdir`](#-clustershell--confdir) * [`ssh_user`](#-clustershell--ssh_user) * [`ssh_path`](#-clustershell--ssh_path) * [`ssh_options`](#-clustershell--ssh_options) @@ -51,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) @@ -116,6 +119,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` @@ -132,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]` @@ -220,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]` diff --git a/manifests/init.pp b/manifests/init.pp index 5ce1da3..fec2eee 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -15,10 +15,14 @@ # 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 # Value for clush.conf verbosity +# @param confdir +# Value for clush.conf confdir # @param ssh_user # SSH user # @param ssh_path @@ -41,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 @@ -80,8 +86,10 @@ String $color = 'auto', Integer $fd_max = 8192, Integer $history_size = 100, + 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', @@ -93,6 +101,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', @@ -179,6 +188,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 f3c6859..1bb17af 100644 --- a/spec/classes/clustershell_spec.rb +++ b/spec/classes/clustershell_spec.rb @@ -67,8 +67,10 @@ 'color: auto', 'fd_max: 8192', 'history_size: 100', + '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 01dda00..44c5ea6 100644 --- a/templates/clush.conf.erb +++ b/templates/clush.conf.erb @@ -13,8 +13,10 @@ command_timeout: <%= @command_timeout %> color: <%= @color %> fd_max: <%= @fd_max %> 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 -%>