Fix ordering when checking insync
`is` is not guaranteed to be sorted so we need to sort it before comparing to `should.sort`
Add defaults for services and ports
Having to specify service/port, zone and ensure for each service or port is highly redundant and cumbersome. Make service and port default to the resource name, ensure default to present and allow to set a default target zone for services and ports via parameters to the firewalld class. For ports the default protocol can also be set through a firewalld class parameter. Incidentally change the port spec test which seems to be incorrect regarding parameter port accepting a hash.
Control CleanupOnExit, MinimalMark, Lockdown, IPv6_rpfilter
Define firewalld ipset options using properties: - family - hashsize - maxelem - timeout This change is backward compatible with the definition of options using the `options` property.
Remove /32 as they get removed by ipset
/32 is stripped by ipset when the rules is created.
Improve logging of the ipset member changes
When you have a long list of ips in a set, it is easier to only show what actually changed (removal and addition).
Use instances & prefetch to define ipset state
We parse actual ipset rules to define existing resource. We avoid declaration of getter.
In a service definition, the port is optional
We can now declare service as a protocol without port
Add description and short option for zone
Give more details about a zone
Add new firewalld_ipset option: manage_entries
Sometimes firewalld ipset entries are modified by another process than puppet. If you want to declare the ipset with puppet but not manage the entries, we add the `manage_entries` option. Obviously, by default entries are managed by puppet. We throw an error if you try to define ipset entries with puppet and don't want to manage entries (`manage_entries = false`)
Merge pull request #1 from jfroche/feature/manage-ipset-entries-option
Add new firewalld_ipset option: manage_entries
manage_entries should be a parameter
From documentation: Parameters change how Puppet manages a resource, but do not necessarily map directly to something measurable.
Add option to remove unknown ipsets
This option is useful if you want to control ipsets only with puppet.
Merge pull request #2 from jfroche/feature/purge-unknown-ipset
Add option to remove unknown ipsets
Add validation for rich rule action
It can be a string or a hash. We validate string content and hash content. +tests
Do not check if ipset exists again
If ipset is created with `instances` and `prefetch`, there is no need to verify if the set exists using firewalld-cmd
Merge pull request #5 from jfroche/enhancement/ipset-exists-speedup
Do not check if ipset exists again
Latest version (2.6.11) has a compatibility problem with 4.0
Verify if firewalld is online before self.execute_firewall_cmd
self.instances method on the provider class did not verify if firewalld had a correct state before issuing `firewall-cmd` commands. This was a problem as we were trying to collect ipset informations without checking if firewalld was ready. So we move the `available?` implementation to the class method to be able to verify the current firewalld state.
Merge pull request #6 from jfroche/bug/ipset-check-firewalld-enabled
Verify if firewalld is online before self.execute_firewall_cmd
Merge pull request #179 from jfroche/bug/fix-puppet40-tests
Pin old rspec-puppet
Merge pull request #166 from markeganfuller/fix_ordering
Fix ordering when checking insync
Merge pull request #167 from michaelweiser/defaults
Add defaults for services and ports
Merge pull request #168 from jfroche/add-firewalld-config-options
Add firewalld config options
Merge pull request #169 from jfroche/add-service-description-short
Add description and short option for firewalld zone
Merge pull request #171 from jfroche/feature/optional_port
In a service definition, the port is optional
Merge pull request #172 from jfroche/enhancement/remove_validate
Use types and remove validate
Merge pull request #173 from jfroche/feature/enable-dash-in-ipset-name
Ipset name can have dash
Merge pull request #174 from jfroche/enhancement/validate-rich-rule-a…
…ction Add validation for rich rule action
Merge pull request #184 from crayfishx/remove_puppet_43
Removed puppet < 4.3 support
Update README.md custom_service example
Fixing syntax in firewalld::custom_service example
Update metadata.json to allow stdlib 6.x
Co-Authored-By: Alexander Fisher <alex@linfratech.co.uk>
Merge pull request #192 from djschaap/stdlib
Allow `puppetlabs-stdlib` 6
Fixing syntax issue with puppet server 5.3
Probably some issue with jruby parser.
Using more simple syntax fixed the issue
Error: Could not retrieve catalog from remote server: Error 500 on
SERVER: Server Error: Evaluation Error: Error while evaluating a
Resource Statement, Could not autoload puppet/type/firewalld_zone: Could
not autoload puppet/type/firewalld_rich_rule:
/etc/puppetlabs/code/environments/firewalld/modules/firewalld/lib/puppet_x/firewalld/property/rich_rule_action.rb:10:
unknown type of %string
if value.keys.sort != %i[action type]
^
(file: /etc/puppetlabs/code/environments/firewalld/modules/firewalld/manifests/init.pp, line: 117, column: 7) on node test.example.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping runMake firewall_cmd.rb ruby 1.9 compatible
Puppetserver 5 still uses jruby 1.7 by default. This is compatible with ruby 1.9 only. The `**` splat operator came out in ruby 2.0. https://www.freecodecamp.org/news/rubys-splat-and-double-splat-operators-ceb753329a78/ I've replaced its use with `merge`. Ruby 2.0 also introduced `%i[ ]` as an array of symbols. https://ruby-doc.org/core-2.5.1/doc/syntax/literals_rdoc.html
Drop puppet 4 support and allow puppet 6
Also update metadata.json for migration to Vox Pupuli See https://voxpupuli.org/blog/2019/01/03/dropping-puppet4