Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert firewalld_zone docs to puppet-strings #268

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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