From 08c4f6b39b1eb9357153f30866aecc3badd2936a Mon Sep 17 00:00:00 2001 From: Jean-Francois Roche Date: Thu, 26 Apr 2018 16:04:08 +0200 Subject: [PATCH] Add default ensure to present For all types --- lib/puppet/type/firewalld_direct_chain.rb | 5 ++++- lib/puppet/type/firewalld_direct_passthrough.rb | 5 ++++- lib/puppet/type/firewalld_direct_rule.rb | 5 ++++- lib/puppet/type/firewalld_ipset.rb | 5 ++++- lib/puppet/type/firewalld_rich_rule.rb | 5 ++++- lib/puppet/type/firewalld_zone.rb | 5 ++++- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/lib/puppet/type/firewalld_direct_chain.rb b/lib/puppet/type/firewalld_direct_chain.rb index 52ad43a1..a0193f2b 100644 --- a/lib/puppet/type/firewalld_direct_chain.rb +++ b/lib/puppet/type/firewalld_direct_chain.rb @@ -14,7 +14,10 @@ " - ensurable + ensurable do + defaultvalues + defaultto :present + end def self.title_patterns [ diff --git a/lib/puppet/type/firewalld_direct_passthrough.rb b/lib/puppet/type/firewalld_direct_passthrough.rb index de94a22f..ccb4530a 100644 --- a/lib/puppet/type/firewalld_direct_passthrough.rb +++ b/lib/puppet/type/firewalld_direct_passthrough.rb @@ -19,7 +19,10 @@ " - ensurable + ensurable do + defaultvalues + defaultto :present + end newparam(:inet_protocol) do desc 'Name of the TCP/IP protocol to use (e.g: ipv4, ipv6)' diff --git a/lib/puppet/type/firewalld_direct_rule.rb b/lib/puppet/type/firewalld_direct_rule.rb index 929c2eff..a0d6fe0a 100644 --- a/lib/puppet/type/firewalld_direct_rule.rb +++ b/lib/puppet/type/firewalld_direct_rule.rb @@ -16,7 +16,10 @@ " - ensurable + ensurable do + defaultvalues + defaultto :present + end newparam(:name, namevar: :true) do desc 'Name of the rule resource in Puppet' diff --git a/lib/puppet/type/firewalld_ipset.rb b/lib/puppet/type/firewalld_ipset.rb index 43111daa..077a00bf 100644 --- a/lib/puppet/type/firewalld_ipset.rb +++ b/lib/puppet/type/firewalld_ipset.rb @@ -17,7 +17,10 @@ def po2?(n) n.to_s(2).count('1') == 1 end - ensurable + ensurable do + defaultvalues + defaultto :present + end newparam(:name, namevar: true) do desc 'Name of the IPset' diff --git a/lib/puppet/type/firewalld_rich_rule.rb b/lib/puppet/type/firewalld_rich_rule.rb index b8cb7a31..21b67841 100644 --- a/lib/puppet/type/firewalld_rich_rule.rb +++ b/lib/puppet/type/firewalld_rich_rule.rb @@ -15,7 +15,10 @@ " - ensurable + ensurable do + defaultvalues + defaultto :present + end newparam(:name) do isnamevar diff --git a/lib/puppet/type/firewalld_zone.rb b/lib/puppet/type/firewalld_zone.rb index 7561a7d6..e45e7645 100644 --- a/lib/puppet/type/firewalld_zone.rb +++ b/lib/puppet/type/firewalld_zone.rb @@ -27,7 +27,10 @@ " - ensurable + ensurable do + defaultvalues + defaultto :present + end # When set to 1 these variables cause the purge_* options to indicate to Puppet # that we are in a changed state