Commit graph

132 commits

Author SHA1 Message Date
Hideki Saito
8a933e78b3 Update AZP CI matrix for stable-1
* Addressed #673
* Added root priv for test container in firewalld tests

Signed-off-by: Hideki Saito <saito@fgrep.org>
2025-08-08 14:01:42 +09:00
softwarefactory-project-zuul[bot]
9457b09e1a
Merge pull request #646 from saito-hideki/issue/642
[AZP] Add RHEL10 environment to CI matrix

SUMMARY
Add RHEL10 environment to CI matrix

Fixes #642

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
N/A
2025-06-10 15:01:33 +09:00
softwarefactory-project-zuul[bot]
abf2ddaa07
Merge pull request #631 from saito-hideki/issue/630
Fixes issue related to latest ansible-core devel branch

SUMMARY
Fixes a bug related to updating the ansible-core devel branch.

Fixes incorrect load path for json module in cgroup_perf_recap
Remove unnecessary condition from seboolean integration tests
Optimize conditions for selinux integration tests
Fixes #630

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ansible.posix.cgroup_perf_recap

ADDITIONAL INFORMATION
N/A
2025-04-17 11:26:23 +09:00
Abhijeet Kasurde
ca357be91e
[CI] update test containers
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-31 12:31:22 +09:00
Hideki Saito
73f7519133
Drop ansible-core 2.14 and set 2.15 minimum version
* backports #562
* fixes #578

Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-10-15 16:38:47 +09:00
Hideki Saito
098b5bee70
Revert "Merge pull request #568 from abakanovskii/feature/add_path_option_authorized_key"
This reverts commit 0821768bcb, reversing
changes made to 5321a9ecb5.
2024-10-09 15:33:16 +09:00
copyrights
2041e7f918
mount: remove boot exception if defaults in opts 2024-10-04 14:39:04 +09:00
softwarefactory-project-zuul[bot]
0821768bcb
Merge pull request #568 from abakanovskii/feature/add_path_option_authorized_key
authorized_key: Allow local path to a key

SUMMARY

Add option to specify an absolute path to file with SSH key(s) for authorized_key

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

authorized_key

ADDITIONAL INFORMATION


Before this change you would need to get key using ansible.builtin.slurp or something like ansible.builtin.command: cat <file> with register
I tried to keep it as simple as possible

# Now this is possible
- name: Set authorized keys taken from path
  ansible.posix.authorized_key:
    user: charlie
    state: present
    key: /home/charlie/.ssh/id_rsa.pub

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: alexander
2024-09-30 07:07:25 +00:00
Александр Бакановский
5f3f8514eb
Allow remote path for authorized_key 2024-09-30 09:40:03 +03:00
Hideki Saito
7194b6bb13
CI - bump ansible-core version
* bump devel test to ansible-core 2.19
* add ansible-core 2.18 to stable list but CI only covers sanity test at the moment.

Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-09-25 09:37:42 +09:00
softwarefactory-project-zuul[bot]
d968ac441e
Merge pull request #563 from dtvillafana/main
(feat) add no_log option for 'opts' parameter

SUMMARY

Allows you to set no_log on just the opts parameter.
This is useful for CIFS/SMB mounts that would otherwise leak secrets.

Adds feature from issue: . #497
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

mount

