File tree Expand file tree Collapse file tree 4 files changed +26
-1
lines changed Expand file tree Collapse file tree 4 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ The following parameters are available in the `keepalived` class:
5555* [ ` config_dir_mode ` ] ( #-keepalived--config_dir_mode )
5656* [ ` config_file_mode ` ] ( #-keepalived--config_file_mode )
5757* [ ` config_validate_cmd ` ] ( #-keepalived--config_validate_cmd )
58+ * [ ` validate_config ` ] ( #-keepalived--validate_config )
5859* [ ` config_group ` ] ( #-keepalived--config_group )
5960* [ ` config_owner ` ] ( #-keepalived--config_owner )
6061* [ ` daemon_group ` ] ( #-keepalived--daemon_group )
@@ -122,6 +123,14 @@ Input for the `validate_cmd` param of the keepalived.conf concat fragment.
122123
123124Default value: ` '/usr/sbin/keepalived -l -t -f %' `
124125
126+ ##### <a name =" -keepalived--validate_config " ></a >` validate_config `
127+
128+ Data type: ` Boolean `
129+
130+ Boolean to enable/disable the config validation
131+
132+ Default value: ` true `
133+
125134##### <a name =" -keepalived--config_group " ></a >` config_group `
126135
127136Data type: ` String[1] `
Original file line number Diff line number Diff line change 3030 owner => $keepalived::config_owner ,
3131 }
3232
33+ $validate_cmd = if $keepalived::validate_config {
34+ $keepalived::config_validate_cmd
35+ } else {
36+ undef
37+ }
3338 concat { "${keepalived::config_dir}/keepalived.conf" :
3439 owner => $keepalived::config_owner ,
3540 group => $keepalived::config_group ,
3641 mode => $keepalived::config_file_mode ,
37- validate_cmd => $keepalived::config_validate_cmd ,
42+ validate_cmd => $validate_cmd ,
3843 }
3944
4045 concat::fragment { 'keepalived.conf_header' :
Original file line number Diff line number Diff line change 1313#
1414# @param config_validate_cmd Input for the `validate_cmd` param of the keepalived.conf concat fragment.
1515#
16+ # @param validate_config Boolean to enable/disable the config validation
17+ #
1618# @param config_group
1719#
1820# @param config_owner
6769 Stdlib::Filemode $config_dir_mode = ' 0755' ,
6870 Stdlib::Filemode $config_file_mode = ' 0644' ,
6971 Stdlib::Absolutepath $config_validate_cmd = ' /usr/sbin/keepalived -l -t -f %' ,
72+ Boolean $validate_config = true ,
7073
7174 Array[Stdlib::Absolutepath] $include_external_conf_files = [],
7275
Original file line number Diff line number Diff line change 180180 )
181181 }
182182 end
183+
184+ describe 'without config validation' do
185+ let :params do
186+ { validate_config : false }
187+ end
188+
189+ it { is_expected . to contain_concat ( '/etc/keepalived/keepalived.conf' ) . without_validate_cmd }
190+ end
183191 end
184192 end
185193end
You can’t perform that action at this time.
0 commit comments