From 007f12a913d8cec95d9db09dd9df6ec7ea5baa10 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 9 Jul 2022 13:29:59 +0900 Subject: [PATCH] Switch provider to manage rootwrap.conf file ... so that we users can use '' similarly to the resource types to manage the .conf files. Change-Id: I6fa40acff1989436c5326e94c98c9574644d18b2 --- .../designate_rootwrap_config/ini_setting.rb | 16 ++-------------- lib/puppet/type/designate_rootwrap_config.rb | 5 +++++ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/lib/puppet/provider/designate_rootwrap_config/ini_setting.rb b/lib/puppet/provider/designate_rootwrap_config/ini_setting.rb index 64e732ec..7b102979 100644 --- a/lib/puppet/provider/designate_rootwrap_config/ini_setting.rb +++ b/lib/puppet/provider/designate_rootwrap_config/ini_setting.rb @@ -1,21 +1,9 @@ Puppet::Type.type(:designate_rootwrap_config).provide( :ini_setting, - :parent => Puppet::Type.type(:ini_setting).provider(:ruby) + :parent => Puppet::Type.type(:openstack_config).provider(:ini_setting) ) do - def section - resource[:name].split('/', 2).first - end - - def setting - resource[:name].split('/', 2).last - end - - def separator - '=' - end - - def file_path + def self.file_path '/etc/designate/rootwrap.conf' end diff --git a/lib/puppet/type/designate_rootwrap_config.rb b/lib/puppet/type/designate_rootwrap_config.rb index 21c16aa3..c2b36c3f 100644 --- a/lib/puppet/type/designate_rootwrap_config.rb +++ b/lib/puppet/type/designate_rootwrap_config.rb @@ -7,6 +7,11 @@ Puppet::Type.newtype(:designate_rootwrap_config) do newvalues(/\S+\/\S+/) end + newparam(:ensure_absent_val) do + desc 'A value that is specified as the value property will behave as if ensure => absent was specified' + defaultto('') + end + newproperty(:value) do desc 'The value of the setting to be defined.' munge do |value|