Reviewed-by: Hideki Saito <saito@fgrep.org>
2024-09-11 02:27:00 +00:00
dvillafana
e00a4299c1
(feat) add no_log options for 'opts' parameter
* Fixed #497
2024-09-11 11:04:16 +09:00
Gerlof Fokkema
257392f33d
Firewalld: Add functionality to set forwarding. Fixes #529. 2024-09-09 15:13:12 +09:00
Felix Fontein
a615b84bf7 Add sanity ignore file for ansible-core devel 2.18. 2024-06-07 07:12:06 +02:00
Jill Rouleau
83c4d2abd1 lint fixes 2024-05-09 12:10:44 -07:00
Jill Rouleau
e5733c5e49 Quote string in test assertion 2024-05-07 16:53:57 -07:00
Jill Rouleau
d49bd27fae Revert "sysctl: Fixed sysctl to work on symlinks(#111)"
This reverts commit 34b467719e.
2024-05-07 16:53:57 -07:00
satken2
9064ff7eb2 sysctl: Fixed sysctl to work on symlinks(#111) 2024-05-07 16:53:57 -07:00
satken2
a842e5f96a sysctl: Fixed sysctl to work on symlinks(#111) 2024-05-07 16:53:57 -07:00
satken2
97dcdee670 sysctl: Fixed sysctl to work on symlinks(#111) 2024-05-07 16:53:57 -07:00
satken2
55ea4ba1de sysctl: Fixed sysctl to work on symlinks(#111) 2024-05-07 16:53:57 -07:00
Hideki Saito
ac82f575c6 Replaced yield with yield from to address latest sanity test
Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-03-26 13:54:40 +09:00
Hideki Saito
4f93234a8b Replaced old selogin FQCN
- FCQN has been changed since comunity.general stable-6

Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-03-26 10:39:34 +09:00
Felix Fontein
45d8819b7c Remove Shippable leftovers. 2024-01-09 07:25:45 +01:00
softwarefactory-project-zuul[bot]
2c52f969e1
Merge pull request #484 from flowerysong/firewalld_offline
firewalld: make offline do something

SUMMARY

ansible.posix.firewalld has an offline flag, but it currently does not do anything. What most people expect it to do is allow the task to proceed even when firewalld is offline, so it makes the most sense for it to override the immediate flag and prevent the module from throwing an error in that case.
Fixes #81.
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

firewalld
ADDITIONAL INFORMATION

Reviewed-by: Adam Miller <admiller@redhat.com>
2023-12-07 21:18:29 +00:00
Adam Miller
a85f736f6a refactor to comply with current ansible-lint and sanity guidelines
Signed-off-by: Adam Miller <admiller@redhat.com>
2023-12-06 17:22:59 -06:00
Adam Miller
c394f6778d remove old pipelines, run sanity in pipelines because we're dropping zuul
Signed-off-by: Adam Miller <admiller@redhat.com>
2023-11-30 19:01:55 -06:00
Adam Miller
748bad22ad
fix sanity tests for core 2.16 (#514)
Signed-off-by: Adam Miller <admiller@redhat.com>
2023-11-30 16:25:07 -06:00
softwarefactory-project-zuul[bot]
6f95c8b356
Merge pull request #460 from gotmax23/respawn
Respawn modules to use the system python interpreter

SUMMARY
The seboolean, selinux, firewalld, and firewalld_info modules depend on
system bindings that are only available for the default system python
interpreter. ansible-core is not packaged for the default system python
interpreter on RHEL 8 and 9. When automatic interpreter discovery does
not occur (e.g. when using implicit localhost [1]), ansible-core will
not use the system interpreter to run ansible modules and the
aforementioned modules will not work even if the bindings are installed.
The RHEL ansible-core maintainers as well as the EPEL ansible and
ansible-collection-* package maintainers (inc. me) have gotten multiple
bug reports about this. We have been telling people to fix their setup
to use the correct Python interpreter. Fortunately, ansible-core 2.11
and above have a module utility that'll respawn modules to use the
correct system interpreter.
[1] https://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
seboolean
selinux
firewalld
firewalld_info

Reviewed-by: Adam Miller <admiller@redhat.com>
2023-11-30 17:03:21 +00:00
Paul Arthur
695fa213b3 firewalld: make offline do something 2023-11-29 00:06:36 +00:00
Hideki Saito
4f1e6b4a6d Drop Python3.9 and update versions of RHEL,Fedora and FreeBSD for ansible-core:devel
* Addresses issue #476
* Drop Python3.9
* Replace Fedora 37 with 38
* Replace FreeBSD13.1 with 13.2
* Replace RHEL 8.7 with 8.8
* Replace RHEL 9.1 with 9.2

Signed-off-by: Hideki Saito <saito@fgrep.org>
2023-07-04 09:15:24 +09:00
Felix Fontein
622aef2aad Switch to Ansible Galaxy compatible requirements files for tests. 2023-05-26 08:14:28 +02:00
Felix Fontein
4106ec65f9 Replace 'include:' with 'include_tasks:'.
'include:' is removed for ansible-core 2.16.
2023-05-21 13:17:48 +02:00
Maxwell G
ad414c87b4
respawn firewalld module when selinux is missing 2023-05-14 05:44:47 +00:00
Adam Miller
07f1e11015 fix sysctl integration test failing on newer versions of core
Previously NoneType was allowable, now it fails to convert to a str
type.

Signed-off-by: Adam Miller <admiller@redhat.com>
2023-05-05 11:59:04 -05:00
Hideki Saito
1c560e93d2 Support sanity docker test on devel(2.16.0.dev0) branch
- Fixes #446

Signed-off-by: Hideki Saito <saito@fgrep.org>
2023-04-17 23:32:21 +09:00
softwarefactory-project-zuul[bot]
daf0b89fcb
Merge pull request #445 from saito-hideki/issue/444
Update AZP to support stable-2.15 branch

SUMMARY
Update AZP to support stable-2.15 branch.

Fixes #444

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2023-04-12 23:12:34 +00:00
Adam Miller
9d1f67042e
Merge branch 'main' into bugfix_masquerade_icmp_block_inversion 2023-04-12 17:09:22 -05:00
softwarefactory-project-zuul[bot]
cddfa80d84
Merge pull request #402 from gnfzdz/bugfix_offline_add_interface
Fix adding interface to zone when firewalld is offline

SUMMARY

Fixes issue #357
The existing implementation had several issues which have been resolved by this PR:

incorrectly assumed some zone always exists that contains the interface
incorrectly included the logic to add the interface to the target zone inside of the condition checking if the interface is already assigned to a different zone (and needs to be removed)
passed an invalid argument to the constructor for FirewallClientZoneSettings

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
ansible.posix.firewalld
ADDITIONAL INFORMATION


  - name: Add lo interface to trusted zone
    ansible.posix.firewalld:
      interface: lo
      zone: trusted
      permanent: Yes
      state: enabled


Before
TASK [firewalld : Add lo interface to trusted zone] ****************************
task path: /root/ansible_collections/ansible/posix/tests/output/.tmp/integration/firewalld-gpgqwc7n-ÅÑŚÌβŁÈ/tests/integration/targets/firewalld/tasks/interface_test_cases.yml:7
Using module file /root/ansible_collections/ansible/posix/plugins/modules/firewalld.py
Pipelining is enabled.
<testhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<testhost> EXEC /bin/sh -c '/usr/bin/python3.10 && sleep 0'
The full traceback is:
  File "/tmp/ansible_ansible.posix.firewalld_payload_2vetziz9/ansible_ansible.posix.firewalld_payload.zip/ansible_collections/ansible/posix/plugins/module_utils/firewalld.py", line 112, in action_handler
    return action_func(*action_func_args)
  File "/tmp/ansible_ansible.posix.firewalld_payload_2vetziz9/ansible_ansible.posix.firewalld_payload.zip/ansible_collections/ansible/posix/plugins/modules/firewalld.py", line 481, in set_enabled_permanent
fatal: [testhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "icmp_block": null,
            "icmp_block_inversion": null,
            "immediate": false,
            "interface": "lo",
            "masquerade": null,
            "offline": null,
            "permanent": true,
            "port": null,
            "port_forward": null,
            "rich_rule": null,
            "service": null,
            "source": null,
            "state": "enabled",
            "target": null,
            "timeout": 0,
            "zone": "trusted"
        }
    },
    "msg": "ERROR: Exception caught: list index out of range Permanent operation"
}

After
TASK [firewalld : Add lo interface to trusted zone] ****************************
task path: /root/ansible_collections/ansible/posix/tests/output/.tmp/integration/firewalld-tr92i6e1-ÅÑŚÌβŁÈ/tests/integration/targets/firewalld/tasks/interface_test_cases.yml:7
Using module file /root/ansible_collections/ansible/posix/plugins/modules/firewalld.py
Pipelining is enabled.
<testhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<testhost> EXEC /bin/sh -c '/usr/bin/python3.10 && sleep 0'
changed: [testhost] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "icmp_block": null,
            "icmp_block_inversion": null,
            "immediate": false,
            "interface": "lo",
            "masquerade": null,
            "offline": null,
            "permanent": true,
            "port": null,
            "port_forward": null,
            "rich_rule": null,
            "service": null,
            "source": null,
            "state": "enabled",
            "target": null,
            "timeout": 0,
            "zone": "trusted"
        }
    },
    "msg": "Permanent operation, Changed lo to zone trusted, (offline operation: only on-disk configs were altered)"
}

