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

firewalld_zone: Fix failure creating new zone #367

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jameslikeslinux
Copy link
Contributor

Pull Request (PR) description

Possibly due to a change in recent firewalld versions (I'm on 2.1.1), creating a new zone fails with:

Debug: Firewalld_zone[test3](provider=firewall_cmd): Creating new zone test3 with target: ''
Debug: Puppet::Type::Firewalld_zone::ProviderFirewall_cmd: Executing --state command - current value
Debug: Executing: '/usr/sbin/firewall-cmd --state'
Debug: Executing: '/usr/sbin/firewall-offline-cmd --new-zone test3'
Debug: Puppet::Type::Firewalld_zone::ProviderFirewall_cmd: Executing --state command - current value
Debug: Executing: '/usr/sbin/firewall-cmd --state'
Debug: Executing: '/usr/sbin/firewall-offline-cmd --zone test3 --list-interfaces'
Debug: Firewalld_zone[test3](provider=firewall_cmd): removing icmp block inversion for zone test3
Debug: Puppet::Type::Firewalld_zone::ProviderFirewall_cmd: Executing --state command - current value
Debug: Executing: '/usr/sbin/firewall-cmd --state'
Debug: Executing: '/usr/sbin/firewall-offline-cmd --zone test3 --remove-icmp-block-inversion'
Error: Execution of '/usr/sbin/firewall-offline-cmd --zone test3 --remove-icmp-block-inversion' returned 12:
Error: /Stage[main]/Main/Firewalld_zone[test3]/ensure: change from 'absent' to 'present' failed: Execution of '/usr/sbin/firewall-offline-cmd --zone test3 --remove-icmp-block-inversion' returned 12:

which seems to be because ICMP block inversion is unset by default:

> /usr/sbin/firewall-offline-cmd --zone test3 --remove-icmp-block-inversion
NOT_ENABLED: icmp-block-inversion
> echo $?
12

Only manage icmp_block_inversion property on new zones if set to true.

This Pull Request (PR) fixes the following issues

None. This is a report and fix all in one. Feel free to suggest changes.

Possibly due to a change in recent firewalld versions, creating a new
zone fails with:

> Debug: Firewalld_zone[test3](provider=firewall_cmd): Creating new zone test3 with target: ''
> Debug: Puppet::Type::Firewalld_zone::ProviderFirewall_cmd: Executing --state command - current value
> Debug: Executing: '/usr/sbin/firewall-cmd --state'
> Debug: Executing: '/usr/sbin/firewall-offline-cmd --new-zone test3'
> Debug: Puppet::Type::Firewalld_zone::ProviderFirewall_cmd: Executing --state command - current value
> Debug: Executing: '/usr/sbin/firewall-cmd --state'
> Debug: Executing: '/usr/sbin/firewall-offline-cmd --zone test3 --list-interfaces'
> Debug: Firewalld_zone[test3](provider=firewall_cmd): removing icmp block inversion for zone test3
> Debug: Puppet::Type::Firewalld_zone::ProviderFirewall_cmd: Executing --state command - current value
> Debug: Executing: '/usr/sbin/firewall-cmd --state'
> Debug: Executing: '/usr/sbin/firewall-offline-cmd --zone test3 --remove-icmp-block-inversion'
> Error: Execution of '/usr/sbin/firewall-offline-cmd --zone test3 --remove-icmp-block-inversion' returned 12:
> Error: /Stage[main]/Main/Firewalld_zone[test3]/ensure: change from 'absent' to 'present' failed: Execution of '/usr/sbin/firewall-offline-cmd --zone test3 --remove-icmp-block-inversion' returned 12:

which seems to be because ICMP block inversion is unset by default:

```
> /usr/sbin/firewall-offline-cmd --zone test3 --remove-icmp-block-inversion
NOT_ENABLED: icmp-block-inversion
> echo $?
12
```

Only manage `icmp_block_inversion` property on new zones if set to
`true`.
@jcpunk
Copy link
Contributor

jcpunk commented Mar 18, 2024

I think the test failures look related @trevor-vaughan can you help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants