puppet-mistral/lib/puppet/provider/mistral_config/ini_setting.rb
Dan Prince a64ea5e494 Reflect provider change in puppet-openstacklib
With the creation of the new openstack_config provider, some processing
that was done in mistral_config has been centralized in
openstack_config.

Impacted methods are :

  * section
  * setting
  * separator

Also, this commit adds the fact that, when passing a specific string
(ensure_absent_val) the provider will behave as if ensure => absent
was
specified. '<SERVICE DEFAULT>' is the default value for
ensure_absent_val.

The use case is the following :

mistral_config { 'DEFAULT/foo' : value => 'bar' } # will work as usual

mistral_config { 'DEFAULT/foo' : value => '<SERVICE DEFAULT>' } # will mean absent

That means that all the current :

if $myvar {
  mistral_config { 'DEFAULT/foo' : value => $myvar }
} else {
  mistral_config { 'DEFAULT/foo' : ensure => absent }
}

can be removed in favor of :

mistral_config { 'DEFAULT/foo' : value => $myvar }

If for any reason '<SERVICE DEFAULT>' turns out to be a valid value
for a specific parameter. One could by pass that doing the following :

mistral_config { 'DEFAULT/foo' : value => '<SERVICE DEFAULT>',
 ensure_absent_val => 'foo' }

Closes-bug: #1530892
Change-Id: Iaaf2e5755080ef32d7d585465aaea6fd408d0ece
2016-01-04 10:23:20 -05:00

11 lines
203 B
Ruby

Puppet::Type.type(:mistral_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/mistral/mistral.conf'
end
end