Skip to content

Commit 5291bb5

Browse files
committed
Add the confdir configuration option
1 parent 65dbf38 commit 5291bb5

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

REFERENCE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ The following parameters are available in the `clustershell` class:
4141
* [`maxrc`](#-clustershell--maxrc)
4242
* [`node_count`](#-clustershell--node_count)
4343
* [`verbosity`](#-clustershell--verbosity)
44+
* [`confdir`](#-clustershell--confdir)
4445
* [`ssh_user`](#-clustershell--ssh_user)
4546
* [`ssh_path`](#-clustershell--ssh_path)
4647
* [`ssh_options`](#-clustershell--ssh_options)
@@ -68,6 +69,7 @@ The following parameters are available in the `clustershell` class:
6869
* [`group_yaml`](#-clustershell--group_yaml)
6970
* [`include_genders_groups`](#-clustershell--include_genders_groups)
7071
* [`manage_genders`](#-clustershell--manage_genders)
72+
* [`clush_conf_dir`](#-clustershell--clush_conf_dir)
7173

7274
##### <a name="-clustershell--fanout"></a>`fanout`
7375

@@ -141,6 +143,14 @@ Value for clush.conf verbosity
141143

142144
Default value: `'1'`
143145

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+
144154
##### <a name="-clustershell--ssh_user"></a>`ssh_user`
145155

146156
Data type: `Optional[String]`
@@ -357,6 +367,14 @@ Manage genders class when including genders group source
357367

358368
Default value: `true`
359369

370+
##### <a name="-clustershell--clush_conf_dir"></a>`clush_conf_dir`
371+
372+
Data type: `Stdlib::Absolutepath`
373+
374+
375+
376+
Default value: `'/etc/clustershell/clush.conf.d'`
377+
360378
## Defined types
361379

362380
### <a name="clustershell--group_source"></a>`clustershell::group_source`

manifests/init.pp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
# Value for clush.conf node_count
2222
# @param verbosity
2323
# Value for clush.conf verbosity
24+
# @param confdir
25+
# Value for clush.conf confdir
2426
# @param ssh_user
2527
# SSH user
2628
# @param ssh_path
@@ -85,6 +87,7 @@
8587
String $maxrc = 'no',
8688
String $node_count = 'yes',
8789
String $verbosity = '1',
90+
String $confdir = '/etc/clustershell/clush.conf.d $CFGDIR/clush.conf.d',
8891
Optional[String] $ssh_user = undef,
8992
String $ssh_path = 'ssh',
9093
String $ssh_options = '-oStrictHostKeyChecking=no',
@@ -96,6 +99,7 @@
9699
String[1] $python_package_name = 'python3-clustershell',
97100
Stdlib::Absolutepath $conf_dir = '/etc/clustershell',
98101
Stdlib::Absolutepath $conf = '/etc/clustershell/clush.conf',
102+
Stdlib::Absolutepath $clush_conf_dir = '/etc/clustershell/clush.conf.d',
99103
String[1] $conf_template = 'clustershell/clush.conf.erb',
100104
Stdlib::Absolutepath $defaults_conf = '/etc/clustershell/defaults.conf',
101105
String[1] $defaults_conf_template = 'clustershell/defaults.conf.erb',
@@ -182,6 +186,14 @@
182186
content => template($conf_template),
183187
}
184188

189+
file { '/etc/clustershell/clush.conf.d':
190+
ensure => 'directory',
191+
path => $clush_conf_dir,
192+
owner => 'root',
193+
group => 'root',
194+
mode => '0755',
195+
}
196+
185197
file { '/etc/clustershell/defaults.conf':
186198
ensure => 'file',
187199
path => $defaults_conf,

spec/classes/clustershell_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
'maxrc: no',
7171
'node_count: yes',
7272
'verbosity: 1',
73+
'confdir: /etc/clustershell/clush.conf.d $CFGDIR/clush.conf.d',
7374
'ssh_path: ssh',
7475
'ssh_options: -oStrictHostKeyChecking=no'
7576
])

templates/clush.conf.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ history_size: <%= @history_size %>
1616
maxrc: <%= @maxrc %>
1717
node_count: <%= @node_count %>
1818
verbosity: <%= @verbosity %>
19+
confdir: <%= @confdir %>
1920

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

0 commit comments

Comments
 (0)