Reviewed-by: Adam Miller <admiller@redhat.com>
2023-04-12 16:59:23 +00:00
Hideki Saito
91a6e30d78 Update AZP to support stable-2.15 branch
- Fixes #444

Signed-off-by: Hideki Saito <saito@fgrep.org>
2023-04-13 00:34:37 +09:00
Hideki Saito
553b49245f Support new test-sanity-docker-devel test
* Remove unused module import

Signed-off-by: Hideki Saito <saito@fgrep.org>
2023-03-13 18:11:49 +09:00
Robért S. Guhr
0d2ff1d2d8 added integrations tests for protocol parameter 2023-02-15 00:41:57 +01:00
Robért S. Guhr
b2f053a856 Adjust assert for firewalld source test permanent 2023-02-14 23:39:17 +01:00
Gregory Furlong
6695394af6 Update ZoneTransaction to support adding/removing zones when firewalld is offline.
Add integration test cases for adding/removing a custom zone with the firewalld module.
2023-01-17 13:29:18 -05:00
Hideki Saito
d6a997b37d Modify firewalld port test cases to avoid port duplication.
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-12-22 15:42:38 +09:00
Hideki Saito
bd9aa64a2b
Merge branch 'main' into ephemeral_state 2022-12-15 15:04:28 +09:00
Gregory Furlong
e97087e616 Update firewalld module to consider the value of the icmp_block_inversion parameter when determining if icmp_block_inversion should be enabled/disabled. 2022-12-14 11:07:53 -05:00
Gregory Furlong
e647e147a1 Update firewalld module to consider the value of the masquerade parameter when determining if masquerade should be enabled/disabled. 2022-12-14 10:50:15 -05:00
Gregory Furlong
4229db1bbe Fix issue where interfaces could not be added to a zone when firewalld is offline. Resolves issue #357. 2022-12-13 17:27:59 -05:00
Hideki Saito
6c9616291e Add stable-2.14 branch to AZP
* Fixes #388

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-09-27 21:15:50 +09:00