Skip to content

Commit e4d985c

Browse files
authored
Add new config options (#22)
* Add the maxrc configuration option * Add the confdir configuration option * Add doc for clush_conf_dir
1 parent 46e9eeb commit e4d985c

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

REFERENCE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ The following parameters are available in the `clustershell` class:
3838
* [`color`](#-clustershell--color)
3939
* [`fd_max`](#-clustershell--fd_max)
4040
* [`history_size`](#-clustershell--history_size)
41+
* [`maxrc`](#-clustershell--maxrc)
4142
* [`node_count`](#-clustershell--node_count)
4243
* [`verbosity`](#-clustershell--verbosity)
44+
* [`confdir`](#-clustershell--confdir)
4345
* [`ssh_user`](#-clustershell--ssh_user)
4446
* [`ssh_path`](#-clustershell--ssh_path)
4547
* [`ssh_options`](#-clustershell--ssh_options)
@@ -51,6 +53,7 @@ The following parameters are available in the `clustershell` class:
5153
* [`python_package_name`](#-clustershell--python_package_name)
5254
* [`conf_dir`](#-clustershell--conf_dir)
5355
* [`conf`](#-clustershell--conf)
56+
* [`clush_conf_dir`](#-clustershell--clush_conf_dir)
5457
* [`conf_template`](#-clustershell--conf_template)
5558
* [`defaults_conf`](#-clustershell--defaults_conf)
5659
* [`defaults_conf_template`](#-clustershell--defaults_conf_template)
@@ -116,6 +119,14 @@ Value for clush.conf history_size
116119

117120
Default value: `100`
118121

122+
##### <a name="-clustershell--maxrc"></a>`maxrc`
123+
124+
Data type: `String`
125+
126+
Value for clush.conf maxrc
127+
128+
Default value: `'no'`
129+
119130
##### <a name="-clustershell--node_count"></a>`node_count`
120131

121132
Data type: `String`
@@ -132,6 +143,14 @@ Value for clush.conf verbosity
132143

133144
Default value: `'1'`
134145

146+
##### <a name="-clustershell--confdir"></a>`confdir`
147+
148+
Data type: `String`
149+
150+
Value for clush.conf confdir
151+
152+
Default value: `'/etc/clustershell/clush.conf.d $CFGDIR/clush.conf.d'`
153+
135154
##### <a name="-clustershell--ssh_user"></a>`ssh_user`
136155

137156
Data type: `Optional[String]`
@@ -220,6 +239,14 @@ Path to clush.conf
220239

221240
Default value: `'/etc/clustershell/clush.conf'`
222241

242+
##### <a name="-clustershell--clush_conf_dir"></a>`clush_conf_dir`
243+
244+
Data type: `Stdlib::Absolutepath`
245+
246+
path to clush.conf.d
247+
248+
Default value: `'/etc/clustershell/clush.conf.d'`
249+
223250
##### <a name="-clustershell--conf_template"></a>`conf_template`
224251

225252
Data type: `String[1]`

manifests/init.pp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@
1515
# Value for clush.conf fd_max
1616
# @param history_size
1717
# Value for clush.conf history_size
18+
# @param maxrc
19+
# Value for clush.conf maxrc
1820
# @param node_count
1921
# Value for clush.conf node_count
2022
# @param verbosity
2123
# Value for clush.conf verbosity
24+
# @param confdir
25+
# Value for clush.conf confdir
2226
# @param ssh_user
2327
# SSH user
2428
# @param ssh_path
@@ -41,6 +45,8 @@
4145
# Path to clustershell configuration directory
4246
# @param conf
4347
# Path to clush.conf
48+
# @param clush_conf_dir
49+
# path to clush.conf.d
4450
# @param conf_template
4551
# clush.conf template
4652
# @param defaults_conf
@@ -80,8 +86,10 @@
8086
String $color = 'auto',
8187
Integer $fd_max = 8192,
8288
Integer $history_size = 100,
89+
String $maxrc = 'no',
8390
String $node_count = 'yes',
8491
String $verbosity = '1',
92+
String $confdir = '/etc/clustershell/clush.conf.d $CFGDIR/clush.conf.d',
8593
Optional[String] $ssh_user = undef,
8694
String $ssh_path = 'ssh',
8795
String $ssh_options = '-oStrictHostKeyChecking=no',
@@ -93,6 +101,7 @@
93101
String[1] $python_package_name = 'python3-clustershell',
94102
Stdlib::Absolutepath $conf_dir = '/etc/clustershell',
95103
Stdlib::Absolutepath $conf = '/etc/clustershell/clush.conf',
104+
Stdlib::Absolutepath $clush_conf_dir = '/etc/clustershell/clush.conf.d',
96105
String[1] $conf_template = 'clustershell/clush.conf.erb',
97106
Stdlib::Absolutepath $defaults_conf = '/etc/clustershell/defaults.conf',
98107
String[1] $defaults_conf_template = 'clustershell/defaults.conf.erb',
@@ -179,6 +188,14 @@
179188
content => template($conf_template),
180189
}
181190

191+
file { '/etc/clustershell/clush.conf.d':
192+
ensure => 'directory',
193+
path => $clush_conf_dir,
194+
owner => 'root',
195+
group => 'root',
196+
mode => '0755',
197+
}
198+
182199
file { '/etc/clustershell/defaults.conf':
183200
ensure => 'file',
184201
path => $defaults_conf,

spec/classes/clustershell_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@
6767
'color: auto',
6868
'fd_max: 8192',
6969
'history_size: 100',
70+
'maxrc: no',
7071
'node_count: yes',
7172
'verbosity: 1',
73+
'confdir: /etc/clustershell/clush.conf.d $CFGDIR/clush.conf.d',
7274
'ssh_path: ssh',
7375
'ssh_options: -oStrictHostKeyChecking=no',
7476
],)

templates/clush.conf.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ command_timeout: <%= @command_timeout %>
1313
color: <%= @color %>
1414
fd_max: <%= @fd_max %>
1515
history_size: <%= @history_size %>
16+
maxrc: <%= @maxrc %>
1617
node_count: <%= @node_count %>
1718
verbosity: <%= @verbosity %>
19+
confdir: <%= @confdir %>
1820

1921
# Add always all remote hosts to known_hosts without confirmation
2022
<% if @ssh_user -%>

0 commit comments

Comments
 (0)