-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from evan-a-a/main
firewalld: Add support for firewalld port forwarding Reviewed-by: Adam Miller <[email protected]> https://github.com/maxamillion
- Loading branch information
Showing
3 changed files
with
214 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
tests/integration/targets/firewalld/tasks/port_forward_test_cases.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Test playbook for the firewalld module - port operations | ||
# (c) 2017, Adam Miller <[email protected]> | ||
|
||
# This file is part of Ansible | ||
# | ||
# Ansible is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Ansible is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
- name: firewalld port forward test permanent enabled | ||
firewalld: | ||
port_forward: | ||
- port: 8080 | ||
proto: tcp | ||
toport: 8081 | ||
permanent: true | ||
state: enabled | ||
register: result | ||
|
||
- name: assert firewalld port test permanent enabled worked | ||
assert: | ||
that: | ||
- result is changed | ||
|
||
- name: firewalld port test permanent enabled rerun (verify not changed) | ||
firewalld: | ||
port_forward: | ||
- port: 8080 | ||
proto: tcp | ||
toport: 8081 | ||
permanent: true | ||
state: enabled | ||
register: result | ||
|
||
- name: assert firewalld port test permanent enabled rerun worked (verify not changed) | ||
assert: | ||
that: | ||
- result is not changed | ||
|
||
- name: firewalld port test permanent disabled | ||
firewalld: | ||
port_forward: | ||
- port: 8080 | ||
proto: tcp | ||
toport: 8081 | ||
permanent: true | ||
state: disabled | ||
register: result | ||
|
||
- name: assert firewalld port test permanent disabled worked | ||
assert: | ||
that: | ||
- result is changed | ||
|
||
- name: firewalld port test permanent disabled rerun (verify not changed) | ||
firewalld: | ||
port_forward: | ||
- port: 8080 | ||
proto: tcp | ||
toport: 8081 | ||
permanent: true | ||
state: disabled | ||
register: result | ||
|
||
- name: assert firewalld port test permanent disabled rerun worked (verify not changed) | ||
assert: | ||
that: | ||
- result is not changed |