Skip to content

Commit

Permalink
Merge pull request #268 from alexjfisher/puppet_strings_firewalld_zone
Browse files Browse the repository at this point in the history
Convert `firewalld_zone` docs to puppet-strings
  • Loading branch information
trevor-vaughan authored Mar 6, 2020
2 parents 62f1691 + 611386e commit c864726
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 21 deletions.
43 changes: 28 additions & 15 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* [`firewalld_port`](#firewalld_port): Assigns a port to a specific firewalld zone. firewalld_port will autorequire the firewalld_zone specified in the zone parameter so there is n
* [`firewalld_rich_rule`](#firewalld_rich_rule): Manages firewalld rich rules. firewalld_rich_rules will autorequire the firewalld_zone specified in the zone parameter so there is no need t
* [`firewalld_service`](#firewalld_service): Assigns a service to a specific firewalld zone. firewalld_service will autorequire the firewalld_zone specified in the zone parameter and
* [`firewalld_zone`](#firewalld_zone): Creates and manages firewald zones. Note that setting ensure => 'absent' to the built in firewalld zones will not work, and will generate an
* [`firewalld_zone`](#firewalld_zone): Creates and manages firewalld zones.

## Classes

Expand Down Expand Up @@ -260,6 +260,14 @@ Data type: `Optional[Enum['yes', 'no']]`



Default value: `undef`

##### `firewall_backend`

Data type: `Optional[Enum['iptables', 'nftables']]`



Default value: `undef`

##### `default_service_zone`
Expand Down Expand Up @@ -868,22 +876,27 @@ Name of the zone to which you want to add the service

### firewalld_zone

Creates and manages firewald zones.
Note that setting ensure => 'absent' to the built in firewalld zones will
not work, and will generate an error. This is a limitation of firewalld itself, not the module.
Creates and manages firewalld zones.

Example:
Note that setting `ensure => 'absent'` to the built in firewalld zones will
not work, and will generate an error. This is a limitation of firewalld itself, not the module.

firewalld_zone { 'restricted':
ensure => present,
target => '%%REJECT%%',
interfaces => [],
sources => [],
purge_rich_rules => true,
purge_services => true,
purge_ports => true,
icmp_blocks => 'router-advertisement'
}
#### Examples

##### Create a zone called `restricted`

```puppet
firewalld_zone { 'restricted':
ensure => present,
target => '%%REJECT%%',
interfaces => [],
sources => [],
purge_rich_rules => true,
purge_services => true,
purge_ports => true,
icmp_blocks => 'router-advertisement'
}
```

#### Properties

Expand Down
15 changes: 9 additions & 6 deletions lib/puppet/type/firewalld_zone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@
Puppet::Type.type(:firewalld_service)
Puppet::Type.type(:firewalld_port)

@doc = "Creates and manages firewald zones.
Note that setting ensure => 'absent' to the built in firewalld zones will
not work, and will generate an error. This is a limitation of firewalld itself, not the module.
desc <<-DOC
@summary
Creates and manages firewalld zones.
Creates and manages firewalld zones.
Example:
Note that setting `ensure => 'absent'` to the built in firewalld zones will
not work, and will generate an error. This is a limitation of firewalld itself, not the module.
@example Create a zone called `restricted`
firewalld_zone { 'restricted':
ensure => present,
target => '%%REJECT%%',
Expand All @@ -24,8 +28,7 @@
purge_ports => true,
icmp_blocks => 'router-advertisement'
}
"
DOC

ensurable do
defaultvalues
Expand Down

0 comments on commit c864726

Please sign in to comment.