Compare commits

..

257 commits

Author SHA1 Message Date
Mandar Kulkarni
92dc532b49 Minor fix, with_items 2023-08-22 12:07:16 -07:00
Mandar Kulkarni
6deb45c943 Minor fix, remove ignore_errors 2023-08-22 12:07:16 -07:00
Mandar Kulkarni
7af8b05105 Modify based on feedback 2023-08-22 12:07:16 -07:00
Mandar Kulkarni
41bbe0dcbd Modifying output to be displayed based on feedback 2023-08-22 12:07:16 -07:00
mandar
9dbedb6d4c Adding tests, corrections 2023-08-22 12:07:14 -07:00
Mandar Kulkarni
26a968e1f0 Modifying based on feedback 2023-08-22 12:04:19 -07:00
Mandar Kulkarni
a5227da4c4 Added Changelog fragment 2023-08-22 12:03:58 -07:00
Mandar Kulkarni
fd95dcade2 Fix: moving conditional to correct place 2023-08-22 12:03:53 -07:00
Mandar Kulkarni
19a961c118 Added documentation and example for quiet option 2023-08-22 11:54:54 -07:00
Mandar Kulkarni
adb459b64e Adding rsync parameter 'quiet' to synchronize 2023-08-22 11:54:54 -07:00
Mandar Kulkarni
d0d7f7d362 Adding parameter to synchronize module to suppress verbose output and print error only 2023-08-22 11:54:54 -07:00
softwarefactory-project-zuul[bot]
542643e786
Merge pull request #487 from saito-hideki/pr/ci_remove_freebsd12
Drop OSX10.11 and FreeBSD12.4 from CI

SUMMARY
Drop OSX-10.11 and FreeBSD12.4 from CI

Fixes #476
Fixes #486
Drop OSX10.11 from ansible:2.9 and ansible-core:2.10
Drop FreeBSD12.4 from ansible-core:devel

ISSUE TYPE

CI Tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2023-08-02 08:29:22 +00:00
Hideki Saito
2cde4cdb26 Drop OSX10.11 and FreeBSD12.4 from CI
- Fixes #476
- Fixes #486
- Drop OSX10.11 from ansible:2.9 and ansible-core:2.10
- Drop FreeBSD12.4 from ansible-core:devel

Signed-off-by: Hideki Saito <saito@fgrep.org>

test
2023-08-02 16:03:19 +09:00
softwarefactory-project-zuul[bot]
12a1c25f5e
Merge pull request #478 from maxamillion/test/rhel_updates
Update azure-pipelines for new RHEL versions

SUMMARY

Change to the CI system annnounced in the following required this change:
ansible-collections/news-for-maintainers#47
2023-07-06 22:34:53 +00:00
Adam Miller
7062be892e only for devel
Signed-off-by: Adam Miller <admiller@redhat.com>
2023-07-06 10:19:58 -05:00
softwarefactory-project-zuul[bot]
20c2c30d23
Merge pull request #477 from saito-hideki/issue/476/1
Update CI tests to address changes on ansible-core

SUMMARY
Replace Python3.9 with 3.12 for ansible-test

Addresses issue #476

ISSUE TYPE

CI Test Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2023-07-04 01:39:12 +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
Adam Miller
806ab9ef9d Update azure-pipelines for new RHEL versions
Change to the CI system annnounced in the following required this
change:

  https://github.com/ansible-collections/news-for-maintainers/issues/47

Signed-off-by: Adam Miller <admiller@redhat.com>
2023-06-29 10:57:49 -05:00
softwarefactory-project-zuul[bot]
2ed8bdc8e8
Merge pull request #465 from felixfontein/req
Switch to Ansible Galaxy compatible requirements files for tests

SUMMARY
See ansible-community/community-topics#230.
ISSUE TYPE

Test Pull Request

COMPONENT NAME
test requirements files

Reviewed-by: Sorin Sbarnea <sorin.sbarnea@gmail.com>
2023-05-31 14:01:42 +00:00
Felix Fontein
622aef2aad Switch to Ansible Galaxy compatible requirements files for tests. 2023-05-26 08:14:28 +02:00
softwarefactory-project-zuul[bot]
5165572e9e
Merge pull request #467 from oraNod/rm-eol-tests
Fix CI: Remove FreeBSD 12.2 targets

SUMMARY
Removes CI tests for FreeBSD 12.2 that are failing when trying to bootstrap http://pkg.freebsd.org/FreeBSD:12:amd64/release_2
Example PR affected #466
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
.azure-pipelines/azure-pipelines.yml
ADDITIONAL INFORMATION
N/A

Reviewed-by: Hideki Saito <saito@fgrep.org>
2023-05-26 06:09:47 +00:00
softwarefactory-project-zuul[bot]
6c46a924b9
Merge pull request #466 from felixfontein/ci
Fix CI: replace `include:` with `include_tasks:`

SUMMARY
include: is removed for ansible-core 2.16 and no longer works with current devel.
ISSUE TYPE

Test Pull Request

COMPONENT NAME
integration tests

Reviewed-by: Hideki Saito <saito@fgrep.org>
2023-05-26 05:09:48 +00:00
Don Naro
ab1bc5df9f remove FreeBSD 12.2 targets 2023-05-24 19:41:58 +01: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
softwarefactory-project-zuul[bot]
f48515aad3
Merge pull request #458 from maxamillion/release-prep/1.5.4
Release 1.5.4

SUMMARY

Release 1.5.4
2023-05-11 15:00:31 +00:00
Adam Miller
3bbf2e3cd5 Release 1.5.4
Signed-off-by: Adam Miller <admiller@redhat.com>
2023-05-10 13:17:59 -05:00
softwarefactory-project-zuul[bot]
ae0380d671
Merge pull request #456 from maxamillion/tests/fix_sysctl_failures
fix sysctl integration test failing on newer versions of core

Previously NoneType was allowable, now it fails to convert to a str type.
SUMMARY

fix sysctl integration test failing on newer versions of core

Previously NoneType was allowable, now it fails to convert to a str
type.


ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

sysctl
2023-05-10 14:18:34 +00:00
Adam Miller
4f46ff218f add changelog fragment
Signed-off-by: Adam Miller <admiller@redhat.com>
2023-05-09 16:32:56 -05: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
softwarefactory-project-zuul[bot]
202609e425
Merge pull request #454 from rekup/fix/firewalld
fix firewalld protocol

SUMMARY
This PR resolves an issue where opening a port (e.g. 25/tcp) resulted in opening all ports for the specified protocol (e.g. tcp)
Fixes #451
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
ansible.posix.firewalld
ADDITIONAL INFORMATION
Many thanks to @nerrehmit and every one else who helped troubleshooting this!
2023-05-04 15:25:13 +00:00
Reto Kupferschmid
f1b36ba1c2
fix unbound variable error 2023-05-04 07:34:08 +02:00
Reto Kupferschmid
0eb6a7a437
fixup! fix firewalld protocol 2023-05-03 19:31:05 +02:00
Reto Kupferschmid
15954f8def
add changelog fragment 2023-05-03 19:25:06 +02:00
Reto Kupferschmid
41ce2cc8f9
fix firewalld protocol 2023-05-03 19:04:35 +02:00
softwarefactory-project-zuul[bot]
b9feff586f
Merge pull request #441 from jsquyres/pr/json-indent-level
json[l] callback: add parameter to set JSON prettyprint indent level

SUMMARY
Add ANSIBLE_JSON_INDENT parameter to both the json and jsonl callback plugins.  The default values are different between the two modules to maintain their existing behavior:

json: indent==4, causing a prettyprint output
jsonl: indent==0, causing a 1-line output

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ansible.posix.json
ansible.posix.jsonl

ADDITIONAL INFORMATION
One specific use-case that is enabled by this feature: if a user chooses to use the jsonl plugin so that they still get output at the end of each task (vs. only at the end of the play), they may also want human-readable output so that they can monitor the status of their play.  For example, setting the jsonl indent level to 4 gives a) output at the end of each task, and b) making that output be both machine readable and human readable.
Using this trivial playbook shows the change:
- hosts: localhost
  gather_facts: false
  tasks:
    - name: hello, world
      debug:
        msg: hello, world
When using the jsonl callback, here's what one JSON emit looks like before the change:
{"_event":"v2_playbook_on_play_start","_timestamp":"2023-04-08T12:11:48.001806Z","play":{"duration":{"start":"2023-04-08T12:11:48.001383Z"},"id":"acde4800-1122-f32c-94c3-000000000001","name":"localhost"},"tasks":[]}
After the change, setting ANSIBLE_JSON_INDENT to 4, the same output looks like this:
{
    "_event":"v2_playbook_on_play_start",
    "_timestamp":"2023-04-08T12:12:47.787516Z",
    "play":{
        "duration":{
            "start":"2023-04-08T12:12:47.787164Z"
        },
        "id":"acde4800-1122-2946-e3e4-000000000001",
        "name":"localhost"
    },
    "tasks":[]
}
Both outputs are suitable for automated processes to parse the machine readable output.  The second output has the benefit of being human readable.

Reviewed-by: Adam Miller <admiller@redhat.com>
Reviewed-by: Jeff Squyres
2023-04-27 20:52:09 +00:00
Jeff Squyres
281f957ece json[l] callback: add parameter to set JSON prettyprint indent level
Add ANSIBLE_JSON_INDENT parameter to both the json and jsonl callback
plugins.  The default values are different between the two modules to
maintain their existing behavior:

* json: indent==4, causing a prettyprint output
* jsonl: indent==0, causing a 1-line output

One specific use-case that is enabled by this feature: if a user
chooses to use the jsonl plugin so that they still get output at the
end of each task (vs. only at the end of the play), they may also want
human-readable output so that they can monitor the status of their
play.  For example, setting the jsonl indent level to 4 gives a)
output at the end of each task, and b) making that output be both
machine readable and human readable.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
2023-04-18 08:00:04 -07:00
softwarefactory-project-zuul[bot]
da1713ed3e
Merge pull request #440 from jsquyres/pr/json-callback-path
json[l] callback: add play/task path info

Add the play and task path info (i.e., filename and line number) to the JSON that is emitted from the json and jsonl callback plugins, allowing more accurate post-mortem analysis.
SUMMARY
Add the play and task path info (i.e., filename and line number) to the JSON that is emitted from the json and jsonl callback plugins, allowing more accurate post-mortem analysis.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ansible.posix.json
ansible.posix.jsonl

ADDITIONAL INFORMATION
By also including the file/line number in the JSON data emitted, post-mortem analysis can unambiguously tie play/task log data to the specific play / task that generated it.  Without this information, it could be difficult for automated processes to precisely map log output back to the task that generated it (especially with playbooks that either do not name tasks, or do not name tasks uniquely).
Using this trivial playbook shows the change:
- hosts: localhost
  gather_facts: false
  tasks:
    - name: hello, world
      debug:
        msg: hello, world
When using the json callback, here's what it looks like before the change (for brevity, just the plays section of the output):
        {
            "play": {
                "duration": {
                    "end": "2023-04-08T11:35:39.694000Z",
                    "start": "2023-04-08T11:35:39.657056Z"
                },
                "id": "acde4800-1122-6387-7abd-000000000001",
                "name": "localhost",
            },
            "tasks": [
                {
                    "hosts": {
                        "localhost": {
                            "_ansible_no_log": null,
                            "_ansible_verbose_always": true,
                            "action": "debug",
                            "changed": false,
                            "msg": "hello, world"
                        }
                    },
                    "task": {
                        "duration": {
                            "end": "2023-04-08T11:35:39.694000Z",
                            "start": "2023-04-08T11:35:39.672132Z"
                        },
                        "id": "acde4800-1122-6387-7abd-000000000003",
                        "name": "hello, world",
                    }
                }
            ]
        }
After the change, there is a new path key/value in both the play and the task:
        {
            "play": {
                "duration": {
                    "end": "2023-04-08T11:35:39.694000Z",
                    "start": "2023-04-08T11:35:39.657056Z"
                },
                "id": "acde4800-1122-6387-7abd-000000000001",
                "name": "localhost",
                "path": "/tmp/plays/hello.yaml:1"
            },
            "tasks": [
                {
                    "hosts": {
                        "localhost": {
                            "_ansible_no_log": null,
                            "_ansible_verbose_always": true,
                            "action": "debug",
                            "changed": false,
                            "msg": "hello, world"
                        }
                    },
                    "task": {
                        "duration": {
                            "end": "2023-04-08T11:35:39.694000Z",
                            "start": "2023-04-08T11:35:39.672132Z"
                        },
                        "id": "acde4800-1122-6387-7abd-000000000003",
                        "name": "hello, world",
                        "path": "/tmp/plays/hello.yaml:4"
                    }
                }
            ]
        }
The effect is the same in the jsonl plugin, but the output is squashed into a single line.

Reviewed-by: Adam Miller <admiller@redhat.com>
2023-04-18 03:24:12 +00:00
softwarefactory-project-zuul[bot]
7fb9cc95c3
Merge pull request #435 from ziegenberg/fix-412
docs: fix profile_tasks callback documentation

SUMMARY

This fixes the markup.
Fixes: #412
ISSUE TYPE


Docs Pull Request

COMPONENT NAME

profile_tasks
ADDITIONAL INFORMATION


None.

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Adam Miller <admiller@redhat.com>
2023-04-18 01:52:07 +00:00
softwarefactory-project-zuul[bot]
3a5ba91d92
Merge pull request #448 from saito-hideki/issue/446
[CI] Support sanity docker test on devel(2.16.0.dev0) branch

SUMMARY
Support sanity docker test on devel(2.16.0.dev0) branch:

Fixes #446

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2023-04-17 15:16:08 +00: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
softwarefactory-project-zuul[bot]
083f3aab64
Merge pull request #404 from gnfzdz/bugfix_masquerade_icmp_block_inversion
Bugfix masquerade icmp block inversion

SUMMARY

Fixes #235
Fixes #116
The masquerade and icmp_block_inversion parameters are currently strings and the values are completely ignored by the module.  A warning was previously added that these values will be converted to a boolean in the future.
This PR updates the behavior so that when a boolean like value is provided, the value is correctly considered. If a boolean like string is NOT provided, the current behavior is retained and the value is treated as true.  Additionally, comprehensive tests are added for every combination of the parameters state (enabled/disabled) and icmp_block_inversion / masquerade (True/False/non-boolean string).
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ansible.posix.firewalld
ADDITIONAL INFORMATION



Given icmp block inversion is currently enabled
  - name: Testing disable icmp block inversion
    ansible.posix.firewalld:
      zone:       trusted
      icmp_block_inversion: no
      permanent:  yes
      state:      enabled

Before
TASK [firewalld : Testing disable icmp block inversion] ************************
task path: /root/ansible_collections/ansible/posix/tests/output/.tmp/integration/firewalld-96jns0q4-ÅÑŚÌβŁÈ/tests/integration/targets/firewalld/tasks/icmp_block_inversion_test_cases.yml:35
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'
ok: [testhost] => {
    "changed": false,
    "invocation": {
        "module_args": {
            "icmp_block": null,
            "icmp_block_inversion": "False",
            "immediate": false,
            "interface": null,
            "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"
}

After
TASK [firewalld : Testing disable icmp block inversion] ************************
task path: /root/ansible_collections/ansible/posix/tests/output/.tmp/integration/firewalld-nxphh1pk-ÅÑŚÌβŁÈ/tests/integration/targets/firewalld/tasks/icmp_block_inversion_test_cases.yml:35
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": "False",
            "immediate": false,
            "interface": null,
            "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 icmp-block-inversion False to enabled"
}

Reviewed-by: Adam Miller <admiller@redhat.com>
2023-04-12 23:01:44 +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
Jeff Squyres
940d914904 json[l] callback: add play/task path info
Add the play and task path info (i.e., filename and line number) to
the JSON that is emitted from the json and jsonl callback plugins,
allowing more accurate post-mortem analysis.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
2023-04-12 09:55:44 -04:00
softwarefactory-project-zuul[bot]
b6587a783e
Merge pull request #443 from saito-hideki/pr/bump_release_version
Bump release version in galaxy.yml for the next release

SUMMARY
Bump release version in galaxy.yml for the next release
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2023-04-10 14:31:54 +00:00
Daniel Ziegenberg
7d069b597f
add changelog fragment
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2023-04-10 15:13:22 +02:00
Hideki Saito
38dd009615 Bump release version in galaxy.yml for the next release number.
Signed-off-by: Hideki Saito <saito@fgrep.org>
2023-04-10 17:45:13 +09:00
softwarefactory-project-zuul[bot]
7cf3934ef0
Merge pull request #439 from saito-hideki/release_1.5.2
Release 1.5.2 commit

SUMMARY
Release 1.5.2 commit

#149 (comment)

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2023-04-10 08:31:35 +00:00
Hideki Saito
26c182c8ef Release 1.5.2 commit
Signed-off-by: Hideki Saito <saito@fgrep.org>
2023-04-10 10:43:31 +09:00
softwarefactory-project-zuul[bot]
ce24b6c746
Merge pull request #437 from pyhedgehog/jsonl-callback
Add jsonl callback plugin to ansible.posix collection

SUMMARY
New jsonl callback plugin writes log in JSONL format - one JSON line for each event (callback function call).
Fixes #436
ISSUE TYPE

New Module Pull Request

COMPONENT NAME
ansible.posix.jsonl

Reviewed-by: Hideki Saito <saito@fgrep.org>
2023-04-06 09:00:50 +00:00
Michael Dubner
a417ac80f0 Add jsonl callback plugin to ansible.posix collection 2023-03-30 03:46:17 +03:00
Daniel Ziegenberg
009ed3bed5
docs: fix profile_tasks callback documentation
Fixes: #412

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2023-03-24 11:47:00 +01:00
softwarefactory-project-zuul[bot]
1eb594b836
Merge pull request #420 from austlane/bindep-centos
bindep - install rsync on all EL variants

Adds support for installing rsync for centos and related EL variants (AlmaLinux, Rocky, Oracle, etc)
rsync is an extremely common package, available in the base repos of all EL distros.
This is necessary to properly support AWX-EE and other community-built EL Execution Environments.
See: ansible/awx-ee#167

Reviewed-by: Austin Lane <austinwlane@gmail.com>
Reviewed-by: Hideki Saito <saito@fgrep.org>
2023-03-24 07:26:17 +00:00
softwarefactory-project-zuul[bot]
f47c5d6039
Merge pull request #426 from exploide/firewalld_info_docs
firewalld_info: fixed typo in default_zone and improved examples

SUMMARY
There was a typo in the docs of firewalld_info. Furthermore I slightly improved the examples by showcasing how to use the data gathered by this module.
ISSUE TYPE


Docs Pull Request

COMPONENT NAME

firewalld_info
ADDITIONAL INFORMATION
I'm not sure whether I should also update the file docs/ansible.posix.firewalld_info_module.rst but I suspect it will be generated automatically?

Reviewed-by: Hideki Saito <saito@fgrep.org>
2023-03-24 06:51:24 +00:00
softwarefactory-project-zuul[bot]
ab94cc7294
Merge pull request #434 from richm/fix-rhel_facts-issue
rhel_facts module must use keyword arguments

SUMMARY
The rhel_facts module must use keyword arguments.  The current
code gives this error:
Traceback (most recent call last):
...
  File "/tmp/ansible_ansible.posix.rhel_facts_payload_y10oy_4m/.../rhel_facts.py", line 72, in main
  TypeError: exit_json() takes 1 positional argument but 2 were given

The fix is to use all keyword arguments like other facts plugins.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ansible.posix.rhel_facts
ADDITIONAL INFORMATION
@maxamillion fyi

Reviewed-by: Hideki Saito <saito@fgrep.org>
2023-03-24 06:11:30 +00:00
Rich Megginson
0e92d30fd3 add changelog fragment 2023-03-23 17:31:31 -06:00
Rich Megginson
583e4a6d6b rhel_facts module must use keyword arguments
The rhel_facts module must use keyword arguments.  The current
code gives this error:
```
Traceback (most recent call last):
...
  File "/tmp/ansible_ansible.posix.rhel_facts_payload_y10oy_4m/.../rhel_facts.py", line 72, in main
  TypeError: exit_json() takes 1 positional argument but 2 were given
```
The fix is to use all keyword arguments like other facts plugins.
2023-03-23 15:52:20 -06:00
softwarefactory-project-zuul[bot]
dc7ee92827
Merge pull request #432 from saito-hideki/pr/ci_news-for-maintainers_38
[CI] Update AZP matrix to add macOS 13.2 and remove macOS 12.0

SUMMARY
This PR fixes issue #431
ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION

None
2023-03-21 10:24:00 +00:00
Hideki Saito
a62acdfc5a Added macOS 13.2 and remove macOS 12.0
- This commit fixes issue #431

Signed-off-by: Hideki Saito <saito@fgrep.org>
2023-03-21 17:56:23 +09:00
exploide
01f19cde25 firewalld_info: fixed typo in default_zone and improved examples 2023-03-14 18:53:36 +01:00
softwarefactory-project-zuul[bot]
32742c3486
Merge pull request #425 from saito-hideki/pr/fix_test-sanity-docker-devel
Support new test-sanity-docker-devel test 

SUMMARY
Support new test-sanity-docker-devel test.
ISSUE TYPE

CI test Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION

New test-sanity-docker-devel test is currently non-voting state.
2023-03-13 10:59:25 +00: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
softwarefactory-project-zuul[bot]
84c56e1814
Merge pull request #417 from rsguhr/protocol_support
firewalld: Add support for protocol parameter

SUMMARY
Fixes #416 - This PR implements the --add-protocol/--remove-protocol parameters for firewalld.
I have just copied and rewritten the code from service parameter. Please look carefully :)
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
firewalld
ADDITIONAL INFORMATION
    - name: Allow OSPF traffic
      ansible.posix.firewalld:                                                  
        protocol: ospf                                                          
        zone: work                                                              
        state: enabled                                                          
        permanent: true

Reviewed-by: Hideki Saito <saito@fgrep.org>
2023-03-13 07:02:45 +00:00
softwarefactory-project-zuul[bot]
41d8029ef5
Merge pull request #419 from akira6592/fix-patch-doc
patch: fix documentation syntax

SUMMARY


Fixed lacking of C() for description of src option. And fixed by collection_prep.
Based on this and this discussion.
ISSUE TYPE


Docs Pull Request

COMPONENT NAME


ansible.posix.patch module

ADDITIONAL INFORMATION



N/A

Reviewed-by: Hideki Saito <saito@fgrep.org>
2023-02-26 03:52:23 +00:00
Akira Yokochi
5eb019b2c1 Revert "collection_prep for patch module"
This reverts commit d64db13643.
2023-02-26 02:47:41 +00:00
austlane
94523978d2 bindep - install rsync on all EL variants
Adds support for installing rsync for centos and related EL variants (AlmaLinux, Rocky, Oracle, etc)

rsync is an extremely common package, available in the base repos of all EL distros

This is necessary to properly support AWX-EE and other community-built EL Execution Environments.
2023-02-22 20:07:25 -05:00
Akira Yokochi
14accca52f add changelog fragment 2023-02-21 12:46:54 +00:00
Akira Yokochi
d64db13643 collection_prep for patch module 2023-02-21 12:08:02 +00:00
Akira Yokochi
fd32da0e99 fix document syntax 2023-02-21 12:06:22 +00:00
Robért S. Guhr
0d2ff1d2d8 added integrations tests for protocol parameter 2023-02-15 00:41:57 +01:00
Robért S. Guhr
2ac6fbb84b added forgotten comma 2023-02-15 00:26:57 +01:00
Robért S. Guhr
b2f053a856 Adjust assert for firewalld source test permanent 2023-02-14 23:39:17 +01:00
Robért S. Guhr
a9920ae189 Changed changelog file name 2023-02-14 23:26:44 +01:00
Robért S. Guhr
ee9df94762 Add support for protocol parameter 2023-02-14 23:20:47 +01:00
softwarefactory-project-zuul[bot]
8a07431bf8
Merge pull request #399 from gnfzdz/main
Updat ZoneTransaction to support operations when firewalld is offline

SUMMARY

Fixes #398 by checking the flag self.fw_offline and calling the offline specific APIs when the flag is true.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ansible.posix.firewalld
ADDITIONAL INFORMATION
When attempting to add or remove zones, the ansible.posix.firewalld module would always call APIs as if it was online.
Specifically, the ZoneTransaction class assumed that self.fw  was a FirewallClient, but when the daemon is offline, it is instead either a Firewall or Firewall_test based on the version of firewalld installed.
See #398  for additional background.

Sample task
- name: 'Zone example - Create new zone'
  ansible.posix.firewalld:
    zone: "example"
    state: "present"
    permanent: Yes
Before
The full traceback is:
  File "/tmp/ansible_ansible.posix.firewalld_payload_04lptorx/ansible_ansible.posix.firewalld_payload.zip/ansible_collections/ansible/posix/plugins/module_utils/firewalld.py", line 111, in action_handler
    return action_func(*action_func_args)
  File "/tmp/ansible_ansible.posix.firewalld_payload_04lptorx/ansible_ansible.posix.firewalld_payload.zip/ansible_collections/ansible/posix/plugins/modules/firewalld.py", line 678, in get_enabled_permanent
fatal: [boot]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "icmp_block": null,
            "icmp_block_inversion": null,
            "immediate": false,
            "interface": null,
            "masquerade": null,
            "offline": null,
            "permanent": true,
            "port": null,
            "port_forward": null,
            "rich_rule": null,
            "service": null,
            "source": null,
            "state": "present",
            "target": null,
            "timeout": 0,
            "zone": "example"
        }
    },
    "msg": "ERROR: Exception caught: 'FirewallConfig' object is not callable"
}

After
changed: [boot] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "icmp_block": null,
            "icmp_block_inversion": null,
            "immediate": false,
            "interface": null,
            "masquerade": null,
            "offline": null,
            "permanent": true,
            "port": null,
            "port_forward": null,
            "rich_rule": null,
            "service": null,
            "source": null,
            "state": "present",
            "target": null,
            "timeout": 0,
            "zone": "example"
        }
    },
    "msg": "Permanent operation, Added zone example, Changed zone example to present, (offline operation: only on-disk configs were altered)"

Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
2023-02-03 14:12:50 +00:00
softwarefactory-project-zuul[bot]
02de0c6a76
Merge pull request #413 from felixfontein/patch-1
Fix broken seealso in synchronize module

SUMMARY
Module references must always have FQCN.
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
synchronize

Reviewed-by: Hideki Saito <saito@fgrep.org>
2023-02-01 04:18:14 +00:00
Felix Fontein
42af89d019
Add changelog fragment 2023-01-30 22:30:26 +01:00
Felix Fontein
8ccd0b800b
Fix broken seealso in synchronize module
Module references must always have FQCN.
2023-01-30 22:07:10 +01:00
softwarefactory-project-zuul[bot]
727efe9fd2
Merge pull request #410 from maxamillion/v1.5.1
v1.5.1 changelog

Signed-off-by: Adam Miller admiller@redhat.com
SUMMARY
v1.5.1 changelogs
2023-01-20 18:13:49 +00:00
Adam Miller
bbc511dbc8 v1.5.1 changelog
Signed-off-by: Adam Miller <admiller@redhat.com>
2023-01-20 11:52:10 -06: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
softwarefactory-project-zuul[bot]
04b8a5f918
Merge pull request #409 from saito-hideki/issue/408
[CI] Update AZP CI matrix

SUMMARY
To update AZP CI matrix for ansible-core devel branch to address the following issue:

Fixes #408
Update Fedora36 with 37
Update RHEL8.6 with 8.7
Update RHEL9.0 with 9.1
Update FreeBSD 12.3 with 12.4

ISSUE TYPE

CI Tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION

Reference:  ansible-test - new and deprecated platforms for testing #31
2023-01-11 11:29:27 +00:00
Hideki Saito
f109c162b0 Update AZP CI matrix
- Addresses https://github.com/ansible-collections/news-for-maintainers/issues/31

Signed-off-by: Hideki Saito <saito@fgrep.org>
2023-01-11 19:51:31 +09:00
softwarefactory-project-zuul[bot]
a2ab6881db
Merge pull request #400 from vladislav-sharapov/fix-doc-boolean-values
Fix boolean values in docs

SUMMARY
Fixes #397
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
Docs of several modules
ADDITIONAL INFORMATION
Notes about testing. I'm not sure how to test collections properly. I have ran ansible-test sanity --python 3.10 and ansible-test units --python 3.10 in venv with ansible-core 2.14 (with 0 return code in both cases). To run units test successfully I had to install pytest-forked pip package in addition to this one pytest-xdist from test-requirements.txt.
Note about issue #397. I haven't changed yes here because in this case it is value from /etc/vfstab. Also I've changed yes for parameters masquerade and icmp_block_inversion because they both are converted to bool by boolean function and will be changed to boolean in a future release (1, 2), for required too.

Reviewed-by: Felix Fontein <felix@fontein.de>
Reviewed-by: Hideki Saito <saito@fgrep.org>
2022-12-22 08:00:13 +00:00
softwarefactory-project-zuul[bot]
ec72fdc3ab
Merge pull request #407 from saito-hideki/pr/fix_firewalld_port_test
Modify firewalld port test cases to avoid port duplication on RHEL9.x

SUMMARY
Modify firewalld port test cases to avoid port duplication behavior on RHEL9.x
ISSUE TYPE

CI Tests Pull Request

COMPONENT NAME

ansible.posix.firewalld

ADDITIONAL INFORMATION

None
2022-12-22 07:23:59 +00: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
softwarefactory-project-zuul[bot]
d537e7ded8
Merge pull request #267 from NeodymiumFerBore/ephemeral_state
Add ephemeral state to mount fs without altering fstab

SUMMARY
Add ephemeral possible value for state parameter.
The ephemeral state allows end-users to mount a volume on a given path, without altering an fstab file or creating a dummy one.
There have been debates about splitting this module into an fstab module and a mount module, but nothing has been done in 5 years. This is why I'd like to propose this feature.
Downside: the way the posix.mount module handles mount options prevents it to be able to check exactly if the given opts perfectly match the mount options of an already mounted volume. To achieve this, the module would have to be aware of every mount default options, for all platforms. This is why state=ephemeral always return changed=yes.
In other terms, a remount will always be triggered if the volume is already mounted, even if the options look to be the same. Using state=unmounted on a volume previously mounted with ephemeral behaves correctly.
ISSUE TYPE

Feature Pull Request

Related issues:

ansible/ansible#48134
#84

COMPONENT NAME
mount
ADDITIONAL INFORMATION
Example use case
Sometimes it is handy to be able to temporarily mount a volume. I've seen this in couple companies where Ansible is used to generate reports and put it on network shares. However, some admins don't look into mount options such as krb5 and multiuser for SMB shares. Being forced to use fstab-based mounts leads to clear text passwords being stored more or less temporarily on the host filesystem, requiring "manual" deletion (with the hassle of using blocks, rescues, always, etc.). This feature respond to this use case by providing a way to mount a volume without having to alter an fstab file.
Description of changes

Edit DOCUMENTATION section to add ephemeral state
Edit EXAMPLES section to add ephemeral state example
Add new function _set_ephemeral_args to use instead of _set_fstab_args when using ephemeral state
Add new function _is_same_mount_src to determine if the mounted volume on the destination path has the same source than the one supplied to the module
Add new function _get_mount_info to avoid redundant code between functions get_linux_mounts and _is_same_mount_src
Modify get_linux_mount to use the new function _get_mount_info. Original behavior is preserved.
Integrate ephemeral parameter treatment into mounted treatment, and add if statements to avoid IO from/to fstab
Add ephemeral as a possible value for the state parameter in main()
Add required_if dependencies for ephemeral state

Reviewed-by: None <None>
Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Abhijeet Kasurde <None>
2022-12-15 06:22:17 +00:00
Hideki Saito
bd9aa64a2b
Merge branch 'main' into ephemeral_state 2022-12-15 15:04:28 +09:00
softwarefactory-project-zuul[bot]
6b7dc6ee0a
Merge pull request #166 from dkjii-g/main
ansible.posix.mount: add absent_from_fstab option

SUMMARY
Add absent_from_fstab option to remove the entry from fstab, but not unmount or delete the folder. Ideally this would have been the behavior of absent (as to mirror the behavior of present), but for backward compatibility I added a new verbose state
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
mount
ADDITIONAL INFORMATION
Sometimes you may not want to delete the mountpoint (e.g. if it is not currently mounted and data is in the directory, the current behavior will simply error).

Reviewed-by: Amin Vakil <None>
Reviewed-by: None <None>
2022-12-15 03:00:24 +00:00
softwarefactory-project-zuul[bot]
a831f22b83
Merge pull request #391 from juanvalino/main
Fixes #390. Hosts involved must have same password

SUMMARY
Fixes #390
The change takes the password from destination hostvars ansible_ssh_pass or ansible_password when dest is remote.
In other case, previous behavior is maintained and password is taken form task vars ansible_ssh_pass or ansible_password.
Also, both user and password are templated to allow jinja expressions in them.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ansible.posix.synchronize
ADDITIONAL INFORMATION
n/a

Reviewed-by: Adam Miller <admiller@redhat.com>
2022-12-15 02:21:06 +00:00
softwarefactory-project-zuul[bot]
cf8e77cf7d
Merge pull request #401 from gnfzdz/doc_validation_failures
Update documented default parameters to match implementation

SUMMARY

Updates documented default value for the acl module's entity parameter to an empty string and rhel_rpm_ostree's name parameter to an empty array correctly matching the actual implementation in both cases. This should fix currently failing test cases in the devel and milestone branches of CI/CD.
ISSUE TYPE


Docs Pull Request

COMPONENT NAME

ansible.posix.acl
ansible.posix.rhel_rpm_ostree
ADDITIONAL INFORMATION


Display the current documentation for the acl module using ansible-doc ansible.posix.acl or rhel_rpm_ostree module using ansible-doc ansible.posix.rhel_rpm_ostree
Alternatively using ansible-test on devel/milestone branches of ansible, execute:
ansible-test sanity --test validate-modules plugins/modules/
Running sanity test "validate-modules"
ERROR: Found 2 validate-modules issue(s) which need to be resolved:
ERROR: plugins/modules/acl.py:0:0: doc-default-does-not-match-spec: Argument 'entity' in argument_spec defines default as ('') but documentation defines default as (None)
ERROR: plugins/modules/rhel_rpm_ostree.py:0:0: doc-default-does-not-match-spec: Argument 'name' in argument_spec defines default as ([]) but documentation defines default as (None)


Before (ansible.posix.acl)
- entity
        The actual user or group that the ACL applies to when matching
        entity types user or group are selected.
        [Default: (null)]
        type: str

After (ansible.posix.acl)
- entity
        The actual user or group that the ACL applies to when matching
        entity types user or group are selected.
        [Default: ]
        type: str

Before (ansible.posix.rhel_rpm_ostree)
- name
        A package name or package specifier with version, like
        `name-1.0'.
        Comparison operators for package version are valid here `>',
        `<', `>=', `<='. Example - `name>=1.0'
        If a previous version is specified, the task also needs to
        turn `allow_downgrade' on. See the `allow_downgrade'
        documentation for caveats with downgrading packages.
        When using state=latest, this can be `'*'' which means run
        `yum -y update'.
        You can also pass a url or a local path to a rpm file (using
        state=present). To operate on several packages this can accept
        a comma separated string of packages or (as of 2.0) a list of
        packages.
        aliases: [pkg]
        default: null
        elements: str
        type: list

After (ansible.posix.rhel_rpm_ostree)
- name
        A package name or package specifier with version, like
        `name-1.0'.
        Comparison operators for package version are valid here `>',
        `<', `>=', `<='. Example - `name>=1.0'
        If a previous version is specified, the task also needs to
        turn `allow_downgrade' on. See the `allow_downgrade'
        documentation for caveats with downgrading packages.
        When using state=latest, this can be `'*'' which means run
        `yum -y update'.
        You can also pass a url or a local path to a rpm file (using
        state=present). To operate on several packages this can accept
        a comma separated string of packages or (as of 2.0) a list of
        packages.
        aliases: [pkg]
        default: []
        elements: str
        type: list

Reviewed-by: Felix Fontein <felix@fontein.de>
Reviewed-by: Adam Miller <admiller@redhat.com>
2022-12-14 21:10:12 +00:00
Vladislav Sharapov
c4742cfa81 Add changelog fragment 2022-12-14 20:44:50 +04:00
Gregory Furlong
cc93ee8232 Add a changelog fragment in preparation for the pull request. 2022-12-14 11:14:35 -05: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
9575b9be64 Add changelog fragment documenting PR #402 2022-12-13 18:02:56 -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
Gregory Furlong
bf0ad4aad2 Document pr #401 as a changelog fragment. 2022-12-13 12:46:39 -05:00
Gregory Furlong
0fff8fde30 Update documented default value for rhel_rpm_ostree's name parameter to match implementation. 2022-12-13 11:48:39 -05:00
Gregory Furlong
adcb28f806 Update documented default value for acl's entry parameter to match implementation. 2022-12-13 10:40:51 -05:00
Vladislav Sharapov
d0e1504f8a Fix boolean values in docs 2022-12-09 00:36:29 +04:00
softwarefactory-project-zuul[bot]
090706b581
Merge pull request #393 from maxamillion/r4e_rpm_ostree
rpm-ostree based RHEL modules

SUMMARY

Add modules to handle RHEL for Edge updates and package installation state as a compat layer for core.

ISSUE TYPE


New Module Pull Request

COMPONENT NAME

rhel_facts
rhel_rpm_ostree
rpm_ostree_upgrade

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Adam Miller <admiller@redhat.com>
2022-12-07 15:35:39 +00:00
Adam Miller
e52ae8a9bc fixes based on feedback
Signed-off-by: Adam Miller <admiller@redhat.com>
2022-11-22 09:03:04 -06:00
Adam Miller
7df358d74f add changelog fragment
Signed-off-by: Adam Miller <admiller@redhat.com>
2022-11-21 12:26:48 -06:00
Adam Miller
dcd9598e48 make sanity checks happy
Signed-off-by: Adam Miller <admiller@redhat.com>
2022-11-21 12:14:34 -06:00
Adam Miller
fc5894171d add rhel_facts, move r4e_rpm_ostree to rhel_rpm_ostree
Signed-off-by: Adam Miller <admiller@redhat.com>
2022-11-15 16:59:48 -06:00
Adam Miller
a3b8fdbf25 add changelog fragment
Signed-off-by: Adam Miller <admiller@redhat.com>
2022-11-08 16:23:08 -06:00
Adam Miller
69228e79d2 fix up some sanity things
Signed-off-by: Adam Miller <admiller@redhat.com>
2022-11-08 11:25:25 -06:00
Adam Miller
d1fbbb7905 rhel4edge modules
Signed-off-by: Adam Miller <admiller@redhat.com>
2022-11-08 10:17:53 -06:00
Juan Antonio Valino Garcia
50f87b0d15 move plugin to correct dir 2022-10-07 18:30:49 +02:00
Juan Antonio Valino Garcia
4512e7b1e9 add changelog fragment 2022-10-07 18:10:45 +02:00
Juan Antonio Valino Garcia
297a10fec7 handle missing templar 2022-10-07 18:04:09 +02:00
Juan Antonio Valino Garcia
139e103b0f Fixes ##390. Hosts involved must have same password 2022-10-07 17:20:20 +02:00
softwarefactory-project-zuul[bot]
83a933772c
Merge pull request #389 from saito-hideki/issue/388
Add stable-2.14 branch to AZP

SUMMARY
Add stable-2.14 branch to Azure pipleline.

Fixes #388

Relates to ansible-collections/news-for-maintainers#24
ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2022-09-27 12:48:42 +00: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
softwarefactory-project-zuul[bot]
0224e4d415
Merge pull request #373 from bcoca/patch-1
More complete missing lib msg

adds 'exact' python used by module  and hostname to avoid confusion
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

firewalld

Reviewed-by: Hideki Saito <saito@fgrep.org>
2022-09-16 08:13:45 +00:00
Hideki Saito
cc20deaad2 Add changelog fragment file to PR #373
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-09-16 16:37:23 +09:00
softwarefactory-project-zuul[bot]
5e0a6592ca
Merge pull request #380 from IPvSean/patch-1
Update profile_tasks.py

SUMMARY
removing contentious terminology to match reference documentation https://docs.ansible.com/ansible/latest/reference_appendices/config.html
ISSUE TYPE


Docs Pull Request

COMPONENT NAME
profile_tasks_callback
ADDITIONAL INFORMATION
n/a

Reviewed-by: Hideki Saito <saito@fgrep.org>
2022-09-12 05:23:35 +00:00
Hideki Saito
acd5a2b17e Add changelog fragments to PR #380
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-09-12 13:47:55 +09:00
softwarefactory-project-zuul[bot]
e629ae2d7c
Merge pull request #386 from saito-hideki/pr/ci_ansible-test-sanity-docker-devel
[CI] Address pylint check check error in ansible-test-sanity-docker-devel test

SUMMARY
Currently, ansible-test-sanity-docker-devel is set non voting, but we need to fix pylint check error in several modules.

https://ansible.softwarefactory-project.io/zuul/build/fbd5ac593fe44fa7b3d77e5557de1607

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

 ansible.posix.authorized_keys
 ansible.posix.mount

ADDITIONAL INFORMATION
None
2022-09-12 03:36:06 +00:00
Hideki Saito
abfe36c62f Fix to follow pylint check in ansible-test-sanity-docker-devel
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-09-12 10:30:01 +09:00
softwarefactory-project-zuul[bot]
6c0b91a3ee
Merge pull request #384 from saito-hideki/pr/ci_remove_f35
[CI] Update AZP matrix to remove Fedora35 and FreeBSD12.3 tests from devel

SUMMARY
Removing Fedora35 and FreeBSD12.3 from CI tests for devel branch(docker and remote).
ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION

Related to ansible-collections/news-for-maintainers/issues/21
2022-08-24 04:01:18 +00:00
Hideki Saito
f7fac90009 Removing Fedora 35 and FreeBSD 12.3 from CI tests
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-08-19 13:26:31 +09:00
Sean Cavanaugh
c4be75114b
Update profile_tasks.py
removing contentious terminology to match reference documentation https://docs.ansible.com/ansible/latest/reference_appendices/config.html
2022-07-15 14:04:06 -04:00
softwarefactory-project-zuul[bot]
6da0cbb3d3
Merge pull request #375 from saito-hideki/pr/update_azp_container
[CI] Bump AZP container version

SUMMARY
Addresses the following requirements:

ansible-collections/news-for-maintainers#18

However, ansible.posix needs to support Ansible Engine 2.9, so we will keep 2.9, 2.10, and 2.11 in the CI tests for now.
ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2022-06-15 10:06:20 +00:00
Hideki Saito
17fc3bcce6 Bump AZP container version
- https://github.com/ansible-collections/news-for-maintainers/issues/18

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-06-15 18:26:15 +09:00
Brian Coca
d7c7d1d2c8
More complete missing lib msg
adds 'exact' python used by module  and hostname to avoid confusion
2022-06-03 18:39:01 -04:00
NeodymiumFerBore
b8ed919011 Apply suggestions from code review
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-06-03 17:41:11 +02:00
NdFeB
04089e80fb Add ephemeral state to mount fs without altering fstab 2022-06-03 08:46:21 +02:00
softwarefactory-project-zuul[bot]
55bd196e82
Merge pull request #371 from saito-hideki/pr/ci_refactoring_202206
[CI] Refactor AZP settings and CI script

SUMMARY
Refactored AZP settings and CI script to correct the following PR's side effects:

Addresses #369

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2022-06-02 03:00:47 +00:00
Hideki Saito
f451f2211b Refactor AZP settings and CI script
* Addresses https://github.com/ansible-collections/news-for-maintainers/issues/17
* Addresses https://github.com/ansible-collections/ansible.posix/pull/369

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-06-02 11:27:17 +09:00
softwarefactory-project-zuul[bot]
18c847a8a0
Merge pull request #366 from saito-hideki/pr/replace_version_with_1.5.0
Update version number in galaxy.yml to 1.5.0.

SUMMARY
Update version number in galaxy.yml to 1.5.0.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2022-05-30 13:44:30 +00:00
Hideki Saito
ee65205607 Update version number of galaxy.yml to 1.5.0.
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-05-30 22:01:35 +09:00
softwarefactory-project-zuul[bot]
2c9c3a0f54
Merge pull request #369 from saito-hideki/pr/ci_refactoring_azp_matrix
[CI] Refactoring AZP CI matrix

SUMMARY
Refactoring AZP CI matrix:

ansible-collections/news-for-maintainers#17
#368

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2022-05-30 05:55:58 +00:00
Hideki Saito
c1f830f3df Refactoring AZP CI matrix
* https://github.com/ansible-collections/news-for-maintainers/issues/17

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-05-30 14:04:07 +09:00
softwarefactory-project-zuul[bot]
2d3f55caa7
Merge pull request #363 from saito-hideki/release_1.4.0
Release 1.4.0 commit

SUMMARY
Release 1.4.0 commit
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Felix Fontein <felix@fontein.de>
2022-05-23 10:47:00 +00:00
Hideki Saito
ab3bf45c6c Release 1.4.0 commit
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-05-23 16:37:36 +09:00
softwarefactory-project-zuul[bot]
00a22a525c
Merge pull request #362 from felixfontein/psf-license
Add PSF-license.txt file

SUMMARY
plugins/module_utils/_version.py mentions PSF-license.txt, which doesn't exist yet.
Please make sure to create new releases with this ASAP.
ISSUE TYPE

Bugfix Pull Request
Docs Pull Request

COMPONENT NAME
licenses

Reviewed-by: Hideki Saito <saito@fgrep.org>
2022-05-16 07:11:05 +00:00
Felix Fontein
eebfff4eb8 Update with actual CPython 3.9.5 license. 2022-05-16 08:00:40 +02:00
Felix Fontein
2ee9cc533a Add PSF-license.txt file. 2022-05-16 07:27:10 +02:00
softwarefactory-project-zuul[bot]
6d5145e285
Merge pull request #354 from mandar242/bindep_update
Update bindep.txt for adding rhel-9

SUMMARY

Add RHEL9 build for rsync.

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

bindep.txt

Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
Reviewed-by: Mandar Kulkarni <mandar242@gmail.com>
2022-04-26 18:59:25 +00:00
mandar242
45519c68be Modified based on feedback 2022-04-26 11:18:58 -07:00
mandar242
33f2ef8f11 Update bindep.txt for adding rhel-9 2022-04-25 15:32:27 -07:00
softwarefactory-project-zuul[bot]
dc4da60aff
Merge pull request #353 from saito-hideki/pr/ci_fix_unittest_for_synchronize
[CI] Added check_mode attr to synchronize plugin unit test

SUMMARY
Added check_mode attr to synchronize plugin unit test:

Added check_mode attribute to TaskMock class in the unit test for
synchronize plugin
Fixes #352

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix.tests.unit
2022-04-22 06:29:25 +00:00
Hideki Saito
c520b68276 Added check_mode attr to synchronize plugin test
* Added check_mode attribute to TaskMock class in the unit test for
  synchronize plugin
* Fixes #352

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-04-22 14:07:37 +09:00
softwarefactory-project-zuul[bot]
3ab812953f
Merge pull request #349 from saito-hideki/issue/348
[CI] Fixed documentation and options to address new sanity tests

SUMMARY
Fixed documentation and options to address new sanity tests:

Addresses #348
https://docs.ansible.com/ansible/latest/dev_guide/testing_validate-modules.html

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: Abhijeet Kasurde <None>
2022-04-11 09:10:53 +00:00
Hideki Saito
0e71c0e530 Fixed documentation and options to address new sanity tests
- https://docs.ansible.com/ansible/latest/dev_guide/testing_validate-modules.html

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-04-01 13:23:45 +09:00
ansible-zuul[bot]
04fdbffca1
Merge pull request #347 from saito-hideki/pr/ci_add_ansible_core_2.13
Add testing against ansible-core 2.13

SUMMARY
As a part of the issue #345, it addresses CI tests for stable-2.13.
ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2022-03-31 05:11:35 +00:00
Hideki Saito
def5d2bae0 Add testing against ansible-core 2.13
- Relates to ansible-collections/news-for-maintainers#14

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-03-31 13:38:37 +09:00
ansible-zuul[bot]
aecf81a23b
Merge pull request #346 from saito-hideki/pr/ci_copy_ignore_txt_for_2.14
Copy ignore-2.13.txt to ignore-2.14.txt

SUMMARY
As a part of issue #345, it addresses CI tests for devel(2.14.0.dev0).
ISSUE TYPE

CT tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2022-03-31 03:34:30 +00:00
Hideki Saito
373250a0ce Copy ignore-2.13.txt to ignore-2.14.txt
- Relates to ansible-collections/news-for-maintainers#13

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-03-31 12:13:36 +09:00
ansible-zuul[bot]
62d060a173
Merge pull request #324 from saito-hideki/pr/ci_remove_centos8_from_shippable_bindep
[CI] Update AZP matrix to remove CentOS8 shippable test

SUMMARY
We are no longer using Shippable for CI tests, but it would be better to remove CentOS 8 tests from this just in case.

shippable.yml
bindep.txt

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION

Reference0: #321
Reference1: ansible-collections/news-for-maintainers#3
2022-02-08 01:15:03 +00:00
Hideki Saito
b5247a27d4 Update AZP matrix to remove CentOS8 test
- shippable.yml
- bindep.txt

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-02-07 23:30:54 +09:00
ansible-zuul[bot]
792714f598
Merge pull request #321 from saito-hideki/pr/ci_remove_all_centos8_tests
[CI] Update AZP matrix to remove CentOS8 test

SUMMARY
Remove CentOS8 test from the following docker container tests:
Note: CentOS8 container test has already been removed from the devel branch test.

2.12
2.11
2.10
2.9

Reference: ansible-collections/news-for-maintainers#3
ISSUE TYPE

CI tests Pull Request

COMPONENT NAME
ansible.posix
ADDITIONAL INFORMATION
None

Reviewed-by: None <None>
Reviewed-by: Abhijeet Kasurde <None>
2022-02-02 14:28:40 +00:00
Hideki Saito
b886d7691f Update AZP matrix to remove CentOS8 test
- Addresses https://github.com/ansible-collections/news-for-maintainers/issues/3

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-02-02 18:20:05 +09:00
ansible-zuul[bot]
a383c6b27c
Merge pull request #319 from saito-hideki/azp_replace_rhel76_with_79
Update AZP matrix to replace RHEL7.6 with 7.9

SUMMARY
Update AZP matrix to replace RHEL7.6 with RHEL7.9 for the following test environments:

Remote 2.9
Remote 2.10

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
Trying to address the following CI issue on RHEL7.6 test environment:
02:11 https://rhui3.us-east-1.aws.ce.redhat.com/pulp/content/rhui-client-config/rhel/server/7/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
02:11 Trying other mirror.
02:11 To address this issue please refer to the below knowledge base article 
02:11 
02:11         compromise:
02:11 
02:11             yum-config-manager --save --setopt=rhui-REGION-client-config-server-7.skip_if_unavailable=true
02:11 
02:11 failure: repodata/repomd.xml from rhui-REGION-client-config-server-7: [Errno 256] No more mirrors to try.
02:11 https://rhui3.us-east-1.aws.ce.redhat.com/pulp/content/rhui-client-config/rhel/server/7/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
02:11 Failed to install packages. Sleeping before trying again...
02:21 
02:21 
02:21 Could not contact any CDS load balancers: https://rhui3.us-east-1.aws.ce.redhat.com/pulp/content/.
02:21 Failed to install packages. Sleeping before trying again...
02:31

Reviewed-by: None <None>
2022-01-29 05:58:15 +00:00
Hideki Saito
ac611b801f Update AZP matrix to replace RHEL7.6 with 7.9
- Remote 2.9
- Remote 2.10

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-01-29 02:02:47 +00:00
ansible-zuul[bot]
68e7ddb7a7
Merge pull request #309 from saito-hideki/ci_replate_freebsd_macos_on_devel
[CI] Update AZP matrix for ansible devel branch

SUMMARY
Update AZP config:

Fixes ansible-collections/overview#45
Fixes #308

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None

Reviewed-by: None <None>
2022-01-13 04:34:23 +00:00
Hideki Saito
cbd915c8ea Update AZP config
* Fixes ansible-collections/overview#45
* Fixes #308

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-01-13 10:53:12 +09:00
ansible-zuul[bot]
3acced944b
Merge pull request #304 from saito-hideki/issue/303
Replace distutils with included module in ansible-core 2.12 to address PEP 632

SUMMARY
Replace distutils.* with included module in ansible-core 2.12 to addresss PEP 632 if available.
It does not change the behavior of ansible-core 2.11 or earlier.

Fixes #303
Addresses PEP 632(https://www.python.org/dev/peps/pep-0632/)

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

plugins/module_utils/firewalld.py


plugins/modules/firewalld_info.py



ADDITIONAL INFORMATION
None

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Felix Fontein <felix@fontein.de>
Reviewed-by: None <None>
2022-01-07 07:52:48 +00:00
Hideki Saito
90cdaf873d Added loading StrictVersion to helper module
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-01-07 03:17:32 +00:00
Abhijeet Kasurde
44a23e363b
Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-06 20:50:07 +05:30
Hideki Saito
a45448bb26 Replace distutils with included module in ansible-core 2.12
- Fixes #303
- Addresses PEP 632(https://www.python.org/dev/peps/pep-0632/)

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-01-06 13:53:36 +05:30
ansible-zuul[bot]
95785bbbbd
Merge pull request #299 from lucab85/patch-1
Add RHEL8 library python3-libsemanage

SUMMARY
In modern systems (RHEL8+) with python3 default, the library requirement is python3-libsemanage.
Updated libsemanage-python to python3-libsemanage.

Fixes RHEL8 python3 support

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/seboolean.py
ADDITIONAL INFORMATION
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'semanage'
fatal: [demo.example.com]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (libsemanage-python) on demo.example.com's Python /usr/libexec/platform-python. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}

# dnf search libsemanage
Updating Subscription Management repositories.
Last metadata expiration check: 0:33:20 ago on Fri 17 Dec 2021 11:38:51 AM UTC.
================================ Name Exactly Matched: libsemanage ================================
libsemanage.x86_64 : SELinux binary policy manipulation library
libsemanage.i686 : SELinux binary policy manipulation library
=============================== Name & Summary Matched: libsemanage ===============================
python3-libsemanage.x86_64 : semanage python 3 bindings for libsemanage

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: None <None>
2021-12-24 10:13:45 +00:00
Luca Berton
43ead73934 Add RHEL8 library python3-libsemanage
In modern systems (RHEL8+) with python3 default the library requirement is `python3-libsemanage`.
Updated `libsemanage-python` to `python3-libsemanage`.
2021-12-23 23:57:15 +01:00
ansible-zuul[bot]
16436f4f55
Merge pull request #302 from saito-hideki/issue/301
[CI] Fix exit code in CI entrypoint to address shellckeck issue

SUMMARY
Fix wrong exit code -1 in CI entrypoint to address shellcheck failure:

Fixes #301

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

tests/utils/shippable/shippable.sh

ADDITIONAL INFORMATION
None

Reviewed-by: None <None>
2021-12-20 04:20:25 +00:00
Hideki Saito
cd04f5a092 Fix exit code in CI entrypoint to address shellckeck issue
- Fixes #301

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-12-20 08:40:36 +09:00
ansible-zuul[bot]
a8fcc028c0
Merge pull request #297 from saito-hideki/issue/255
Refine the handling of exclusive options

SUMMARY
Refine the handling of exclusive options using mutually_exclusive:

Fixes #255

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ansible.posix.firewalld

ADDITIONAL INFORMATION
None

Reviewed-by: Adam Miller <maxamillion@fedoraproject.org>
Reviewed-by: None <None>
2021-11-29 17:46:34 +00:00
Hideki Saito
667ebef95c Refine the handling of exclusive options using mutually_exclusive
- Fixes #255

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-11-29 18:46:28 +09:00
ansible-zuul[bot]
f17fda3162
Merge pull request #295 from saito-hideki/pr/ci_remove_rhel84
[CI] Replace RHEL8.4 with RHEL8.5 for devel tests

SUMMARY
Replace RHEL8.4 with RHEL8.5 for devel tests

ansible-collections/overview#45 (comment)

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

azure-pipelines/azure-pipelines.yml

ADDITIONAL INFORMATION
None

Reviewed-by: None <None>
2021-11-18 03:11:33 +00:00
Hideki Saito
35a910a698 Replace RHEL8.4 with RHEL8.5 for devel tests
- Relates to ansible-collections/overview#45

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-11-18 11:08:21 +09:00
ansible-zuul[bot]
90385b97d8
Merge pull request #288 from nerrehmit/main
Remove deprecated option from nfs mount example

SUMMARY
This removes the intr option from the documentation example for nfs mounts.
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
mount.py
ADDITIONAL INFORMATION
According to the nfs manpage the intr/ nointr option has been deprecated with Kernel 2.6.25 which was released in April 2008 wiki
Even RHEL 6.10 which is already on Extended life cycle support is using a newer 2.6 Kernel. https://access.redhat.com/articles/3078
This does not change any module functionality. It simply removes the option from the nfs mount example.

Reviewed-by: None <None>
2021-11-12 18:28:25 +00:00
Tim Herren
a42d7f0420 added changelog fragment for documentation change 2021-11-11 21:38:24 +01:00
ansible-zuul[bot]
12c00aa810
Merge pull request #292 from saito-hideki/issue/286_readme
[docs] Fixed the tested version list in Tested with Ansible section

SUMMARY
Fixed the tested version list in Tested with Ansible section.

Fixes #290

ISSUE TYPE

Docs Pull Request

COMPONENT NAME
aisnbie.posix/README.md
ADDITIONAL INFORMATION
None

Reviewed-by: None <None>
2021-11-10 08:16:01 +00:00
Hideki Saito
deac6a412e Fixed the tested version list in Tested with Ansible section
- Fixes #290

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-11-10 15:13:28 +09:00
ansible-zuul[bot]
9525e23dc7
Merge pull request #291 from saito-hideki/issue/290
[CI] Add CI tests for Ansible Core 2.12 release

SUMMARY
Add CI tests for Ansible Core 2.12

Fixes #290

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix/.azure-pipelines/azure-pipelines.yml

ADDITIONAL INFORMATION
None

Reviewed-by: None <None>
2021-11-10 04:36:05 +00:00
Hideki Saito
69a46eb0e8 Add CI tests for Ansible Core 2.12 release
- Fixes #290

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-11-10 12:06:45 +09:00
ansible-zuul[bot]
36efb13c23
Merge pull request #287 from saito-hideki/issue/286
[docs] Add python-firewall to requirements of firewalld

SUMMARY
The firewalld module uses python-firewall to manage firewalld. However, it is often misunderstood by users as it is not listed in the requirements.

Fixes #286

ISSUE TYPE

Docs Pull Request

COMPONENT NAME
ansible.posix.firewalld
ADDITIONAL INFORMATION
None

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: None <None>
2021-11-09 23:51:02 +00:00
ansible-zuul[bot]
607b7cfcb4
Merge pull request #289 from saito-hideki/pr/ci_replace_fc33_to_fc35_for_devel
[CI] Replace Fedora 33 with Fedora 35 for devel tests 

SUMMARY
Replace Fedora 33 with Fedora 35 for devel tests

Relates to ansible-collections/overview#45 (comment)

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

azure-pipelines/azure-pipelines.yml

ADDITIONAL INFORMATION
None

Reviewed-by: None <None>
2021-11-09 23:21:40 +00:00
Hideki Saito
af2af9cff3 Replace Fedora 33 with Fedora 35 for devel tests
- Relates to ansible-collections/overview#45

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-11-09 22:20:33 +09:00
Tim Herren
40a9ff36bb Remove deprecated option from nfs mount example 2021-11-08 16:14:01 +01:00
Hideki Saito
2768c58f90 Add python-firewall to requirements of firewalld
- Fixes #286

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-11-07 10:20:12 +09:00
ansible-zuul[bot]
a15e376bb9
Merge pull request #231 from Akasurde/comment
Codecov comment=false

SUMMARY
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
codecov.yml

Reviewed-by: Sorin Sbarnea <sorin.sbarnea@gmail.com>
Reviewed-by: None <None>
2021-11-03 12:14:32 +00:00
ansible-zuul[bot]
e366b90f39
Merge pull request #278 from asnaedae/hotfix/escape_whitespace_in_paths
Whitespace in fully  path to playbook causes rsync to fail

Any whitespace in path to playbook directory causes rsync to incorrectly chdir fail to correctly run.
SUMMARY
Any whitespace in path to playbook directory causes rsync to incorrectly chdir fail to correctly run.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ansible.posix.synchronize
ADDITIONAL INFORMATION


Example :
cd "/home/a/ansible plays"

task:
  - synchronize:
      src: a
      dest: b

Results in the following error being thrown
fatal: [remote-host]: FAILED! => {"changed": false, "cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh='/usr/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --rsync-path='sudo -u root rsync' --out-format='<<CHANGED>>%i %n%L' /home/a/ansible plays/deployments// remote-user@remote-host:/b/", "msg": "rsync: [sender] link_stat \"/home/a/ansible\" failed: No such file or directory (2)\nrsync: [sender] change_dir \"/home/a/ansible plays/plays/a/\" failed: No such file or directory (2)\nrsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]\n", "rc": 23}

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
2021-11-03 04:47:48 +00:00
Mike Wallis
d1be5519e6 Whitespaces in paths or current working directory path of playbook causes rsync to incorrectly chdir to current source dir,
Example :

cd "/home/a/ansible plays"

task:
  - synchronize:
      src: a
      dest: b

Results in the following error being thrown

fatal: [remote-host]: FAILED! => {"changed": false, "cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh='/usr/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --rsync-path='sudo -u root rsync' --out-format='<<CHANGED>>%i %n%L' /home/a/ansible plays/deployments// remote-user@remote-host:/data/", "msg": "rsync: [sender] link_stat \"/home/a/ansible\" failed: No such file or directory (2)\nrsync: [sender] change_dir \"/home/a/ansible plays/plays/a/\" failed: No such file or directory (2)\nrsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]\n", "rc": 23}
2021-10-25 19:44:43 +01:00
ansible-zuul[bot]
3514f9d3dc
Merge pull request #280 from saito-hideki/pr/ci_remove_centos8
CI: remove centos8 from test matrix

SUMMARY
Remove centos8 from CI matrix.
References: ansible-collections/overview#45 (comment)
ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

.azure-pipelines/azure-pipelines.yml

ADDITIONAL INFORMATION
None

Reviewed-by: None <None>
2021-10-21 10:05:48 +00:00
Hideki Saito
9890937bcc Remove centos8 environment for devel from CI
- Fixes https://github.com/ansible-collections/overview/issues/45

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-10-21 17:50:24 +09:00
ansible-zuul[bot]
8fda5f8678
Merge pull request #282 from saito-hideki/pr/fix_unit_test_failure_with_synchronize
Fix unit test for synchronize action plugin

SUMMARY
Fix unit test for synchronize action plugin to use yaml.safe_load() instead of yaml.load()
ISSUE TYPE

CI test Pull Request

COMPONENT NAME

tests/unit/plugins/action/test_synchronize.py

ADDITIONAL INFORMATION
Address to the following CI test issue:
tests/unit/modules/system/test_mount.py::LinuxMountsTestCase::test_code_comment 
[gw0] [  7%] PASSED tests/unit/modules/system/test_mount.py::LinuxMountsTestCase::test_code_comment 
tests/unit/modules/system/test_mount.py::LinuxMountsTestCase::test_set_mount_save_old 
[gw0] [ 14%] PASSED tests/unit/modules/system/test_mount.py::LinuxMountsTestCase::test_set_mount_save_old 
tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic 
[gw0] [ 21%] FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic 
tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_become 
[gw0] [ 28%] FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_become 
tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_become_cli 
[gw0] [ 35%] FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_become_cli 
tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_vagrant 
[gw0] [ 42%] FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_vagrant 
tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_vagrant_become_cli 
[gw0] [ 50%] FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_vagrant_become_cli 
tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_vagrant_sudo 
[gw0] [ 57%] FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_vagrant_sudo 
tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_with_private_key 
[gw0] [ 64%] FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_with_private_key 
tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_delegate_remote 
[gw0] [ 71%] FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_delegate_remote 
tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_delegate_remote_play_context_private_key 
[gw0] [ 78%] FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_delegate_remote_play_context_private_key 
tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_delegate_remote_su 
[gw0] [ 85%] FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_delegate_remote_su 
tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_delegate_remote_with_private_key 
[gw0] [ 92%] FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_delegate_remote_with_private_key 
tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_remote_user_not_in_local_tmpdir 
[gw0] [100%] PASSED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_remote_user_not_in_local_tmpdir 

=================================== FAILURES ===================================
_______________________ TestSynchronizeAction.test_basic _______________________
[gw0] linux -- Python 3.8.0 /tmp/python-55ij_ymk-ansible/python
self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.TestSynchronizeAction testMethod=test_basic>

    @patch('ansible_collections.ansible.posix.plugins.action.synchronize.connection_loader', FakePluginLoader)
    def test_basic(self):
        x = SynchronizeTester()
>       x.runtest(fixturepath=os.path.join(self.fixturedir, 'basic'))

tests/unit/plugins/action/test_synchronize.py:215: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.SynchronizeTester object at 0x7fe1356c64f0>
fixturepath = '/home/zuul/.ansible/collections/ansible_collections/ansible/posix/tests/unit/plugins/action/fixtures/synchronize/basic'

    def runtest(self, fixturepath='fixtures/synchronize/basic'):
    
        metapath = os.path.join(fixturepath, 'meta.yaml')
        with open(metapath, 'rb') as f:
            fdata = f.read()
>       test_meta = yaml.load(fdata)
E       TypeError: load() missing 1 required positional argument: 'Loader'

tests/unit/plugins/action/test_synchronize.py:128: TypeError
___________________ TestSynchronizeAction.test_basic_become ____________________
[gw0] linux -- Python 3.8.0 /tmp/python-55ij_ymk-ansible/python
self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.TestSynchronizeAction testMethod=test_basic_become>

    @patch('ansible_collections.ansible.posix.plugins.action.synchronize.connection_loader', FakePluginLoader)
    def test_basic_become(self):
        x = SynchronizeTester()
>       x.runtest(fixturepath=os.path.join(self.fixturedir, 'basic_become'))

tests/unit/plugins/action/test_synchronize.py:220: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.SynchronizeTester object at 0x7fe1356c65b0>
fixturepath = '/home/zuul/.ansible/collections/ansible_collections/ansible/posix/tests/unit/plugins/action/fixtures/synchronize/basic_become'

    def runtest(self, fixturepath='fixtures/synchronize/basic'):
    
        metapath = os.path.join(fixturepath, 'meta.yaml')
        with open(metapath, 'rb') as f:
            fdata = f.read()
>       test_meta = yaml.load(fdata)
E       TypeError: load() missing 1 required positional argument: 'Loader'

tests/unit/plugins/action/test_synchronize.py:128: TypeError
_________________ TestSynchronizeAction.test_basic_become_cli __________________
[gw0] linux -- Python 3.8.0 /tmp/python-55ij_ymk-ansible/python
self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.TestSynchronizeAction testMethod=test_basic_become_cli>

    @patch('ansible_collections.ansible.posix.plugins.action.synchronize.connection_loader', FakePluginLoader)
    def test_basic_become_cli(self):
        # --become on the cli sets _play_context.become
        x = SynchronizeTester()
>       x.runtest(fixturepath=os.path.join(self.fixturedir, 'basic_become_cli'))

tests/unit/plugins/action/test_synchronize.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.SynchronizeTester object at 0x7fe1356c6640>
fixturepath = '/home/zuul/.ansible/collections/ansible_collections/ansible/posix/tests/unit/plugins/action/fixtures/synchronize/basic_become_cli'

    def runtest(self, fixturepath='fixtures/synchronize/basic'):
    
        metapath = os.path.join(fixturepath, 'meta.yaml')
        with open(metapath, 'rb') as f:
            fdata = f.read()
>       test_meta = yaml.load(fdata)
E       TypeError: load() missing 1 required positional argument: 'Loader'

tests/unit/plugins/action/test_synchronize.py:128: TypeError
___________________ TestSynchronizeAction.test_basic_vagrant ___________________
[gw0] linux -- Python 3.8.0 /tmp/python-55ij_ymk-ansible/python
self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.TestSynchronizeAction testMethod=test_basic_vagrant>

    @patch('ansible_collections.ansible.posix.plugins.action.synchronize.connection_loader', FakePluginLoader)
    def test_basic_vagrant(self):
        # simple vagrant example
        x = SynchronizeTester()
>       x.runtest(fixturepath=os.path.join(self.fixturedir, 'basic_vagrant'))

tests/unit/plugins/action/test_synchronize.py:232: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.SynchronizeTester object at 0x7fe1356c6790>
fixturepath = '/home/zuul/.ansible/collections/ansible_collections/ansible/posix/tests/unit/plugins/action/fixtures/synchronize/basic_vagrant'

    def runtest(self, fixturepath='fixtures/synchronize/basic'):
    
        metapath = os.path.join(fixturepath, 'meta.yaml')
        with open(metapath, 'rb') as f:
            fdata = f.read()
>       test_meta = yaml.load(fdata)
E       TypeError: load() missing 1 required positional argument: 'Loader'

tests/unit/plugins/action/test_synchronize.py:128: TypeError
_____________ TestSynchronizeAction.test_basic_vagrant_become_cli ______________
[gw0] linux -- Python 3.8.0 /tmp/python-55ij_ymk-ansible/python
self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.TestSynchronizeAction testMethod=test_basic_vagrant_become_cli>

    @patch('ansible_collections.ansible.posix.plugins.action.synchronize.connection_loader', FakePluginLoader)
    def test_basic_vagrant_become_cli(self):
        # vagrant plus sudo
        x = SynchronizeTester()
>       x.runtest(fixturepath=os.path.join(self.fixturedir, 'basic_vagrant_become_cli'))

tests/unit/plugins/action/test_synchronize.py:244: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.SynchronizeTester object at 0x7fe1356c6610>
fixturepath = '/home/zuul/.ansible/collections/ansible_collections/ansible/posix/tests/unit/plugins/action/fixtures/synchronize/basic_vagrant_become_cli'

    def runtest(self, fixturepath='fixtures/synchronize/basic'):
    
        metapath = os.path.join(fixturepath, 'meta.yaml')
        with open(metapath, 'rb') as f:
            fdata = f.read()
>       test_meta = yaml.load(fdata)
E       TypeError: load() missing 1 required positional argument: 'Loader'

tests/unit/plugins/action/test_synchronize.py:128: TypeError
________________ TestSynchronizeAction.test_basic_vagrant_sudo _________________
[gw0] linux -- Python 3.8.0 /tmp/python-55ij_ymk-ansible/python
self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.TestSynchronizeAction testMethod=test_basic_vagrant_sudo>

    @patch('ansible_collections.ansible.posix.plugins.action.synchronize.connection_loader', FakePluginLoader)
    def test_basic_vagrant_sudo(self):
        # vagrant plus sudo
        x = SynchronizeTester()
>       x.runtest(fixturepath=os.path.join(self.fixturedir, 'basic_vagrant_sudo'))

tests/unit/plugins/action/test_synchronize.py:238: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.SynchronizeTester object at 0x7fe1356c69a0>
fixturepath = '/home/zuul/.ansible/collections/ansible_collections/ansible/posix/tests/unit/plugins/action/fixtures/synchronize/basic_vagrant_sudo'

    def runtest(self, fixturepath='fixtures/synchronize/basic'):
    
        metapath = os.path.join(fixturepath, 'meta.yaml')
        with open(metapath, 'rb') as f:
            fdata = f.read()
>       test_meta = yaml.load(fdata)
E       TypeError: load() missing 1 required positional argument: 'Loader'

tests/unit/plugins/action/test_synchronize.py:128: TypeError
______________ TestSynchronizeAction.test_basic_with_private_key _______________
[gw0] linux -- Python 3.8.0 /tmp/python-55ij_ymk-ansible/python
self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.TestSynchronizeAction testMethod=test_basic_with_private_key>

    @patch('ansible_collections.ansible.posix.plugins.action.synchronize.connection_loader', FakePluginLoader)
    def test_basic_with_private_key(self):
        x = SynchronizeTester()
>       x.runtest(fixturepath=os.path.join(self.fixturedir, 'basic_with_private_key'))

tests/unit/plugins/action/test_synchronize.py:261: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.SynchronizeTester object at 0x7fe1356c6ac0>
fixturepath = '/home/zuul/.ansible/collections/ansible_collections/ansible/posix/tests/unit/plugins/action/fixtures/synchronize/basic_with_private_key'

    def runtest(self, fixturepath='fixtures/synchronize/basic'):
    
        metapath = os.path.join(fixturepath, 'meta.yaml')
        with open(metapath, 'rb') as f:
            fdata = f.read()
>       test_meta = yaml.load(fdata)
E       TypeError: load() missing 1 required positional argument: 'Loader'

tests/unit/plugins/action/test_synchronize.py:128: TypeError
__________________ TestSynchronizeAction.test_delegate_remote __________________
[gw0] linux -- Python 3.8.0 /tmp/python-55ij_ymk-ansible/python
self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.TestSynchronizeAction testMethod=test_delegate_remote>

    @patch('ansible_collections.ansible.posix.plugins.action.synchronize.connection_loader', FakePluginLoader)
    def test_delegate_remote(self):
        # delegate to other remote host
        x = SynchronizeTester()
>       x.runtest(fixturepath=os.path.join(self.fixturedir, 'delegate_remote'))

tests/unit/plugins/action/test_synchronize.py:250: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.SynchronizeTester object at 0x7fe1356c68e0>
fixturepath = '/home/zuul/.ansible/collections/ansible_collections/ansible/posix/tests/unit/plugins/action/fixtures/synchronize/delegate_remote'

    def runtest(self, fixturepath='fixtures/synchronize/basic'):
    
        metapath = os.path.join(fixturepath, 'meta.yaml')
        with open(metapath, 'rb') as f:
            fdata = f.read()
>       test_meta = yaml.load(fdata)
E       TypeError: load() missing 1 required positional argument: 'Loader'

tests/unit/plugins/action/test_synchronize.py:128: TypeError
_____ TestSynchronizeAction.test_delegate_remote_play_context_private_key ______
[gw0] linux -- Python 3.8.0 /tmp/python-55ij_ymk-ansible/python
self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.TestSynchronizeAction testMethod=test_delegate_remote_play_context_private_key>

    @patch('ansible_collections.ansible.posix.plugins.action.synchronize.connection_loader', FakePluginLoader)
    def test_delegate_remote_play_context_private_key(self):
        # delegate to other remote host and use the play context private_key
        x = SynchronizeTester()
>       x.runtest(fixturepath=os.path.join(self.fixturedir, 'delegate_remote_play_context_private_key'))

tests/unit/plugins/action/test_synchronize.py:273: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.SynchronizeTester object at 0x7fe1356c6a60>
fixturepath = '/home/zuul/.ansible/collections/ansible_collections/ansible/posix/tests/unit/plugins/action/fixtures/synchronize/delegate_remote_play_context_private_key'

    def runtest(self, fixturepath='fixtures/synchronize/basic'):
    
        metapath = os.path.join(fixturepath, 'meta.yaml')
        with open(metapath, 'rb') as f:
            fdata = f.read()
>       test_meta = yaml.load(fdata)
E       TypeError: load() missing 1 required positional argument: 'Loader'

tests/unit/plugins/action/test_synchronize.py:128: TypeError
________________ TestSynchronizeAction.test_delegate_remote_su _________________
[gw0] linux -- Python 3.8.0 /tmp/python-55ij_ymk-ansible/python
self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.TestSynchronizeAction testMethod=test_delegate_remote_su>

    @patch('ansible_collections.ansible.posix.plugins.action.synchronize.connection_loader', FakePluginLoader)
    def test_delegate_remote_su(self):
        # delegate to other remote host with su enabled
        x = SynchronizeTester()
>       x.runtest(fixturepath=os.path.join(self.fixturedir, 'delegate_remote_su'))

tests/unit/plugins/action/test_synchronize.py:256: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.SynchronizeTester object at 0x7fe1356c69d0>
fixturepath = '/home/zuul/.ansible/collections/ansible_collections/ansible/posix/tests/unit/plugins/action/fixtures/synchronize/delegate_remote_su'

    def runtest(self, fixturepath='fixtures/synchronize/basic'):
    
        metapath = os.path.join(fixturepath, 'meta.yaml')
        with open(metapath, 'rb') as f:
            fdata = f.read()
>       test_meta = yaml.load(fdata)
E       TypeError: load() missing 1 required positional argument: 'Loader'

tests/unit/plugins/action/test_synchronize.py:128: TypeError
_________ TestSynchronizeAction.test_delegate_remote_with_private_key __________
[gw0] linux -- Python 3.8.0 /tmp/python-55ij_ymk-ansible/python
self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.TestSynchronizeAction testMethod=test_delegate_remote_with_private_key>

    @patch('ansible_collections.ansible.posix.plugins.action.synchronize.connection_loader', FakePluginLoader)
    def test_delegate_remote_with_private_key(self):
        # delegate to other remote host and use the module param private_key
        x = SynchronizeTester()
>       x.runtest(fixturepath=os.path.join(self.fixturedir, 'delegate_remote_with_private_key'))

tests/unit/plugins/action/test_synchronize.py:267: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ansible_collections.ansible.posix.tests.unit.plugins.action.test_synchronize.SynchronizeTester object at 0x7fe1356c6cd0>
fixturepath = '/home/zuul/.ansible/collections/ansible_collections/ansible/posix/tests/unit/plugins/action/fixtures/synchronize/delegate_remote_with_private_key'
    def runtest(self, fixturepath='fixtures/synchronize/basic'):
    
        metapath = os.path.join(fixturepath, 'meta.yaml')
        with open(metapath, 'rb') as f:
            fdata = f.read()
>       test_meta = yaml.load(fdata)
E       TypeError: load() missing 1 required positional argument: 'Loader'

tests/unit/plugins/action/test_synchronize.py:128: TypeError
=============================== warnings summary ===============================
../../../../../venv/lib/python3.8/site-packages/_pytest/config/__init__.py:1233
../../../../../venv/lib/python3.8/site-packages/_pytest/config/__init__.py:1233
  /home/zuul/venv/lib/python3.8/site-packages/_pytest/config/__init__.py:1233: PytestConfigWarning: Unknown config option: mock_use_standalone_module
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

../../../../../venv/lib/python3.8/site-packages/_yaml/__init__.py:18
  /home/zuul/venv/lib/python3.8/site-packages/_yaml/__init__.py:18: DeprecationWarning: The _yaml extension module is now located at yaml._yaml and its location is subject to change.  To use the LibYAML-based parser and emitter, import from `yaml`: `from yaml import CLoader as Loader, CDumper as Dumper`.
    warnings.warn(

../../../../../venv/lib/python3.8/distutils/__init__.py:4
  /home/zuul/venv/lib/python3.8/distutils/__init__.py:4: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp

-- Docs: https://docs.pytest.org/en/stable/warnings.html
- generated xml file: /home/zuul/.ansible/collections/ansible_collections/ansible/posix/tests/output/junit/python3.8-units.xml -
=========================== short test summary info ============================
FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic
FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_become
FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_become_cli
FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_vagrant
FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_vagrant_become_cli
FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_vagrant_sudo
FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_basic_with_private_key
FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_delegate_remote
FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_delegate_remote_play_context_private_key
FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_delegate_remote_su
FAILED tests/unit/plugins/action/test_synchronize.py::TestSynchronizeAction::test_delegate_remote_with_private_key
=================== 11 failed, 3 passed, 4 warnings in 1.32s ===================
Command exited with status 1 after 1.6836273670196533 seconds.
ERROR: Command "pytest --boxed -r a -n auto --color no -p no:cacheprovider -c /home/zuul/venv/lib/python3.8/site-packages/ansible_test/_data/pytest.ini --junit-xml /home/zuul/.ansible/collections/ansible_collections/ansible/posix/tests/output/junit/python3.8-units.xml --strict-markers -vvvv tests/unit/modules/system/test_mount.py tests/unit/plugins/action/test_synchronize.py" returned exit status 1.
Cleaning up temporary python directory: /tmp/python-55ij_ymk-ansible

Reviewed-by: None <None>
2021-10-21 05:57:56 +00:00
Hideki Saito
399f5e2f09 Fix unit test for synchronize action plugin
- use yaml.safe_load() instead of load()

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-10-21 08:18:17 +09:00
ansible-zuul[bot]
1ca54d181d
Merge pull request #277 from saito-hideki/pr/fix_integration_test_env
Fix integration test error on ansible devel branch

SUMMARY
Fix integration test error on ansible devel branch:

Remove centos6 platforms for integration tests on the ansible devel branch from the azure-pipelines.
Add delegate_to to each task of integration test for synchronized module on devel branch
Modify invalid parameter test to use key instead of name for sysctl module
Replace lookup plugin to slurp module in integration tests for selinux module
Add creating working directory task in integration tests for acl module

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION

For the integration test for sysctl module, we probably need to handle invalid values specified as kernel param. In this case, even if I set an invalid value as a kernel param, sysctl command shows a warning message. However, the result of the command is 0.

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
2021-10-05 07:12:06 +00:00
Hideki Saito
8f58cbb41c Fix integration test error on ansible devel branch
- Remove centos6 platforms for integration tests on
  the ansible devel branch from the azure-pipelines.
- Add delegate_to to each task of integration test for
  synchronized module on devel branch
- Modify invalid parameter test to use key instead of name
  for sysctl module
- Replace lookup plugin to slurp module in integration tests
  for selinux module
- Add creating working directory task in integration tests
  for acl module

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-10-04 17:10:20 +09:00
ansible-zuul[bot]
aaa96c2011
Merge pull request #272 from Andersson007/test_11
Copy ignore-2.12.txt to ignore-2.13.txt

SUMMARY
Relates to ansible-collections/overview#45 (comment)

Reviewed-by: None <None>
2021-09-28 12:32:55 +00:00
Andrew Klychkov
6ca7a7c0a4 Add fragment 2021-09-28 13:09:10 +02:00
Andrew Klychkov
4304552677 Copy ignore-2.12.txt to ignore-2.13.txt 2021-09-28 13:03:36 +02:00
ansible-zuul[bot]
b09750ca7f
Merge pull request #211 from saito-hideki/issue/210
mount - add a newline at the end of line in fstab

SUMMARY
Modify mount module to add a newline at the end of line in /etc/fstab.
Fixes #210
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ansible.posix.mount

ADDITIONAL INFORMATION
None

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: quidame <None>
Reviewed-by: None <None>
2021-09-27 04:58:41 +00:00
Hideki Saito
5a2b3662cb mount - add a newline at the end of line in fstab
* Fixes #210

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-09-27 12:19:06 +09:00
ansible-zuul[bot]
595ee76b69
Merge pull request #142 from WOnder93/selinux-disable-kernel
selinux: update kernel boot params when disabling/re-enabling SELinux

SUMMARY
The ability to disable SELinux from userspace based on the configuration
file is being deprecated in favor of the selinux=0 kernel boot
parameter. (Note that this affects only the "full" disable; switching
to/from permissive mode will work the same as before.)
Therefore, enhance the selinux module to try to set/unset the kernel
command-line parameter using grubby when enabling/disabling SELinux.
If the grubby package is not present on the system, the module will only
update the config file and report a warning. Note that even with the
runtime disable functionality removed, setting SELINUX=disabled in the
config file will lead to a system with no SELinux policy loaded, which
will behave in a very similar way as if SELinux was fully disabled, only
there could still be some minor performance impact, since the kernel
hooks will still be active.
More information:
https://lore.kernel.org/selinux/157836784986.560897.13893922675143903084.stgit@chester/
https://fedoraproject.org/wiki/Changes/Remove_Support_For_SELinux_Runtime_Disable
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
selinux module

Reviewed-by: Adam Miller <maxamillion@fedoraproject.org>
Reviewed-by: Ondrej Mosnáček <omosnacek@gmail.com>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: quidame <None>
Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: None <None>
2021-09-24 12:20:44 +00:00
ansible-zuul[bot]
96c342fd67
Merge pull request #263 from saito-hideki/issue/83
profile_tasks - Correctly calculate task execution time with serial execution

SUMMARY
Correctly calculate task execution time with serial execution

Fixes #83

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ansible.posix.profile_tasks

ADDITIONAL INFORMATION
After applying this PR, I can confirm that the task execution time with serial execution is correct:

Test playbook:

---
- hosts: issue_83
  gather_facts: false
  connection: local
  serial: 1

  tasks:
    - name: TASK_A
      shell: sleep 3
    - name: TASK_B
      shell: sleep 5
    - name: TASK_C
      shell: sleep 1

Results:

$ ansible-playbook -i inventory playbook/profile_tasks/issue_83.yml 
[DEPRECATION WARNING]: [defaults]callback_whitelist option, normalizing names 
to new standard, use callback_enabled instead. This feature will be removed 
from ansible-core in version 2.15. Deprecation warnings can be disabled by 
setting deprecation_warnings=False in ansible.cfg.

PLAY [issue_83] ****************************************************************

TASK [TASK_A] ******************************************************************
Friday 10 September 2021  12:40:58 +0900 (0:00:00.008)       0:00:00.008 ****** 
changed: [server100]

TASK [TASK_B] ******************************************************************
Friday 10 September 2021  12:41:02 +0900 (0:00:03.210)       0:00:03.219 ****** 
changed: [server100]

TASK [TASK_C] ******************************************************************
Friday 10 September 2021  12:41:07 +0900 (0:00:05.173)       0:00:08.392 ****** 
changed: [server100]

PLAY [issue_83] ****************************************************************

TASK [TASK_A] ******************************************************************
Friday 10 September 2021  12:41:08 +0900 (0:00:01.146)       0:00:09.539 ****** 
changed: [server101]

TASK [TASK_B] ******************************************************************
Friday 10 September 2021  12:41:11 +0900 (0:00:03.185)       0:00:12.724 ****** 
changed: [server101]

TASK [TASK_C] ******************************************************************
Friday 10 September 2021  12:41:16 +0900 (0:00:05.148)       0:00:17.873 ****** 
changed: [server101]

PLAY [issue_83] ****************************************************************

TASK [TASK_A] ******************************************************************
Friday 10 September 2021  12:41:17 +0900 (0:00:01.176)       0:00:19.050 ****** 
changed: [server102]

TASK [TASK_B] ******************************************************************
Friday 10 September 2021  12:41:21 +0900 (0:00:03.174)       0:00:22.224 ****** 
changed: [server102]

TASK [TASK_C] ******************************************************************
Friday 10 September 2021  12:41:26 +0900 (0:00:05.190)       0:00:27.415 ****** 
changed: [server102]

PLAY RECAP *********************************************************************
server100                  : ok=3    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
server101                  : ok=3    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
server102                  : ok=3    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Friday 10 September 2021  12:41:27 +0900 (0:00:01.173)       0:00:28.588 ****** 
=============================================================================== 
TASK_B ----------------------------------------------------------------- 15.51s
TASK_A ------------------------------------------------------------------ 9.57s
TASK_C ------------------------------------------------------------------ 3.50s

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: None <None>
2021-09-21 01:07:49 +00:00
Ondrej Mosnacek
53d47e1763 selinux: update kernel boot params when disabling/re-enabling SELinux
The ability to disable SELinux from userspace based on the configuration
file is being deprecated in favor of the selinux=0 kernel boot
parameter. (Note that this affects only the "full" disable; switching
to/from permissive mode will work the same as before.)

Therefore, add an 'update_kernel_param' module parameter that will cause
it to set/unset the kernel command-line parameter using grubby when
enabling/disabling SELinux. (An explicit parameter was chosen for
backwards compatibility.)

More information:
https://lore.kernel.org/selinux/157836784986.560897.13893922675143903084.stgit@chester/
https://fedoraproject.org/wiki/Changes/Remove_Support_For_SELinux_Runtime_Disable

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2021-09-20 10:09:54 +05:30
ansible-zuul[bot]
6e2230c1b3
Merge pull request #266 from pabelanger/temp/bindep.txt
Add bindep.txt file for execution environments

This adds rsync to the bindep.txt file, which will ensure rsync is
installed as a dependency for execution environments.
Signed-off-by: Paul Belanger pabelanger@redhat.com

Reviewed-by: None <None>
2021-09-15 06:40:06 +00:00
Paul Belanger
f0f0b0a2e2 Add bindep.txt file for execution environments
This adds rsync to the bindep.txt file, which will ensure rsync is
installed as a dependency for execution environments.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2021-09-14 07:54:33 -04:00
Hideki Saito
3d57a17ed6 Correctly calculate task execution time with serial execution
- Fixes #83

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-09-10 13:21:37 +09:00
ansible-zuul[bot]
610717ca76
Merge pull request #260 from simon04/patch-1
authorized_key: add lookup.url example

SUMMARY
Add lookup.url example since using split_lines=False is not straight-forward.
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
ansible.posix.authorized_key

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Simon Legner <Simon.Legner@gmail.com>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
2021-09-08 07:36:14 +00:00
Abhijeet Kasurde
dc8f7d68df
Update changelogs 2021-09-08 11:39:17 +05:30
Simon Legner
1626c3d5e6 docs(authorized_key): add lookup.url example 2021-09-08 08:00:56 +02:00
ansible-zuul[bot]
e396e5cb43
Merge pull request #254 from saito-hideki/pr/variable_warning
Display warning message for masquerade and icmp-block-inversion

SUMMARY
Display warning message if the wrong parameter set to masquerade or icmp-block-inversion

Fixes #249

It is a part of #249. Currently, the variable type of the above two parameters is str, but will be changed to bool in the future. As a starting point, this fix displays a warning message if a non-boolean value is specified.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ansible.posix.firewalld

ADDITIONAL INFORMATION
None

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
2021-09-06 06:31:34 +00:00
Hideki Saito
4a67de7b08 Display warning message if wrong parameter set to masquerade or icmp-block-inversion
* This PR is a part of #249

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-09-06 09:14:34 +09:00
ansible-zuul[bot]
7f16f56c5b
Merge pull request #248 from Akasurde/i247
firewalld: Correct usage of queryForwardPort

SUMMARY

Correct queryForwardPort API usage
Enable port_foward_test_cases tests

Fixes: #247
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/firewalld.py
tests/integration/targets/firewalld/tasks/run_all_tests.yml

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: None <None>
2021-08-18 09:14:19 +00:00
ansible-zuul[bot]
391d113a95
Merge pull request #246 from saito-hideki/pr/prep_for_next_release_1.4.0
Modify version number to prepare next release 1.4.0

SUMMARY
Modify the version number to prepare next release.

1.3.0 => 1.4.0

ISSUE TYPE

Docs Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: None <None>
2021-08-17 06:47:43 +00:00
ansible-zuul[bot]
01bccb08a9
Merge pull request #250 from Akasurde/sanity_fixes
sanity fixes for pylint test

SUMMARY
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
changelogs/fragments/sanity_fixes.yml
tests/sanity/ignore-2.12.txt
tests/unit/mock/loader.py

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: None <None>
2021-08-16 15:31:24 +00:00
Abhijeet Kasurde
249e64a64d sanity fixes for pylint test
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-16 16:04:29 +05:30
Abhijeet Kasurde
12941f6d9a firewalld: Correct usage of queryForwardPort
* Correct queryForwardPort API usage
* Enable port_foward_test_cases tests

Fixes: #247

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-16 14:12:22 +05:30
Hideki Saito
617302ba94 Modify version number to prepare next release
* 1.3.0 => 1.4.0

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-08-11 18:43:09 +09:00
ansible-zuul[bot]
ab9eaf24bc
Merge pull request #245 from saito-hideki/release_1.3.0
Release 1.3.0 commit

SUMMARY
New release 1.3.0
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
2021-08-11 09:19:31 +00:00
Hideki Saito
fad1d3a870 Release 1.3.0 commit
Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-08-11 15:51:13 +09:00
ansible-zuul[bot]
c21fb99f54
Merge pull request #244 from Akasurde/trivial
fix changelog entry

SUMMARY
Changed from bugfixes to trivial
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
changelogs/fragments/firewalld_integ_test.yml

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: None <None>
2021-08-11 05:57:26 +00:00
Abhijeet Kasurde
a65807edc3
synchronize: Use SSH args from SSH connection plugins (#223)
SSH configuration migrated from Ansible configuration to
SSH connection configuration. Make ``synchronize`` understand
this.

Fixes: #222

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-11 10:45:52 +05:30
Abhijeet Kasurde
dad5379461 fix changelog entry
Changed from `bugfixes` to `trivial`

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-10 17:58:27 +05:30
ansible-zuul[bot]
bd594970a8
Merge pull request #243 from Akasurde/test
Fix integration test fedora 34 with firewalld

SUMMARY
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/firewalld.py

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: None <None>
2021-08-10 12:22:33 +00:00
Abhijeet Kasurde
c244abd82f Fix integration test fedora 34 with firewalld
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-10 15:17:24 +05:30
ansible-zuul[bot]
42d2b9c65a
Merge pull request #233 from piotrtrojanowski-dev/patch-2
Fix requires firewalld version in comments for permanent parameter.

SUMMARY
Version of firewalled seems to be wrong. 3.0.9 version of that package does not exist.
The latest release of firewalled: https://github.com/firewalld/firewalld/releases
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
ansible.posix.firewalld

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: None <None>
2021-08-10 06:42:37 +00:00
ansible-zuul[bot]
7a62e01af6
Merge pull request #241 from xlab-steampunk/shell-quoting
Properly quote Synchronize

SUMMARY
The synchronize action plugin and module were a bit sloppy when it came to the command-line parameter quoting and that caused failure on some systems (for example, on Fedora 34).
This commit makes sure any arguments with potentially problematic characters are quoted before being used.
Fixes #242
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
synchronize

Reviewed-by: Sergey <None>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
2021-08-09 13:08:23 +00:00
ansible-zuul[bot]
18614bb82d
Merge pull request #237 from saito-hideki/issue/236
Update AZP config

SUMMARY

Fixes ansible-collections/overview#45
Fixes #236

DESCRIPTION
The following changes are for the devel version test sections:

 Remove: fedora32
 Remove: freebsd/11.4
 Remove: rhel/8.3
 Add: fedora34
 Add: freebsd/13.0
 Add: rhel/8.4

ISSUE TYPE

Test Pull Request

COMPONENT NAME
CI

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: None <None>
2021-08-09 09:32:37 +00:00
Hideki Saito
944f5416c9 Added changelog fragment file to PR #233
Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-08-07 13:28:08 +09:00
ansible-zuul[bot]
ce3d0fdfa4
Merge pull request #226 from mandar242/fix-integration-test-sysctl
Fix: sysctl integration test - virtualization type

SUMMARY

sysctl integration tests inside docker are being skipped as the check ansible_facts.virtualization_type == 'docker' fails.
On Debugging, ansible_facts.virtualization_type is being returned as "container".

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

sysctl
ADDITIONAL INFORMATION


Ansible Version

ansible [core 2.11.2]

Docker Version

Docker version 20.10.7, build f0df350

OS

Fedora 34

Actual Results
PLAY RECAP *********************************************************************
testhost                   : ok=1    changed=0    unreachable=0    failed=0    skipped=44   rescued=0    ignored=0   

Likely this code is related: https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/virtual/linux.py#L113

Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
2021-08-05 05:38:35 +00:00
mandar242
244c9b2066 sysctl: Fix integration test virtualization type 2021-08-04 21:52:50 +05:30
ansible-zuul[bot]
f85f2904c9
Merge pull request #238 from saito-hideki/pr/update_readme_with_versions
Update README.md with ansible versions and release notes

SUMMARY
Update README.md with ansible versions and release notes:

Update ansible-core versions in the Tested with ansible section.
Change the Release notes section to use CHANGELOG.rst link.

ISSUE TYPE

Docs Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
2021-08-04 12:49:26 +00:00
Tadej Borovšak
db12a40a4c Synchronize: properly quote shell command components
The synchronize action plugin and module were a bit sloppy when it
came to the command-line parameter quoting and that caused failuer on
some systems (for example, on Fedora 34).

This commit makes sure any argumnts with potentially problematic
characters are quoted before being used.
2021-08-04 13:37:18 +02:00
ansible-zuul[bot]
5282ece77e
Merge pull request #230 from sshnaidm/podmanfix2
Complete adding podman connection to synchronize

SUMMARY


ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

synchronize
ADDITIONAL INFORMATION





Continue of #229
For fixing ansible-community/molecule-podman#45

Reviewed-by: Sorin Sbarnea <sorin.sbarnea@gmail.com>
Reviewed-by: Tadej Borovšak <None>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Sergey <None>
Reviewed-by: None <None>
2021-08-04 11:32:28 +00:00
Sagi Shnaidman
133ffe51fb Complete adding podman connection to synchronize 2021-08-03 15:44:00 +03:00
ansible-zuul[bot]
b3e395a4a3
Merge pull request #239 from Akasurde/firewalld_test
Enable firewalld tests

SUMMARY
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
tests/integration/targets/firewalld/aliases
tests/integration/targets/setup_pkg_mgr/tasks/main.yml

Reviewed-by: Adam Miller <maxamillion@fedoraproject.org>
Reviewed-by: None <None>
2021-08-02 22:36:00 +00:00
Abhijeet Kasurde
424004c4c0 Enable firewalld tests
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-02 20:26:42 +05:30
Hideki Saito
dd2782d81c Update README.md with ansible versions and release notes
* Update ansible-core versions in the Tested with ansible section.
* Change the Release notes section to use CHANGELOG.rst link.

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-08-02 08:33:12 +09:00
Hideki Saito
f7f5f89899 Update AZP config
* Fixes ansible-collections/overview#45
* Fixes #236

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-07-30 23:37:15 +09:00
piotrtrojanowski-dev
2b7a35c346
Fix requires firewalld version in comments for permanent parameter. 2021-07-27 09:37:58 +02:00
Abhijeet Kasurde
fee81b19a8 Codecov comment=false
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-07-26 17:27:14 +05:30
ansible-zuul[bot]
1ebacfb195
Merge pull request #229 from sshnaidm/podman
Allow podman connections in synchronize module

SUMMARY


ISSUE TYPE


Feature Pull Request
For fixing issues with molecule: ansible-community/molecule-podman#45

COMPONENT NAME

synchronize
ADDITIONAL INFORMATION


Add podman connections as it's done with buildah and docker.

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Sergey <None>
Reviewed-by: Sumit Jaiswal <sjaiswal@redhat.com>
Reviewed-by: Hideki Saito <saito@fgrep.org>
2021-07-24 04:58:24 +00:00
Sergey
ab5c1d9911
Update changelogs/fragments/229_add_podman_connection_plugin_to_synchronize.yml
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-07-23 14:56:34 +03:00
Sagi Shnaidman
4be66cfb34 Add changelog fragment 2021-07-23 14:44:26 +03:00
Sagi Shnaidman
c5d49b2a91 Allow podman connections in synchronize module 2021-07-23 14:29:02 +03:00
ansible-zuul[bot]
a03e652437
Merge pull request #214 from saito-hideki/pr/add_firewalld_info
Add new firewalld_info module to ansible.posix collection

SUMMARY
Add new firewalld_info module to ansible.posix collection.

Gathering information about firewalld zone settings
fixes #98

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ansible.posix.firewalld_info

ADDITIONAL INFORMATION
None

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Hideki Saito <saito@fgrep.org>
2021-07-21 05:19:13 +00:00
ansible-zuul[bot]
e815909859
Merge pull request #215 from quasd/main
fix REJECT target name

SUMMARY
Fix setting default target to reject. The target name is %%REJECT%% not REJECT.
https://firewalld.org/documentation/zone/options.html
After this pull request to way to set REJECT would be
  - name: "Set target to REJECT for public"
    ansible.posix.firewalld:
      zone: public
      permanent: yes
      target: '%%REJECT%%'
      state: enabled
    become: true


ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
firewalld
ADDITIONAL INFORMATION



This snippet would fail due to there not being target called REJECT and using %%REJECT%% is not in allowed values for target
  - name: "Set target to REJECT for public"
    ansible.posix.firewalld:
      zone: public
      permanent: yes
      target: 'REJECT'
      state: enabled
    become: true

Ansible error
{
    "msg": "ERROR: Exception caught: org.fedoraproject.FirewallD1.Exception: INVALID_TARGET: REJECT Permanent operation",
    "invocation": {
        "module_args": {
            "zone": "public",
            "permanent": true,
            "target": "REJECT",
            "state": "enabled",
            "immediate": false,
            "timeout": 0,
            "icmp_block": null,
            "icmp_block_inversion": null,
            "service": null,
            "port": null,
            "port_forward": null,
            "rich_rule": null,
            "source": null,
            "interface": null,
            "masquerade": null,
            "offline": null
        }
    },
    "_ansible_no_log": false,
    "changed": false
}

syslog
Jun 29 09:49:39 <hostname retracted> ansible-ansible.posix.firewalld[9015]: Invoked with zone=public permanent=True state=enabled target=REJECT immediate=False timeout=0 icmp_[1850/7279] icmp_block_inversion=None service=None port=None port_forward=None rich_rule=None source=None interface=None masquerade=None offline=None                                                                 
Jun 29 09:49:39 <hostname retracted>  firewalld[915]: ERROR: INVALID_TARGET: REJECT

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
Reviewed-by: Amin Vakil <info@aminvakil.com>
Reviewed-by: quidame <None>
Reviewed-by: Hideki Saito <saito@fgrep.org>
2021-07-14 17:05:30 +00:00
ansible-zuul[bot]
f2601b01da
Merge pull request #213 from ndgit/fix-24-and-190
synchronize: quotes around arguments

fix quoting for specific cmd arguments
Fixes:

#24
#190

ISSUE TYPE:

Bugfix Pull Request

COMPONENT NAME:
module: synchronize

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Robert Rettig <None>
Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Mike Graves <mgraves@redhat.com>
2021-07-14 15:20:20 +00:00
Hideki Saito
27434455e5 Add new firewalld_info module to ansible.posix collection
* fixes #98

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-07-09 23:47:12 +09:00
Robert Rettig
25cfc56f6f enable integration tests
ansible-collections/ansible.posix/pull/213#issuecomment-876480707
2021-07-09 02:28:39 +02:00
Abhijeet Kasurde
c596feab78
Review comments
Co-authored-by: quidame <quidame@poivron.org>
2021-07-01 10:36:33 +05:30
quasd
049292669b fix yaml syntax for reject choices 2021-06-29 13:33:35 +03:00
quasd
310c68e6dd add tests for REJECT target 2021-06-29 11:37:20 +03:00
quasd
fcb2a466e0 add fragment 2021-06-29 11:31:04 +03:00
Erkki Hurme
757b544cf3 fix REJECT target name 2021-06-29 10:38:47 +03:00
Robert Rettig
9f384c00a3 add changelog fragment 2021-06-24 23:58:28 +02:00
Robert Rettig
0118bf0cb9 fixes #24 and #190 2021-06-24 23:37:48 +02:00
dkjii-g
553b0ea4f7
Update changelogs/fragments/166_mount_absent_fstab.yml
Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-04-02 21:00:51 -04:00
dkjii
20e294e026 add changelog 2021-04-02 12:33:58 -04:00
dkjii
18469dbb3e ansible.posix.mount: add absent_from_fstab option 2021-04-02 09:50:36 -04:00
151 changed files with 5090 additions and 646 deletions

View file

@ -36,7 +36,7 @@ variables:
resources:
containers:
- container: default
image: quay.io/ansible/azure-pipelines-test-container:1.9.0
image: quay.io/ansible/azure-pipelines-test-container:4.0.1
pool: Standard
@ -50,17 +50,89 @@ stages:
- template: templates/matrix.yml
parameters:
testFormat: devel/linux/{0}/1
targets:
- name: CentOS 7
test: centos7
- name: Fedora 38
test: fedora38
- name: openSUSE 15 py3
test: opensuse15
- name: Ubuntu 20.04
test: ubuntu2004
- name: Ubuntu 22.04
test: ubuntu2204
- stage: Docker_2_15
displayName: Docker 2.15
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.15/linux/{0}/1
targets:
- name: CentOS 7
test: centos7
- name: Fedora 37
test: fedora37
- name: openSUSE 15 py3
test: opensuse15
- name: Ubuntu 20.04
test: ubuntu2004
- name: Ubuntu 22.04
test: ubuntu2204
- stage: Docker_2_14
displayName: Docker 2.14
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.14/linux/{0}/1
targets:
- name: CentOS 7
test: centos7
- name: Fedora 36
test: fedora36
- name: openSUSE 15 py3
test: opensuse15
- name: Ubuntu 20.04
test: ubuntu2004
- name: Ubuntu 22.04
test: ubuntu2204
- stage: Docker_2_13
displayName: Docker 2.13
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.13/linux/{0}/1
targets:
- name: CentOS 7
test: centos7
- name: Fedora 34
test: fedora34
- name: Fedora 35
test: fedora35
- name: openSUSE 15 py3
test: opensuse15
- name: Ubuntu 18.04
test: ubuntu1804
- name: Ubuntu 20.04
test: ubuntu2004
- stage: Docker_2_12
displayName: Docker 2.12
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.12/linux/{0}/1
targets:
- name: CentOS 6
test: centos6
- name: CentOS 7
test: centos7
- name: CentOS 8
test: centos8
- name: Fedora 32
test: fedora32
- name: Fedora 33
test: fedora33
- name: Fedora 34
test: fedora34
- name: openSUSE 15 py2
test: opensuse15py2
- name: openSUSE 15 py3
@ -81,20 +153,12 @@ stages:
test: centos6
- name: CentOS 7
test: centos7
- name: CentOS 8
test: centos8
- name: Fedora 32
test: fedora32
- name: Fedora 33
test: fedora33
- name: openSUSE 15 py2
test: opensuse15py2
- name: openSUSE 15 py3
test: opensuse15
- name: Ubuntu 18.04
test: ubuntu1804
- name: Ubuntu 20.04
test: ubuntu2004
- stage: Docker_2_10
displayName: Docker 2.10
dependsOn: []
@ -107,12 +171,6 @@ stages:
test: centos6
- name: CentOS 7
test: centos7
- name: CentOS 8
test: centos8
- name: Fedora 30
test: fedora30
- name: Fedora 31
test: fedora31
- name: openSUSE 15 py2
test: opensuse15py2
- name: openSUSE 15 py3
@ -133,12 +191,6 @@ stages:
test: centos6
- name: CentOS 7
test: centos7
- name: CentOS 8
test: centos8
- name: Fedora 30
test: fedora30
- name: Fedora 31
test: fedora31
- name: openSUSE 15 py2
test: opensuse15py2
- name: openSUSE 15 py3
@ -156,17 +208,91 @@ stages:
- template: templates/matrix.yml
parameters:
testFormat: devel/{0}/1
targets:
- name: MacOS 13.2
test: macos/13.2
- name: RHEL 7.9
test: rhel/7.9
- name: RHEL 8.8
test: rhel/8.8
- name: RHEL 9.2
test: rhel/9.2
- name: FreeBSD 13.2
test: freebsd/13.2
- stage: Remote_2_15
displayName: Remote 2.15
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.15/{0}/1
targets:
- name: MacOS 13.2
test: macos/13.2
- name: RHEL 7.9
test: rhel/7.9
- name: RHEL 8.7
test: rhel/8.7
- name: RHEL 9.1
test: rhel/9.1
- name: FreeBSD 12.4
test: freebsd/12.4
- name: FreeBSD 13.1
test: freebsd/13.1
- stage: Remote_2_14
displayName: Remote 2.14
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.14/{0}/1
targets:
- name: MacOS 12.0
test: macos/12.0
- name: RHEL 7.9
test: rhel/7.9
- name: RHEL 8.6
test: rhel/8.6
- name: RHEL 9.0
test: rhel/9.0
- name: FreeBSD 12.3
test: freebsd/12.3
- name: FreeBSD 13.1
test: freebsd/13.1
- stage: Remote_2_13
displayName: Remote 2.13
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.13/{0}/1
targets:
- name: MacOS 12.0
test: macos/12.0
- name: RHEL 7.9
test: rhel/7.9
- name: RHEL 8.5
test: rhel/8.5
- name: FreeBSD 12.3
test: freebsd/12.3
- name: FreeBSD 13.0
test: freebsd/13.0
- stage: Remote_2_12
displayName: Remote 2.12
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.12/{0}/1
targets:
- name: MacOS 11.1
test: macos/11.1
- name: RHEL 7.9
test: rhel/7.9
- name: RHEL 8.3
test: rhel/8.3
- name: FreeBSD 11.4
test: freebsd/11.4
- name: FreeBSD 12.2
test: freebsd/12.2
- name: RHEL 8.4
test: rhel/8.4
- name: FreeBSD 13.0
test: freebsd/13.0
- stage: Remote_2_11
displayName: Remote 2.11
dependsOn: []
@ -181,10 +307,6 @@ stages:
test: rhel/7.9
- name: RHEL 8.3
test: rhel/8.3
- name: FreeBSD 11.4
test: freebsd/11.4
- name: FreeBSD 12.2
test: freebsd/12.2
- stage: Remote_2_10
displayName: Remote 2.10
dependsOn: []
@ -193,17 +315,10 @@ stages:
parameters:
testFormat: 2.10/{0}/1
targets:
- name: OS X 10.11
test: osx/10.11
- name: RHEL 7.6
test: rhel/7.6
- name: RHEL 7.9
test: rhel/7.9
- name: RHEL 8.2
test: rhel/8.2
- name: FreeBSD 11.1
test: freebsd/11.1
- name: FreeBSD 12.1
test: freebsd/12.1
- stage: Remote_2_9
displayName: Remote 2.9
dependsOn: []
@ -212,16 +327,11 @@ stages:
parameters:
testFormat: 2.9/{0}/1
targets:
- name: OS X 10.11
test: osx/10.11
- name: RHEL 7.6
test: rhel/7.6
- name: RHEL 7.9
test: rhel/7.9
- name: RHEL 8.1
test: rhel/8.1
- name: FreeBSD 11.1
test: freebsd/11.1
- name: FreeBSD 12.0
test: freebsd/12.0
## Finally
- stage: Summary
@ -230,9 +340,17 @@ stages:
- Remote_2_9
- Docker_2_9
- Remote_2_10
- Remote_2_11
- Docker_2_10
- Remote_2_11
- Docker_2_11
- Remote_2_12
- Docker_2_12
- Remote_2_13
- Docker_2_13
- Remote_2_14
- Docker_2_14
- Remote_2_15
- Docker_2_15
- Remote_devel
- Docker_devel
jobs:

View file

@ -5,6 +5,139 @@ ansible.posix Release Notes
.. contents:: Topics
v1.5.4
======
Minor Changes
-------------
- json and jsonl - Add the ``ANSIBLE_JSON_INDENT`` parameter
- json and jsonl - Add the ``path`` attribute into the play and task output
Bugfixes
--------
- Fix sysctl integration test failing on newer versions of core. Previously NoneType was allowable, now it fails to convert to a str type.
- Support new sanity test for the ansible-core devel branch CI test (https://github.com/ansible-collections/ansible.posix/issues/446).
- firewall - Fix issue where adding an interface to a zone would fail when the daemon is offline
- firewall - Fix issue where opening a specific port resulted in opening the whole protocol of the specified port
- firewalld - Consider value of masquerade and icmp_block_inversion parameters when a boolean like value is passed
v1.5.2
======
Release Summary
---------------
This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules and plugins
in this collection that have been added after the release of
``ansible.posix`` 1.5.1.
Minor Changes
-------------
- Add jsonl callback plugin to ansible.posix collection
- firewalld - add `protocol` parameter
Bugfixes
--------
- Fixed a bug where firewalld module fails to create/remove zones when the daemon is stopped
- rhel_facts - Call exit_json with all keyword arguments
v1.5.1
======
Minor Changes
-------------
- mount - Add ``absent_from_fstab`` state (https://github.com/ansible-collections/ansible.posix/pull/166).
- mount - Add ``ephemeral`` value for the ``state`` parameter, that allows to mount a filesystem without altering the ``fstab`` file (https://github.com/ansible-collections/ansible.posix/pull/267).
- r4e_rpm_ostree - new module for validating package state on RHEL for Edge
- rhel_facts - new facts module to handle RHEL specific facts
- rhel_rpm_ostree - new module to handle RHEL rpm-ostree specific package management functionality
- rpm_ostree_upgrade - new module to automate rpm-ostree upgrades
- rpm_ostree_upgrade - new module to manage upgrades for rpm-ostree based systems
Bugfixes
--------
- Removed contentious terminology to match reference documentation in profile_tasks.
- firewall - Fixed to output a more complete missing library message.
- synchronize - Fixed hosts involved in rsync require the same password
v1.4.0
======
Release Summary
---------------
This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules in this collection that
have been added after the release of ``ansible.posix`` 1.3.0.
Minor Changes
-------------
- firewalld - Show warning message that variable type of ``masquerade`` and ``icmp_block_inversion`` will be changed from ``str`` to ``boolean`` in the future release (https://github.com/ansible-collections/ansible.posix/pull/254).
- selinux - optionally update kernel boot params when disabling/re-enabling SELinux (https://github.com/ansible-collections/ansible.posix/pull/142).
Bugfixes
--------
- Fix for whitespace in source full path causing error ```code 23) at main.c(1330) [sender=3.2.3]``` (https://github.com/ansible-collections/ansible.posix/pull/278)
- Include ``PSF-license.txt`` file for ``plugins/module_utils/_version.py``.
- Use vendored version of ``distutils.version`` instead of the deprecated Python standard library to address PEP 632 (https://github.com/ansible-collections/ansible.posix/issues/303).
- firewalld - Correct usage of queryForwardPort (https://github.com/ansible-collections/ansible.posix/issues/247).
- firewalld - Refine the handling of exclusive options (https://github.com/ansible-collections/ansible.posix/issues/255).
- mount - add a newline at the end of line in ``fstab`` (https://github.com/ansible-collections/ansible.posix/issues/210).
- profile_tasks - Correctly calculate task execution time with serial execution (https://github.com/ansible-collections/ansible.posix/issues/83).
- seboolean - add ``python3-libsemanage`` package dependency for RHEL8+ systems.
v1.3.0
======
Release Summary
---------------
This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules in this collection that
have been added after the release of ``ansible.posix`` 1.2.0.
Minor Changes
-------------
- acl - add new alias ``recurse`` for ``recursive`` parameter (https://github.com/ansible-collections/ansible.posix/issues/124).
- added 2.11 branch to test matrix, added ignore-2.12.txt.
- authorized_key - add ``no_log=False`` in ``argument_spec`` to clear false-positives of ``no-log-needed`` (https://github.com/ansible-collections/ansible.posix/pull/156).
- authorized_key - add a list of valid key types (https://github.com/ansible-collections/ansible.posix/issues/134).
- mount - Change behavior of ``boot`` option to set ``noauto`` on BSD nodes (https://github.com/ansible-collections/ansible.posix/issues/28).
- mount - Change behavior of ``boot`` option to set ``noauto`` on Linux nodes (https://github.com/ansible-collections/ansible.posix/issues/28).
- mount - add ``no_log=False`` in ``argument_spec`` to clear false-positives of ``no-log-needed`` (https://github.com/ansible-collections/ansible.posix/pull/156).
- mount - returns ``backup_file`` value when a backup fstab is created.
- synchronize - add ``delay_updates`` option (https://github.com/ansible-collections/ansible.posix/issues/157).
- synchronize - fix typo (https://github.com/ansible-collections/ansible.posix/pull/198).
Bugfixes
--------
- Synchronize module not recognizing remote ssh key (https://github.com/ansible-collections/ansible.posix/issues/24).
- Synchronize not using quotes around arguments like --out-format (https://github.com/ansible-collections/ansible.posix/issues/190).
- at - append line-separator to the end of the ``command`` (https://github.com/ansible-collections/ansible.posix/issues/169).
- csh - define ``ECHO`` and ``COMMAND_SEP`` (https://github.com/ansible-collections/ansible.posix/issues/204).
- firewalld - enable integration after migration (https://github.com/ansible-collections/ansible.posix/pull/239).
- firewalld - ensure idempotency with firewalld 0.9.3 (https://github.com/ansible-collections/ansible.posix/issues/179).
- firewalld - fix setting zone target to ``%%REJECT%%`` (https://github.com/ansible-collections/ansible.posix/pull/215).
- mount - Handle ``boot`` option on Solaris correctly (https://github.com/ansible-collections/ansible.posix/issues/184).
- synchronize - add ``community.podman.podman`` to the list of supported connection plugins (https://github.com/ansible-community/molecule-podman/issues/45).
- synchronize - complete podman support for synchronize module.
- synchronize - properly quote rsync CLI parameters (https://github.com/ansible-collections/ansible.posix/pull/241).
- synchronize - replace removed ``ansible_ssh_user`` by ``ansible_user`` everywhere; do the same for ``ansible_ssh_port`` and ``ansible_ssh_host`` (https://github.com/ansible-collections/ansible.posix/issues/60).
- synchronize - use SSH args from SSH connection plugin (https://github.com/ansible-collections/ansible.posix/issues/222).
- synchronize - use become_user when invoking rsync on remote with sudo (https://github.com/ansible-collections/ansible.posix/issues/186).
- sysctl - modifying conditional check for docker to fix tests being skipped (https://github.com/ansible-collections/ansible.posix/pull/226).
v1.2.0
======
@ -26,9 +159,9 @@ Bugfixes
--------
- at - add AIX support (https://github.com/ansible-collections/ansible.posix/pull/99).
- synchronize - fix for private_key overriding in synchronize module.
- synchronize - add ``community.docker.docker`` to the list of supported transports (https://github.com/ansible-collections/ansible.posix/issues/132).
- synchronize - do not prepend PWD when path is in form user@server:path or server:path (https://github.com/ansible-collections/ansible.posix/pull/118).
- synchronize - fix for private_key overriding in synchronize module.
- sysctl - do not persist sysctl when value is invalid (https://github.com/ansible-collections/ansible.posix/pull/101).
v1.1.1

48
PSF-license.txt Normal file
View file

@ -0,0 +1,48 @@
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative version
prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.
4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.

View file

@ -6,13 +6,15 @@ https://dev.azure.com/ansible/ansible.posix/_apis/build/status/CI?branchName=mai
<!-- Describe the collection and why a user would want to use it. What does the collection do? -->
An Ansible Collection of modules and plugins that target POSIX UNIX/Linux and derivative Operating Systems.
## Supported Versions of Ansible
<!--start requires_ansible-->
## Ansible version compatibility
This collection has been tested against following Ansible versions: **>=2.9**.
For collections that support Ansible 2.9, please ensure you update your `network_os` to use the
fully qualified collection name (for example, `cisco.ios.ios`).
Plugins and modules within a collection may be tested with only specific Ansible versions.
A collection may contain metadata that identifies these versions.
PEP440 is the schema used to describe the versions of Ansible.
@ -28,8 +30,12 @@ Name | Description
[ansible.posix.at](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.at_module.rst)|Schedule the execution of a command or script file via the at command
[ansible.posix.authorized_key](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.authorized_key_module.rst)|Adds or removes an SSH authorized key
[ansible.posix.firewalld](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.firewalld_module.rst)|Manage arbitrary ports/services with firewalld
[ansible.posix.firewalld_info](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.firewalld_info_module.rst)|Gather information about firewalld
[ansible.posix.mount](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.mount_module.rst)|Control active and configured mount points
[ansible.posix.patch](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.patch_module.rst)|Apply patch files using the GNU patch tool
[ansible.posix.rhel_facts](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.rhel_facts_module.rst)|Facts module to set or override RHEL specific facts.
[ansible.posix.rhel_rpm_ostree](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.rhel_rpm_ostree_module.rst)|Ensure packages exist in a RHEL for Edge rpm-ostree based system
[ansible.posix.rpm_ostree_upgrade](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.rpm_ostree_upgrade_module.rst)|Manage rpm-ostree upgrade transactions
[ansible.posix.seboolean](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.seboolean_module.rst)|Toggles SELinux booleans
[ansible.posix.selinux](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.selinux_module.rst)|Change policy and state of SELinux
[ansible.posix.synchronize](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.synchronize_module.rst)|A wrapper around rsync to make common tasks in your playbooks quick and easy
@ -75,9 +81,7 @@ This collection follows the Ansible project's
Please read and familiarize yourself with this document.
## Release notes
* 0.1.1 Initial stable build
* 0.1.0 Internal only build
See [changelog](https://github.com/ansible-collections/ansible.posix/blob/main/CHANGELOG.rst) for more details.
## External requirements
@ -87,9 +91,12 @@ None
<!-- List the versions of Ansible the collection has been tested with. Must match what is in galaxy.yml. -->
* ansible-base 2.11 (devel)
* ansible-base 2.10 (Beta)
* ansible-base 2.9 (stable)
- ansible-core 2.14 (devel)
- ansible-core 2.13 (stable)
- ansible-core 2.12 (stable)
- ansible-core 2.11 (stable)
- ansible-base 2.10 (stable)
- ansible 2.9 (stable)
## Roadmap

4
bindep.txt Normal file
View file

@ -0,0 +1,4 @@
# This is a cross-platform list tracking distribution packages needed by tests;
# see https://docs.openstack.org/infra/bindep/ for additional information.
rsync [platform:redhat]

View file

@ -107,11 +107,11 @@ releases:
changes:
bugfixes:
- at - add AIX support (https://github.com/ansible-collections/ansible.posix/pull/99).
- synchronize - fix for private_key overriding in synchronize module.
- synchronize - add ``community.docker.docker`` to the list of supported transports
(https://github.com/ansible-collections/ansible.posix/issues/132).
- synchronize - do not prepend PWD when path is in form user@server:path or
server:path (https://github.com/ansible-collections/ansible.posix/pull/118).
- synchronize - fix for private_key overriding in synchronize module.
- sysctl - do not persist sysctl when value is invalid (https://github.com/ansible-collections/ansible.posix/pull/101).
minor_changes:
- firewalld - bring the ``target`` feature back (https://github.com/ansible-collections/ansible.posix/issues/112).
@ -134,3 +134,216 @@ releases:
- firewalld_zone_target.yml
- misc_fix.yml
release_date: '2021-03-08'
1.3.0:
changes:
bugfixes:
- Synchronize module not recognizing remote ssh key (https://github.com/ansible-collections/ansible.posix/issues/24).
- Synchronize not using quotes around arguments like --out-format (https://github.com/ansible-collections/ansible.posix/issues/190).
- at - append line-separator to the end of the ``command`` (https://github.com/ansible-collections/ansible.posix/issues/169).
- csh - define ``ECHO`` and ``COMMAND_SEP`` (https://github.com/ansible-collections/ansible.posix/issues/204).
- firewalld - enable integration after migration (https://github.com/ansible-collections/ansible.posix/pull/239).
- firewalld - ensure idempotency with firewalld 0.9.3 (https://github.com/ansible-collections/ansible.posix/issues/179).
- firewalld - fix setting zone target to ``%%REJECT%%`` (https://github.com/ansible-collections/ansible.posix/pull/215).
- mount - Handle ``boot`` option on Solaris correctly (https://github.com/ansible-collections/ansible.posix/issues/184).
- synchronize - add ``community.podman.podman`` to the list of supported connection
plugins (https://github.com/ansible-community/molecule-podman/issues/45).
- synchronize - complete podman support for synchronize module.
- synchronize - properly quote rsync CLI parameters (https://github.com/ansible-collections/ansible.posix/pull/241).
- synchronize - replace removed ``ansible_ssh_user`` by ``ansible_user`` everywhere;
do the same for ``ansible_ssh_port`` and ``ansible_ssh_host`` (https://github.com/ansible-collections/ansible.posix/issues/60).
- synchronize - use SSH args from SSH connection plugin (https://github.com/ansible-collections/ansible.posix/issues/222).
- synchronize - use become_user when invoking rsync on remote with sudo (https://github.com/ansible-collections/ansible.posix/issues/186).
- sysctl - modifying conditional check for docker to fix tests being skipped
(https://github.com/ansible-collections/ansible.posix/pull/226).
minor_changes:
- acl - add new alias ``recurse`` for ``recursive`` parameter (https://github.com/ansible-collections/ansible.posix/issues/124).
- added 2.11 branch to test matrix, added ignore-2.12.txt.
- authorized_key - add ``no_log=False`` in ``argument_spec`` to clear false-positives
of ``no-log-needed`` (https://github.com/ansible-collections/ansible.posix/pull/156).
- authorized_key - add a list of valid key types (https://github.com/ansible-collections/ansible.posix/issues/134).
- mount - Change behavior of ``boot`` option to set ``noauto`` on BSD nodes
(https://github.com/ansible-collections/ansible.posix/issues/28).
- mount - Change behavior of ``boot`` option to set ``noauto`` on Linux nodes
(https://github.com/ansible-collections/ansible.posix/issues/28).
- mount - add ``no_log=False`` in ``argument_spec`` to clear false-positives
of ``no-log-needed`` (https://github.com/ansible-collections/ansible.posix/pull/156).
- mount - returns ``backup_file`` value when a backup fstab is created.
- synchronize - add ``delay_updates`` option (https://github.com/ansible-collections/ansible.posix/issues/157).
- synchronize - fix typo (https://github.com/ansible-collections/ansible.posix/pull/198).
release_summary: 'This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules in this collection that
have been added after the release of ``ansible.posix`` 1.2.0.'
fragments:
- 1.3.0.yml
- 124_acl.yml
- 126_mount_not_returning_backup_file.yml
- 134_authorized_key.yml
- 156-fix_no-log-needed_false_positives.yml
- 159-fix-60-deprecated-ansible_ssh_user.yml
- 167-synchronize-add_delay_option.yml
- 169_add_lineseparator_to_command.yml
- 175_synchronize.yml
- 179_firewalld.yml
- 181-update_codecov_sh_url.yml
- 185_mount_at_boot.yml
- 187-fix-synchronize-become-user.yml
- 193_firewalld.yml
- 196_boot_opt_for_linux.yml
- 203_boot_opt_for_bsd.yml
- 204_csh_shell.yml
- 207-mount_tests.yml
- 213_quote_cmd_args.yml
- 214-add_firewalld_info_module.yml
- 215_fix_REJECT_target_name.yml
- 217-restructure_authrized_key_test.yml
- 222_synchronize.yml
- 226_sysctl_fix_integration_test.yml
- 229_add_podman_connection_plugin_to_synchronize.yml
- 230_complete_podman_support_for_synchronize.yml
- 233-fix-wrong-firewalld-version-info.yml
- 241-synchronize-shell-quoting.yml
- firewalld_integ_test.yml
- firewalld_test.yml
- sanity_test_ignore_file.yml
- synchronize.yml
- test_matrix.yml
release_date: '2021-08-11'
1.4.0:
changes:
bugfixes:
- Fix for whitespace in source full path causing error ```code 23) at main.c(1330)
[sender=3.2.3]``` (https://github.com/ansible-collections/ansible.posix/pull/278)
- Include ``PSF-license.txt`` file for ``plugins/module_utils/_version.py``.
- Use vendored version of ``distutils.version`` instead of the deprecated Python
standard library to address PEP 632 (https://github.com/ansible-collections/ansible.posix/issues/303).
- firewalld - Correct usage of queryForwardPort (https://github.com/ansible-collections/ansible.posix/issues/247).
- firewalld - Refine the handling of exclusive options (https://github.com/ansible-collections/ansible.posix/issues/255).
- mount - add a newline at the end of line in ``fstab`` (https://github.com/ansible-collections/ansible.posix/issues/210).
- profile_tasks - Correctly calculate task execution time with serial execution
(https://github.com/ansible-collections/ansible.posix/issues/83).
- seboolean - add ``python3-libsemanage`` package dependency for RHEL8+ systems.
minor_changes:
- firewalld - Show warning message that variable type of ``masquerade`` and
``icmp_block_inversion`` will be changed from ``str`` to ``boolean`` in the
future release (https://github.com/ansible-collections/ansible.posix/pull/254).
- selinux - optionally update kernel boot params when disabling/re-enabling
SELinux (https://github.com/ansible-collections/ansible.posix/pull/142).
release_summary: 'This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules in this collection that
have been added after the release of ``ansible.posix`` 1.3.0.'
fragments:
- 1.4.0.yml
- 211_fstab_append_newline.yml
- 247_firewalld.yml
- 254_variable_warnings.yml
- 255_authorized_key_url.yml
- 263_profile_tasks_with_serial.yml
- 272-copy_ignore_txt.yml
- 277_fix_integration_test_on_devel.yml
- 282_fix_unit_test_for_synchronize.yml
- 287_firewalld_requirements.yml
- 288_mounts_options.yml
- 297_firewalld_exclusive_options_handling.yml
- 299_seboolean_python3.yml
- 302_shippable_exit_code.yml
- 304_pep632.yml
- 346_copy_ignore_txt_for_devel.yml
- 347_add_branch_213.yml
- 349_follow_new_guidelines.yml
- 353_ci_fix_unittest_for_synchronize.yml
- disable_selinux_via_kernel_cmdline.yml
- psf-license.yml
- sanity_fixes.yml
- shell_escape_full_path_for_rsync.yml
release_date: '2022-05-23'
1.5.1:
changes:
bugfixes:
- Removed contentious terminology to match reference documentation in profile_tasks.
- firewall - Fixed to output a more complete missing library message.
- synchronize - Fixed hosts involved in rsync require the same password
minor_changes:
- mount - Add ``absent_from_fstab`` state (https://github.com/ansible-collections/ansible.posix/pull/166).
- mount - Add ``ephemeral`` value for the ``state`` parameter, that allows to
mount a filesystem without altering the ``fstab`` file (https://github.com/ansible-collections/ansible.posix/pull/267).
- r4e_rpm_ostree - new module for validating package state on RHEL for Edge
- rhel_facts - new facts module to handle RHEL specific facts
- rhel_rpm_ostree - new module to handle RHEL rpm-ostree specific package management
functionality
- rpm_ostree_upgrade - new module to automate rpm-ostree upgrades
- rpm_ostree_upgrade - new module to manage upgrades for rpm-ostree based systems
fragments:
- 166_mount_absent_fstab.yml
- 267_mount_ephemeral.yml
- 366_update_version_number_for_galaxy.yml
- 371_refactoring_ci_process_202206.yml
- 373_firewall_fix_missing_library_message.yml
- 375_update_azp_container.yml
- 380_update_usage_profile_tasks.yml
- 386_follow_ci_testing_rules.yml
- 389_ci_add_stable_214.yml
- 390_hosts_involved_same_password.yml
- 393-rpm-ostree.yml
- 393_rhel_for_edge.yml
- 400-fix-boolean-values-in-docs.yml
- 401_document_module_default_values.yml
- 407_fix_firewalld_port_test.yml
- 409_update_azp_matrix.yml
release_date: '2023-01-20'
1.5.2:
changes:
bugfixes:
- Fixed a bug where firewalld module fails to create/remove zones when the daemon
is stopped
- rhel_facts - Call exit_json with all keyword arguments
minor_changes:
- Add jsonl callback plugin to ansible.posix collection
- firewalld - add `protocol` parameter
release_summary: 'This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules and plugins
in this collection that have been added after the release of
``ansible.posix`` 1.5.1.'
fragments:
- 1.5.2.yml
- 399_firewalld_create_remove_zone_when_offline.yml
- 413-synchronize-seealso.yml
- 417-add-protocol-parameter.yml
- 419-fix-patch-doc.yml
- 425-support_test-sanity-docker-devel.yml
- 426-firewalld_info-doc-update.yml
- 434-fix-rhel_facts-exit_json.yml
- 535-add-jsonl-callback.yml
release_date: '2023-04-07'
1.5.4:
changes:
bugfixes:
- Fix sysctl integration test failing on newer versions of core. Previously
NoneType was allowable, now it fails to convert to a str type.
- Support new sanity test for the ansible-core devel branch CI test (https://github.com/ansible-collections/ansible.posix/issues/446).
- firewall - Fix issue where adding an interface to a zone would fail when the
daemon is offline
- firewall - Fix issue where opening a specific port resulted in opening the
whole protocol of the specified port
- firewalld - Consider value of masquerade and icmp_block_inversion parameters
when a boolean like value is passed
minor_changes:
- json and jsonl - Add the ``ANSIBLE_JSON_INDENT`` parameter
- json and jsonl - Add the ``path`` attribute into the play and task output
fragments:
- 343-fix-profile_tasks-callback-documentation.yml
- 402_firewall_fix_offline_interface_add.yml
- 404_firewalld_masquerade_icmp_block_inversion_bugfixes.yml
- 440-json-add-path-field.yaml
- 441-json-add-indent-parameter.yaml
- 445_ci_support_stable-215.yml
- 448_support_new_sanity_test.yml
- 451_firewall_fix_protocol_parameter.yml
- 456_sysctl_fix_nonetype.yml
release_date: '2023-05-10'

View file

@ -2,7 +2,7 @@ changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
keep_fragments: true
keep_fragments: false
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments

View file

@ -1,4 +0,0 @@
release_summary: |-
This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules in this collection that
have been added after the release of ``ansible.posix`` 1.1.0.

View file

@ -1,3 +0,0 @@
---
bugfixes:
- sysctl - do not persist sysctl when value is invalid (https://github.com/ansible-collections/ansible.posix/pull/101).

View file

@ -1,4 +0,0 @@
---
bugfixes:
- patch - fix FQCN usage for action plugin (https://github.com/ansible-collections/ansible.posix/issues/11)
- synchronize - fix FQCN usage for action plugin (https://github.com/ansible-collections/ansible.posix/issues/11)

View file

@ -1,2 +0,0 @@
bugfixes:
- "synchronize - do not prepend PWD when path is in form user@server:path or server:path (https://github.com/ansible-collections/ansible.posix/pull/118)."

View file

@ -1,2 +0,0 @@
minor_changes:
- synchronize - add the ``ssh_connection_multiplexing`` option to allow SSH connection multiplexing (https://github.com/ansible/ansible/issues/24365).

View file

@ -1,3 +0,0 @@
---
minor_changes:
- acl - add new alias ``recurse`` for ``recursive`` parameter (https://github.com/ansible-collections/ansible.posix/issues/124).

View file

@ -1,2 +0,0 @@
minor_changes:
- mount - returns ``backup_file`` value when a backup fstab is created.

View file

@ -1,2 +0,0 @@
minor_changes:
- Migrate hacking/cgroup_perf_recap_graph.py to this collection, since the cgroup_perf_recap callback lives here.

View file

@ -1,2 +0,0 @@
minor_changes:
- authorized_key - add a list of valid key types (https://github.com/ansible-collections/ansible.posix/issues/134).

View file

@ -1,4 +0,0 @@
---
bugfixes:
- synchronize - add ``community.docker.docker`` to the list of supported
transports (https://github.com/ansible-collections/ansible.posix/issues/132).

View file

@ -1,2 +0,0 @@
bugfixes:
- Mount - Handle remount with new options (https://github.com/ansible/ansible/issues/59460).

View file

@ -1,4 +0,0 @@
---
minor_changes:
- authorized_key - add ``no_log=False`` in ``argument_spec`` to clear false-positives of ``no-log-needed`` (https://github.com/ansible-collections/ansible.posix/pull/156).
- mount - add ``no_log=False`` in ``argument_spec`` to clear false-positives of ``no-log-needed`` (https://github.com/ansible-collections/ansible.posix/pull/156).

View file

@ -1,4 +0,0 @@
---
bugfixes:
- synchronize - replace removed ``ansible_ssh_user`` by ``ansible_user`` everywhere; do the same for
``ansible_ssh_port`` and ``ansible_ssh_host`` (https://github.com/ansible-collections/ansible.posix/issues/60).

View file

@ -1,2 +0,0 @@
bugfixes:
- Profile_tasks - result was a odict_items which is not subscriptable, so the slicing was failing (https://github.com/ansible/ansible/issues/59059).

View file

@ -1,3 +0,0 @@
---
minor_changes:
- synchronize - add ``delay_updates`` option (https://github.com/ansible-collections/ansible.posix/issues/157).

View file

@ -1,3 +0,0 @@
---
bugfixes:
- at - append line-separator to the end of the ``command`` (https://github.com/ansible-collections/ansible.posix/issues/169).

View file

@ -1,3 +0,0 @@
---
trivial:
- synchronize - fix typo in ``delete`` parameter (https://github.com/ansible-collections/ansible.posix/issues/175).

View file

@ -1,3 +0,0 @@
---
bugfixes:
- firewalld - ensure idempotency with firewalld 0.9.3 (https://github.com/ansible-collections/ansible.posix/issues/179).

View file

@ -1,3 +0,0 @@
---
bugfixes:
- authorized_keys - Added FIDO2 security keys (https://github.com/ansible-collections/ansible.posix/issues/17).

View file

@ -1,3 +0,0 @@
---
trivial:
- testing - update codecov.sh URL (https://github.com/ansible-collections/ansible.posix/pull/181).

View file

@ -1,3 +0,0 @@
---
bugfixes:
- "mount - Handle ``boot`` option on Solaris correctly (https://github.com/ansible-collections/ansible.posix/issues/184)."

View file

@ -1,4 +0,0 @@
---
bugfixes:
- synchronize - use become_user when invoking rsync on remote with sudo
(https://github.com/ansible-collections/ansible.posix/issues/186).

View file

@ -1,3 +0,0 @@
---
trivial:
- firewalld - specify unit for ``timeout`` parameter in docs (https://github.com/ansible-collections/ansible.posix/issues/193).

View file

@ -1,4 +0,0 @@
---
minor_changes:
- mount - Change behavior of ``boot`` option to set ``noauto`` on Linux nodes
(https://github.com/ansible-collections/ansible.posix/issues/28).

View file

@ -1,2 +0,0 @@
minor_changes:
- Enabled tags in galaxy.yml (https://github.com/ansible-collections/ansible.posix/issues/18).

View file

@ -1,4 +0,0 @@
---
minor_changes:
- mount - Change behavior of ``boot`` option to set ``noauto`` on BSD nodes
(https://github.com/ansible-collections/ansible.posix/issues/28).

View file

@ -1,3 +0,0 @@
---
bugfixes:
- csh - define ``ECHO`` and ``COMMAND_SEP`` (https://github.com/ansible-collections/ansible.posix/issues/204).

View file

@ -1,3 +0,0 @@
---
trivial:
- Make the mount module integration tests more human readable.

View file

@ -1,3 +0,0 @@
---
bugfixes:
- mount - fix issues with ismount module_util pathing for Ansible 2.9 (fixes https://github.com/ansible-collections/ansible.posix/issues/21)

View file

@ -1,3 +0,0 @@
---
trivial:
- authorized_key - Split tasks/main.yml in integration tests to each function block.

View file

@ -1,2 +1,2 @@
minor_changes:
- synchronize - add the ``quiet`` option to suppress output messages (https://github.com/ansible-collections/ansible.posix/issues/171).
- synchronize - add the ``quiet`` option to suppress non-error messages (https://github.com/ansible-collections/ansible.posix/issues/171).

View file

@ -1,3 +0,0 @@
---
bugfixes:
- selinux - add missing configuration keys for /etc/selinux/config (https://github.com/ansible-collections/ansible.posix/issues/23)

View file

@ -1,2 +0,0 @@
minor_changes:
- Removed ANSIBLE_METADATA from all the modules.

View file

@ -1,2 +0,0 @@
bugfixes:
- Typecast results before use in profile_tasks callback (https://github.com/ansible/ansible/issues/69563).

View file

@ -1,2 +0,0 @@
minor_changes:
- Update EXAMPLES section in modules to use FQCN.

View file

@ -1,2 +0,0 @@
bugfixes:
- Revert "mount - Check if src exists before mounted (ansible/ansible#61752)".

View file

@ -1,2 +0,0 @@
minor_changes:
- Revert "Enable at, patch and synchronize tests (https://github.com/ansible-collections/ansible.posix/pull/5)".

View file

@ -1,3 +0,0 @@
---
bugfixes:
- authorized_keys - fix inconsistent return value for check mode (https://github.com/ansible-collections/ansible.posix/issues/37)

View file

@ -1,2 +0,0 @@
minor_changes:
- Remove license key from galaxy.yml.

View file

@ -1,2 +0,0 @@
minor_changes:
- Remove sanity jobs from shippable (https://github.com/ansible-collections/ansible.posix/pull/43).

View file

@ -0,0 +1,2 @@
trivial:
- "Fix integration tests so they work with ansible-core devel / 2.16 (https://github.com/ansible-collections/ansible.posix/pull/466)."

View file

@ -0,0 +1,3 @@
---
trivial:
- "Drop Python3.9 and update versions of RHEL,Fedora and FreeBSD for ansible-core:devel test(https://github.com/ansible-collections/ansible.posix/issues/476)."

View file

@ -0,0 +1,3 @@
---
trivial:
- "Drop FreeBSD12.4 from CI for ansible-core:devel(https://github.com/ansible-collections/ansible.posix/issues/486)."

View file

@ -1,2 +0,0 @@
minor_changes:
- Update README.md (https://github.com/ansible-collections/ansible.posix/pull/4/).

View file

@ -1,2 +0,0 @@
minor_changes:
- Enable tests for at, patch and synchronize modules (https://github.com/ansible-collections/ansible.posix/pull/5).

View file

@ -1,4 +0,0 @@
bugfixes:
- json callback - Fix host result to task references in the resultant JSON
output for non-lockstep strategy plugins such as free
(https://github.com/ansible/ansible/issues/65931)

View file

@ -1,2 +0,0 @@
minor_changes:
- CI should use devel (https://github.com/ansible-collections/ansible.posix/pull/6).

View file

@ -1,2 +0,0 @@
bugfixes:
- Fix synchronize to work with renamed docker and buildah connection plugins.

View file

@ -1,2 +0,0 @@
bugfixes:
- Allow unsetting existing environment vars via environment by specifying a null value (https://github.com/ansible/ansible/pull/68236).

View file

@ -1,3 +0,0 @@
---
bugfixes:
- synchronize - fix for private_key overriding in synchronize module.

View file

@ -1,2 +0,0 @@
bugfixes:
- at - add AIX support (https://github.com/ansible-collections/ansible.posix/pull/99).

View file

@ -1,3 +0,0 @@
---
minor_changes:
- firewalld - add firewalld module to ansible.posix collection

View file

@ -1,2 +0,0 @@
minor_changes:
- firewalld - bring the ``target`` feature back (https://github.com/ansible-collections/ansible.posix/issues/112).

View file

@ -1,2 +0,0 @@
major_changes:
- Bootstrap Collection (https://github.com/ansible-collections/ansible.posix/pull/1).

View file

@ -1,2 +0,0 @@
minor_changes:
- fix sanity test for various modules.

View file

@ -1,2 +0,0 @@
trivial:
- Add sanity test ignore file for ansible version 2.12

View file

@ -1,3 +0,0 @@
---
minor_changes:
- skippy - fixed the deprecation warning (by date) for skippy callback plugin

View file

@ -1,3 +0,0 @@
---
minor_changes:
- synchronize - fix typo (https://github.com/ansible-collections/ansible.posix/pull/198).

View file

@ -0,0 +1,2 @@
trivial:
- "Move Galaxy test requirements from old transitional format in tests/requirements.yml to standard Ansible Galaxy requirements files in tests/integration/requirements.yml and tests/unit/requirements.yml."

View file

@ -1,2 +0,0 @@
minor_changes:
- added 2.11 branch to test matrix, added ignore-2.12.txt.

1
codecov.yml Normal file
View file

@ -0,0 +1 @@
comment: false

View file

@ -49,8 +49,8 @@ Parameters
</ul>
</td>
<td>
<div>If the target is a directory, setting this to <code>yes</code> will make it the default ACL for entities created inside the directory.</div>
<div>Setting <code>default</code> to <code>yes</code> causes an error if the path is a file.</div>
<div>If the target is a directory, setting this to <code>true</code> will make it the default ACL for entities created inside the directory.</div>
<div>Setting <code>default</code> to <code>true</code> causes an error if the path is a file.</div>
</td>
</tr>
<tr>
@ -59,10 +59,11 @@ Parameters
<b>entity</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">""</div>
</td>
<td>
<div>The actual user or group that the ACL applies to when matching entity types user or group are selected.</div>
@ -74,7 +75,7 @@ Parameters
<b>entry</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
</div>
</td>
<td>
@ -94,7 +95,7 @@ Parameters
<b>etype</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
</div>
</td>
<td>
@ -151,13 +152,14 @@ Parameters
<b>permissions</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div>The permissions to apply/remove can be any combination of <code>r</code>, <code>w</code>, <code>x</code> (read, write and execute respectively), and <code>X</code> (execute permission if the file is a directory or already has execute permission for some user)</div>
<div>The permissions to apply/remove can be any combination of <code>r</code>, <code>w</code>, <code>x</code></div>
<div>(read, write and execute respectively), and <code>X</code> (execute permission if the file is a directory or already has execute permission for some user)</div>
</td>
</tr>
<tr>
@ -166,7 +168,7 @@ Parameters
<b>recalculate_mask</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
</div>
</td>
<td>
@ -200,6 +202,8 @@ Parameters
<td>
<div>Recursively sets the specified ACL.</div>
<div>Incompatible with <code>state=query</code>.</div>
<div>Alias <code>recurse</code> added in version 1.3.0.</div>
<div style="font-size: small; color: darkgreen"><br/>aliases: recurse</div>
</td>
</tr>
<tr>
@ -208,7 +212,7 @@ Parameters
<b>state</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
</div>
</td>
<td>
@ -259,7 +263,7 @@ Notes
Examples
--------
.. code-block:: yaml+jinja
.. code-block:: yaml
- name: Grant user Joe read access to a file
ansible.posix.acl:
@ -282,7 +286,7 @@ Examples
entity: joe
etype: user
permissions: rw
default: yes
default: true
state: present
- name: Same as previous but using entry shorthand

View file

@ -62,7 +62,6 @@ Parameters
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">integer</span>
/ <span style="color: red">required</span>
</div>
</td>
<td>
@ -131,7 +130,6 @@ Parameters
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
/ <span style="color: red">required</span>
</div>
</td>
<td>
@ -155,7 +153,7 @@ Parameters
Examples
--------
.. code-block:: yaml+jinja
.. code-block:: yaml
- name: Schedule a command to execute in 20 minutes as root
ansible.posix.at:
@ -173,7 +171,7 @@ Examples
command: ls -d / >/dev/null
count: 20
units: minutes
unique: yes
unique: true

View file

@ -113,7 +113,7 @@ Parameters
<b>key_options</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
</div>
</td>
<td>
@ -139,8 +139,8 @@ Parameters
</td>
<td>
<div>Whether this module should manage the directory of the authorized key file.</div>
<div>If set to <code>yes</code>, the module will create the directory, as well as set the owner and permissions of an existing directory.</div>
<div>Be sure to set <code>manage_dir=no</code> if you are using an alternate directory for authorized_keys, as set with <code>path</code>, since you could lock yourself out of SSH access.</div>
<div>If set to <code>true</code>, the module will create the directory, as well as set the owner and permissions of an existing directory.</div>
<div>Be sure to set <code>manage_dir=false</code> if you are using an alternate directory for authorized_keys, as set with <code>path</code>, since you could lock yourself out of SSH access.</div>
<div>See the example below.</div>
</td>
</tr>
@ -212,9 +212,9 @@ Parameters
</td>
<td>
<div>This only applies if using a https url as the source of the keys.</div>
<div>If set to <code>no</code>, the SSL certificates will not be validated.</div>
<div>This should only set to <code>no</code> used on personally controlled sites using self-signed certificates as it avoids verifying the source site.</div>
<div>Prior to 2.1 the code worked as if this was set to <code>yes</code>.</div>
<div>If set to <code>false</code>, the SSL certificates will not be validated.</div>
<div>This should only set to <code>false</code> used on personally controlled sites using self-signed certificates as it avoids verifying the source site.</div>
<div>Prior to 2.1 the code worked as if this was set to <code>true</code>.</div>
</td>
</tr>
</table>
@ -226,7 +226,7 @@ Parameters
Examples
--------
.. code-block:: yaml+jinja
.. code-block:: yaml
- name: Set authorized key taken from file
ansible.posix.authorized_key:
@ -240,13 +240,19 @@ Examples
state: present
key: https://github.com/charlie.keys
- name: Set authorized keys taken from url using lookup
ansible.posix.authorized_key:
user: charlie
state: present
key: "{{ lookup('url', 'https://github.com/charlie.keys', split_lines=False) }}"
- name: Set authorized key in alternate location
ansible.posix.authorized_key:
user: charlie
state: present
key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
path: /etc/ssh/authorized_keys/charlie
manage_dir: False
manage_dir: false
- name: Set up multiple authorized keys
ansible.posix.authorized_key:
@ -269,14 +275,14 @@ Examples
user: charlie
state: present
key: https://github.com/user.keys
validate_certs: False
validate_certs: false
- name: Set authorized key, removing all the authorized keys already set
ansible.posix.authorized_key:
user: root
key: "{{ lookup('file', 'public_keys/doe-jane') }}"
state: present
exclusive: True
exclusive: true
- name: Set authorized key for user ubuntu copying it from current user
ansible.posix.authorized_key:
@ -454,7 +460,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
</td>
<td>success</td>
<td>
<div>This only applies if using a https url as the source of the keys. If set to <code>no</code>, the SSL certificates will not be validated.</div>
<div>This only applies if using a https url as the source of the keys. If set to <code>false</code>, the SSL certificates will not be validated.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">True</div>

View file

@ -0,0 +1,526 @@
.. _ansible.posix.firewalld_info_module:
****************************
ansible.posix.firewalld_info
****************************
**Gather information about firewalld**
.. contents::
:local:
:depth: 1
Synopsis
--------
- This module gathers information about firewalld rules.
Requirements
------------
The below requirements are needed on the host that executes this module.
- firewalld >= 0.2.11
- python-firewall
- python-dbus
Parameters
----------
.. raw:: html
<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="1">Parameter</th>
<th>Choices/<font color="blue">Defaults</font></th>
<th width="100%">Comments</th>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>active_zones</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
<li>yes</li>
</ul>
</td>
<td>
<div>Gather information about active zones.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>zones</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
/ <span style="color: purple">elements=string</span>
</div>
</td>
<td>
</td>
<td>
<div>Gather information about specific zones.</div>
<div>If only works if <code>active_zones</code> is set to <code>false</code>.</div>
</td>
</tr>
</table>
<br/>
Examples
--------
.. code-block:: yaml
- name: Gather information about active zones
ansible.posix.firewalld_info:
active_zones: true
register: result
- name: Print default zone for debugging
ansible.builtin.debug:
var: result.firewalld_info.default_zone
- name: Gather information about specific zones
ansible.posix.firewalld_info:
zones:
- public
- external
- internal
register: result
Return Values
-------------
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
.. raw:: html
<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="4">Key</th>
<th>Returned</th>
<th width="100%">Description</th>
</tr>
<tr>
<td colspan="4">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>active_zones</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>success</td>
<td>
<div>Gather active zones only if turn it <code>true</code>.</div>
<br/>
</td>
</tr>
<tr>
<td colspan="4">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>collected_zones</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
</div>
</td>
<td>success</td>
<td>
<div>A list of collected zones.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;external&#x27;, &#x27;internal&#x27;]</div>
</td>
</tr>
<tr>
<td colspan="4">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>firewalld_info</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">complex</span>
</div>
</td>
<td>success</td>
<td>
<div>Returns various information about firewalld configuration.</div>
<br/>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="3">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>default_zone</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>success</td>
<td>
<div>The zone name of default zone.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">public</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="3">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>version</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>success</td>
<td>
<div>The version information of firewalld.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">0.8.2</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="3">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>zones</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">complex</span>
</div>
</td>
<td>success</td>
<td>
<div>A dict of zones to gather information.</div>
<br/>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="2">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>zone</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">complex</span>
</div>
</td>
<td>success</td>
<td>
<div>The zone name registered in firewalld.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">external</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>forward</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>success</td>
<td>
<div>The network interface forwarding.</div>
<div>This parameter supports on python-firewall 0.9.0(or later) and is not collected in earlier versions.</div>
<br/>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>forward_ports</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
</div>
</td>
<td>success</td>
<td>
<div>A list of forwarding port pair with protocol.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;icmp&#x27;, &#x27;ipv6-icmp&#x27;]</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>icmp_block_inversion</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>success</td>
<td>
<div>The ICMP block inversion to block all ICMP requests.</div>
<br/>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>icmp_blocks</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
</div>
</td>
<td>success</td>
<td>
<div>A list of blocking icmp protocol.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;echo-request&#x27;]</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>interfaces</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
</div>
</td>
<td>success</td>
<td>
<div>A list of network interfaces.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;eth0&#x27;, &#x27;eth1&#x27;]</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>masquerade</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>success</td>
<td>
<div>The network interface masquerading.</div>
<br/>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>ports</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
</div>
</td>
<td>success</td>
<td>
<div>A list of network port with protocol.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[[&#x27;22&#x27;, &#x27;tcp&#x27;], [&#x27;80&#x27;, &#x27;tcp&#x27;]]</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>protocols</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
</div>
</td>
<td>success</td>
<td>
<div>A list of network protocol.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;icmp&#x27;, &#x27;ipv6-icmp&#x27;]</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>rich_rules</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
</div>
</td>
<td>success</td>
<td>
<div>A list of rich language rule.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;rule protocol value=&quot;icmp&quot; reject&#x27;, &#x27;rule priority=&quot;32767&quot; reject&#x27;]</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>services</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
</div>
</td>
<td>success</td>
<td>
<div>A list of network services.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;dhcp&#x27;, &#x27;dns&#x27;, &#x27;ssh&#x27;]</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>source_ports</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
</div>
</td>
<td>success</td>
<td>
<div>A list of network source port with protocol.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[[&#x27;30000&#x27;, &#x27;tcp&#x27;], [&#x27;30001&#x27;, &#x27;tcp&#x27;]]</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>sources</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
</div>
</td>
<td>success</td>
<td>
<div>A list of source network address.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;172.16.30.0/24&#x27;, &#x27;172.16.31.0/24&#x27;]</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td class="elbow-placeholder">&nbsp;</td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>target</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>success</td>
<td>
<div>A list of services in the zone.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">ACCEPT</div>
</td>
</tr>
<tr>
<td colspan="4">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>undefined_zones</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
</div>
</td>
<td>success</td>
<td>
<div>A list of undefined zones in <code>zones</code> option.</div>
<div><code>undefined_zones</code> will be ignored for gathering process.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;foo&#x27;, &#x27;bar&#x27;]</div>
</td>
</tr>
</table>
<br/><br/>
Status
------
Authors
~~~~~~~
- Hideki Saito (@saito-hideki)

View file

@ -25,6 +25,7 @@ Requirements
The below requirements are needed on the host that executes this module.
- firewalld >= 0.2.11
- python-firewall >= 0.2.11
Parameters
@ -34,12 +35,12 @@ Parameters
<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="1">Parameter</th>
<th colspan="2">Parameter</th>
<th>Choices/<font color="blue">Defaults</font></th>
<th width="100%">Comments</th>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>icmp_block</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -54,7 +55,7 @@ Parameters
</td>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>icmp_block_inversion</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -69,7 +70,7 @@ Parameters
</td>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>immediate</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -88,7 +89,7 @@ Parameters
</td>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>interface</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -103,7 +104,7 @@ Parameters
</td>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>masquerade</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -118,7 +119,7 @@ Parameters
</td>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>offline</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -137,7 +138,7 @@ Parameters
</td>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>permanent</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -153,12 +154,12 @@ Parameters
</td>
<td>
<div>Should this configuration be in the running firewalld configuration or persist across reboots.</div>
<div>As of Ansible 2.3, permanent operations can operate on firewalld configs when it is not running (requires firewalld &gt;= 3.0.9).</div>
<div>Note that if this is <code>no</code>, immediate is assumed <code>yes</code>.</div>
<div>As of Ansible 2.3, permanent operations can operate on firewalld configs when it is not running (requires firewalld &gt;= 0.3.9).</div>
<div>Note that if this is <code>false</code>, immediate is assumed <code>true</code>.</div>
</td>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>port</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -174,12 +175,13 @@ Parameters
</td>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>port_forward</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
<span style="color: purple">list</span>
/ <span style="color: purple">elements=dictionary</span>
</div>
</td>
<td>
@ -188,8 +190,95 @@ Parameters
<div>Port and protocol to forward using firewalld.</div>
</td>
</tr>
<tr>
<tr>
<td class="elbow-placeholder"></td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>port</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
/ <span style="color: red">required</span>
</div>
</td>
<td>
</td>
<td>
<div>Source port to forward from</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>proto</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
/ <span style="color: red">required</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li>udp</li>
<li>tcp</li>
</ul>
</td>
<td>
<div>protocol to forward</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>toaddr</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div>Optional address to forward to</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>toport</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
/ <span style="color: red">required</span>
</div>
</td>
<td>
</td>
<td>
<div>destination port</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>protocol</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div>Name of a protocol to add/remove to/from firewalld.</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>rich_rule</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -205,7 +294,7 @@ Parameters
</td>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>service</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -221,7 +310,7 @@ Parameters
</td>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>source</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -236,7 +325,7 @@ Parameters
</td>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>state</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -260,7 +349,30 @@ Parameters
</td>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>target</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
<div style="font-style: italic; font-size: small; color: darkgreen">added in 1.2.0</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li>default</li>
<li>ACCEPT</li>
<li>DROP</li>
<li>%%REJECT%%</li>
</ul>
</td>
<td>
<div>firewalld Zone target</div>
<div>If state is set to <code>absent</code>, this will reset the target to default</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>timeout</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -272,11 +384,11 @@ Parameters
<b>Default:</b><br/><div style="color: blue">0</div>
</td>
<td>
<div>The amount of time the rule should be in effect for when non-permanent.</div>
<div>The amount of time in seconds the rule should be in effect for when non-permanent.</div>
</td>
</tr>
<tr>
<td colspan="1">
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>zone</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
@ -305,40 +417,47 @@ Notes
- Requires the python2 bindings of firewalld, which may not be installed by default.
- For distributions where the python2 firewalld bindings are unavailable (e.g Fedora 28 and later) you will have to set the ansible_python_interpreter for these hosts to the python3 interpreter path and install the python3 bindings.
- Zone transactions (creating, deleting) can be performed by using only the zone and state parameters "present" or "absent". Note that zone transactions must explicitly be permanent. This is a limitation in firewalld. This also means that you will have to reload firewalld after adding a zone that you wish to perform immediate actions on. The module will not take care of this for you implicitly because that would undo any previously performed immediate actions which were not permanent. Therefore, if you require immediate access to a newly created zone it is recommended you reload firewalld immediately after the zone creation returns with a changed state and before you perform any other immediate, non-permanent actions on that zone.
- This module needs ``python-firewall`` or ``python3-firewall`` on managed nodes. It is usually provided as a subset with ``firewalld`` from the OS distributor for the OS default Python interpreter.
Examples
--------
.. code-block:: yaml+jinja
.. code-block:: yaml
- name: permit traffic in default zone for https service
ansible.posix.firewalld:
service: https
permanent: yes
permanent: true
state: enabled
- name: permit ospf traffic
ansible.posix.firewalld:
protocol: ospf
permanent: true
state: enabled
- name: do not permit traffic in default zone on port 8081/tcp
ansible.posix.firewalld:
port: 8081/tcp
permanent: yes
permanent: true
state: disabled
- ansible.posix.firewalld:
port: 161-162/udp
permanent: yes
permanent: true
state: enabled
- ansible.posix.firewalld:
zone: dmz
service: http
permanent: yes
permanent: true
state: enabled
- ansible.posix.firewalld:
rich_rule: rule service name="ftp" audit limit value="1/m" accept
permanent: yes
permanent: true
state: enabled
- ansible.posix.firewalld:
@ -349,46 +468,49 @@ Examples
- ansible.posix.firewalld:
zone: trusted
interface: eth2
permanent: yes
permanent: true
state: enabled
- ansible.posix.firewalld:
masquerade: yes
masquerade: true
state: enabled
permanent: yes
permanent: true
zone: dmz
- ansible.posix.firewalld:
zone: custom
state: present
permanent: yes
permanent: true
- ansible.posix.firewalld:
zone: drop
state: enabled
permanent: yes
icmp_block_inversion: yes
permanent: true
icmp_block_inversion: true
- ansible.posix.firewalld:
zone: drop
state: enabled
permanent: yes
permanent: true
icmp_block: echo-request
- name: Redirect port 443 to 8443
become: yes
- ansible.posix.firewalld:
zone: internal
state: present
permanent: true
target: ACCEPT
- name: Redirect port 443 to 8443 with Rich Rule
ansible.posix.firewalld:
port_forward:
- port: 443
proto: tcp
toport: 8443
rich_rule: rule family=ipv4 forward-port port=443 protocol=tcp to-port=8443
zone: public
permanent: yes
immediate: yes
permanent: true
immediate: true
state: enabled
Status
------

View file

@ -69,7 +69,11 @@ Parameters
</td>
<td>
<div>Determines if the filesystem should be mounted on boot.</div>
<div>Only applies to Solaris systems.</div>
<div>Only applies to Solaris and Linux systems.</div>
<div>For Solaris systems, <code>true</code> will set <code>yes</code> as the value of mount at boot in <em>/etc/vfstab</em>.</div>
<div>For Linux, FreeBSD, NetBSD and OpenBSD systems, <code>false</code> will add <code>noauto</code> to mount options in <em>/etc/fstab</em>.</div>
<div>To avoid mount option conflicts, if <code>noauto</code> specified in <code>opts</code>, mount module will ignore <code>boot</code>.</div>
<div>This parameter is ignored when <em>state</em> is set to <code>ephemeral</code>.</div>
</td>
</tr>
<tr>
@ -82,12 +86,12 @@ Parameters
</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">0</div>
<b>Default:</b><br/><div style="color: blue">"0"</div>
</td>
<td>
<div>Dump (see fstab(5)).</div>
<div>Note that if set to <code>null</code> and <em>state</em> set to <code>present</code>, it will cease to work and duplicate entries will be made with subsequent runs.</div>
<div>Has no effect on Solaris systems.</div>
<div>Has no effect on Solaris systems or when used with <code>ephemeral</code>.</div>
</td>
</tr>
<tr>
@ -107,6 +111,7 @@ Parameters
<div>This might be useful if you need to configure mountpoints in a chroot environment.</div>
<div>OpenBSD does not allow specifying alternate fstab files with mount so do not use this on OpenBSD with any state that operates on the live filesystem.</div>
<div>This parameter defaults to /etc/fstab or /etc/vfstab on Solaris.</div>
<div>This parameter is ignored when <em>state</em> is set to <code>ephemeral</code>.</div>
</td>
</tr>
<tr>
@ -122,7 +127,7 @@ Parameters
</td>
<td>
<div>Filesystem type.</div>
<div>Required when <em>state</em> is <code>present</code> or <code>mounted</code>.</div>
<div>Required when <em>state</em> is <code>present</code>, <code>mounted</code> or <code>ephemeral</code>.</div>
</td>
</tr>
<tr>
@ -150,12 +155,12 @@ Parameters
</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">0</div>
<b>Default:</b><br/><div style="color: blue">"0"</div>
</td>
<td>
<div>Passno (see fstab(5)).</div>
<div>Note that if set to <code>null</code> and <em>state</em> set to <code>present</code>, it will cease to work and duplicate entries will be made with subsequent runs.</div>
<div>Deprecated on Solaris systems.</div>
<div>Deprecated on Solaris systems. Has no effect when used with <code>ephemeral</code>.</div>
</td>
</tr>
<tr>
@ -189,7 +194,7 @@ Parameters
</td>
<td>
<div>Device (or NFS volume, or something else) to be mounted on <em>path</em>.</div>
<div>Required when <em>state</em> set to <code>present</code> or <code>mounted</code>.</div>
<div>Required when <em>state</em> set to <code>present</code>, <code>mounted</code> or <code>ephemeral</code>.</div>
</td>
</tr>
<tr>
@ -205,18 +210,22 @@ Parameters
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li>absent</li>
<li>absent_from_fstab</li>
<li>mounted</li>
<li>present</li>
<li>unmounted</li>
<li>remounted</li>
<li>ephemeral</li>
</ul>
</td>
<td>
<div>If <code>mounted</code>, the device will be actively mounted and appropriately configured in <em>fstab</em>. If the mount point is not present, the mount point will be created.</div>
<div>If <code>unmounted</code>, the device will be unmounted without changing <em>fstab</em>.</div>
<div><code>present</code> only specifies that the device is to be configured in <em>fstab</em> and does not trigger or require a mount.</div>
<div><code>ephemeral</code> only specifies that the device is to be mounted, without changing <em>fstab</em>. If it is already mounted, a remount will be triggered. This will always return changed=True. If the mount point <em>path</em> has already a device mounted on, and its source is different than <em>src</em>, the module will fail to avoid unexpected unmount or mount point override. If the mount point is not present, the mount point will be created. The <em>fstab</em> is completely ignored. This option is added in version 1.5.0.</div>
<div><code>absent</code> specifies that the device mount&#x27;s entry will be removed from <em>fstab</em> and will also unmount the device and remove the mount point.</div>
<div><code>remounted</code> specifies that the device will be remounted for when you want to force a refresh on the mount itself (added in 2.9). This will always return changed=true. If <em>opts</em> is set, the options will be applied to the remount, but will not change <em>fstab</em>. Additionally, if <em>opts</em> is set, and the remount command fails, the module will error to prevent unexpected mount changes. Try using <code>mounted</code> instead to work around this issue.</div>
<div><code>remounted</code> specifies that the device will be remounted for when you want to force a refresh on the mount itself (added in 2.9). This will always return changed=true. If <em>opts</em> is set, the options will be applied to the remount, but will not change <em>fstab</em>. Additionally, if <em>opts</em> is set, and the remount command fails, the module will error to prevent unexpected mount changes. Try using <code>mounted</code> instead to work around this issue. <code>remounted</code> expects the mount point to be present in the <em>fstab</em>. To remount a mount point not registered in <em>fstab</em>, use <code>ephemeral</code> instead, especially with BSD nodes.</div>
<div><code>absent_from_fstab</code> specifies that the device mount&#x27;s entry will be removed from <em>fstab</em>. This option does not unmount it or delete the mountpoint.</div>
</td>
</tr>
</table>
@ -235,7 +244,7 @@ Notes
Examples
--------
.. code-block:: yaml+jinja
.. code-block:: yaml
# Before 2.3, option 'name' was used instead of 'path'
- name: Mount DVD read-only
@ -292,10 +301,27 @@ Examples
ansible.posix.mount:
src: 192.168.1.100:/nfs/ssd/shared_data
path: /mnt/shared_data
opts: rw,sync,hard,intr
opts: rw,sync,hard
state: mounted
fstype: nfs
- name: Mount NFS volumes with noauto according to boot option
ansible.posix.mount:
src: 192.168.1.100:/nfs/ssd/shared_data
path: /mnt/shared_data
opts: rw,sync,hard
boot: false
state: mounted
fstype: nfs
- name: Mount ephemeral SMB volume
ansible.posix.mount:
src: //192.168.1.200/share
path: /mnt/smb_share
opts: "rw,vers=3,file_mode=0600,dir_mode=0700,dom={{ ad_domain }},username={{ ad_username }},password={{ ad_password }}"
fstype: cifs
state: ephemeral

View file

@ -84,9 +84,9 @@ Parameters
</ul>
</td>
<td>
<div>Setting to <code>yes</code> will disable patch&#x27;s heuristic for transforming CRLF line endings into LF.</div>
<div>Setting to <code>true</code> will disable patch&#x27;s heuristic for transforming CRLF line endings into LF.</div>
<div>Line endings of src and dest must match.</div>
<div>If set to <code>no</code>, <code>patch</code> will replace CRLF in <code>src</code> files on POSIX.</div>
<div>If set to <code>false</code>, <code>patch</code> will replace CRLF in <code>src</code> files on POSIX.</div>
</td>
</tr>
<tr>
@ -122,7 +122,7 @@ Parameters
</ul>
</td>
<td>
<div>Setting to <code>yes</code> will ignore white space changes between patch and input..</div>
<div>Setting to <code>true</code> will ignore white space changes between patch and input.</div>
</td>
</tr>
<tr>
@ -141,7 +141,7 @@ Parameters
</ul>
</td>
<td>
<div>If <code>no</code>, it will search for src at originating/controller machine, if <code>yes</code> it will go to the remote/target machine for the <code>src</code>.</div>
<div>If <code>false</code>, it will search for src at originating/controller machine, if <code>true</code> it will go to the remote/target machine for the <code>src</code>.</div>
</td>
</tr>
<tr>
@ -157,7 +157,7 @@ Parameters
<td>
</td>
<td>
<div>Path of the patch file as accepted by the GNU patch tool. If <code>remote_src</code> is &#x27;no&#x27;, the patch source file is looked up from the module&#x27;s <em>files</em> directory.</div>
<div>Path of the patch file as accepted by the GNU patch tool. If <code>remote_src</code> is <code>false</code>, the patch source file is looked up from the module&#x27;s <em>files</em> directory.</div>
<div style="font-size: small; color: darkgreen"><br/>aliases: patchfile</div>
</td>
</tr>
@ -212,7 +212,7 @@ Notes
Examples
--------
.. code-block:: yaml+jinja
.. code-block:: yaml
- name: Apply patch to one file
ansible.posix.patch:

View file

@ -0,0 +1,103 @@
.. _ansible.posix.rhel_facts_module:
************************
ansible.posix.rhel_facts
************************
**Facts module to set or override RHEL specific facts.**
Version added: 1.5.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- Compatibility layer for using the "package" module for rpm-ostree based systems via setting the "pkg_mgr" fact correctly.
Requirements
------------
The below requirements are needed on the host that executes this module.
- rpm-ostree
See Also
--------
.. seealso::
:ref:`ansible.builtin.package_module`
The official documentation on the **ansible.builtin.package** module.
Examples
--------
.. code-block:: yaml
- name: Playbook to use the package module on all RHEL footprints
vars:
ansible_facts_modules:
- setup # REQUIRED to be run before all custom fact modules
- ansible.posix.rhel_facts
tasks:
- name: Ensure packages are installed
ansible.builtin.package:
name:
- htop
- ansible
state: present
Returned Facts
--------------
Facts returned by this module are added/updated in the ``hostvars`` host facts and can be referenced by name just like any other host fact. They do not need to be registered in order to use them.
.. raw:: html
<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="1">Fact</th>
<th>Returned</th>
<th width="100%">Description</th>
</tr>
<tr>
<td colspan="1" colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>pkg_mgr</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this fact"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>when needed</td>
<td>
<div>System-level package manager override
</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">{&#x27;pkg_mgr&#x27;: &#x27;ansible.posix.rhel_facts&#x27;}</div>
</td>
</tr>
</table>
<br/><br/>
Status
------
Authors
~~~~~~~
- Adam Miller (@maxamillion)

View file

@ -0,0 +1,156 @@
.. _ansible.posix.rhel_rpm_ostree_module:
*****************************
ansible.posix.rhel_rpm_ostree
*****************************
**Ensure packages exist in a RHEL for Edge rpm-ostree based system**
Version added: 1.5.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- Compatibility layer for using the "package" module for RHEL for Edge systems utilizing the RHEL System Roles.
Requirements
------------
The below requirements are needed on the host that executes this module.
- rpm-ostree
Parameters
----------
.. raw:: html
<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="1">Parameter</th>
<th>Choices/<font color="blue">Defaults</font></th>
<th width="100%">Comments</th>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>name</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
/ <span style="color: purple">elements=string</span>
</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">[]</div>
</td>
<td>
<div>A package name or package specifier with version, like <code>name-1.0</code>.</div>
<div>Comparison operators for package version are valid here <code>&gt;</code>, <code>&lt;</code>, <code>&gt;=</code>, <code>&lt;=</code>. Example - <code>name&gt;=1.0</code></div>
<div>If a previous version is specified, the task also needs to turn <code>allow_downgrade</code> on. See the <code>allow_downgrade</code> documentation for caveats with downgrading packages.</div>
<div>When using state=latest, this can be <code>&#x27;*&#x27;</code> which means run <code>yum -y update</code>.</div>
<div>You can also pass a url or a local path to a rpm file (using state=present). To operate on several packages this can accept a comma separated string of packages or (as of 2.0) a list of packages.</div>
<div style="font-size: small; color: darkgreen"><br/>aliases: pkg</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>state</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li>absent</li>
<li>installed</li>
<li>latest</li>
<li>present</li>
<li>removed</li>
</ul>
</td>
<td>
<div>Whether to install (<code>present</code> or <code>installed</code>, <code>latest</code>), or remove (<code>absent</code> or <code>removed</code>) a package.</div>
<div><code>present</code> and <code>installed</code> will simply ensure that a desired package is installed.</div>
<div><code>latest</code> will update the specified package if it&#x27;s not of the latest available version.</div>
<div><code>absent</code> and <code>removed</code> will remove the specified package.</div>
<div>Default is <code>None</code>, however in effect the default action is <code>present</code> unless the <code>autoremove</code> option is enabled for this module, then <code>absent</code> is inferred.</div>
</td>
</tr>
</table>
<br/>
Notes
-----
.. note::
- This module does not support installing or removing packages to/from an overlay as this is not supported by RHEL for Edge, packages needed should be defined in the osbuild Blueprint and provided to Image Builder at build time. This module exists only for ``package`` module compatibility.
Examples
--------
.. code-block:: yaml
- name: Ensure htop and ansible are installed on rpm-ostree based RHEL
ansible.posix.rhel_rpm_ostree:
name:
- htop
- ansible
state: present
Return Values
-------------
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
.. raw:: html
<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="1">Key</th>
<th>Returned</th>
<th width="100%">Description</th>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>msg</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>always</td>
<td>
<div>status of rpm transaction</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">No changes made.</div>
</td>
</tr>
</table>
<br/><br/>
Status
------
Authors
~~~~~~~
- Adam Miller (@maxamillion)

View file

@ -0,0 +1,175 @@
.. _ansible.posix.rpm_ostree_upgrade_module:
********************************
ansible.posix.rpm_ostree_upgrade
********************************
**Manage rpm-ostree upgrade transactions**
Version added: 1.5.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- Manage an rpm-ostree upgrade transactions.
Requirements
------------
The below requirements are needed on the host that executes this module.
- rpm-ostree
Parameters
----------
.. raw:: html
<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="1">Parameter</th>
<th>Choices/<font color="blue">Defaults</font></th>
<th width="100%">Comments</th>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>allow_downgrade</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
<li>yes</li>
</ul>
</td>
<td>
<div>Allow for the upgrade to be a chronologically older tree.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>cache_only</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
<li>yes</li>
</ul>
</td>
<td>
<div>Perform the transaction using only pre-cached data, do not download.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>os</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">""</div>
</td>
<td>
<div>The OSNAME upon which to operate.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>peer</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
<li>yes</li>
</ul>
</td>
<td>
<div>Force peer-to-peer connection instead of using a system message bus.</div>
</td>
</tr>
</table>
<br/>
Examples
--------
.. code-block:: yaml
- name: Upgrade the rpm-ostree image without options, accept all defaults
ansible.posix.rpm_ostree_upgrade:
- name: Upgrade the rpm-ostree image allowing downgrades
ansible.posix.rpm_ostree_upgrade:
allow_downgrade: true
Return Values
-------------
Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
.. raw:: html
<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="1">Key</th>
<th>Returned</th>
<th width="100%">Description</th>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>msg</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>always</td>
<td>
<div>The command standard output</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">No upgrade available.</div>
</td>
</tr>
</table>
<br/><br/>
Status
------
Authors
~~~~~~~
- Adam Miller (@maxamillion)

View file

@ -27,6 +27,7 @@ The below requirements are needed on the host that executes this module.
- libselinux-python
- libsemanage-python
- python3-libsemanage
Parameters
@ -65,7 +66,7 @@ Parameters
<b>name</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
/ <span style="color: red">required</span>
</div>
</td>
@ -91,7 +92,7 @@ Parameters
</ul>
</td>
<td>
<div>Set to <code>yes</code> if the boolean setting should survive a reboot.</div>
<div>Set to <code>true</code> if the boolean setting should survive a reboot.</div>
</td>
</tr>
<tr>
@ -129,13 +130,13 @@ Notes
Examples
--------
.. code-block:: yaml+jinja
.. code-block:: yaml
- name: Set httpd_can_network_connect flag on and keep it persistent across reboots
ansible.posix.seboolean:
name: httpd_can_network_connect
state: yes
persistent: yes
state: true
persistent: true

View file

@ -47,7 +47,7 @@ Parameters
<b>configfile</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
</div>
</td>
<td>
@ -64,13 +64,13 @@ Parameters
<b>policy</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div>The name of the SELinux policy to use (e.g. <code>targeted</code>) will be required if state is not <code>disabled</code>.</div>
<div>The name of the SELinux policy to use (e.g. <code>targeted</code>) will be required if <em>state</em> is not <code>disabled</code>.</div>
</td>
</tr>
<tr>
@ -79,7 +79,7 @@ Parameters
<b>state</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
/ <span style="color: red">required</span>
</div>
</td>
@ -94,6 +94,27 @@ Parameters
<div>The SELinux mode.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>update_kernel_param</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
<div style="font-style: italic; font-size: small; color: darkgreen">added in 1.4.0</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
<li>yes</li>
</ul>
</td>
<td>
<div>If set to <em>true</em>, will update also the kernel boot parameters when disabling/enabling SELinux.</div>
<div>The <code>grubby</code> tool must be present on the target system for this to work.</div>
</td>
</tr>
</table>
<br/>
@ -103,7 +124,7 @@ Parameters
Examples
--------
.. code-block:: yaml+jinja
.. code-block:: yaml
- name: Enable SELinux
ansible.posix.selinux:

View file

@ -113,6 +113,26 @@ Parameters
<div>Copy symlinks as the item that they point to (the referent) is copied, rather than the symlink.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>delay_updates</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
<div style="font-style: italic; font-size: small; color: darkgreen">added in 1.3.0</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li>no</li>
<li><div style="color: blue"><b>yes</b>&nbsp;&larr;</div></li>
</ul>
</td>
<td>
<div>This option puts the temporary file from each updated file into a holding directory until the end of the transfer, at which time all the files are renamed into place in rapid succession.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
@ -129,9 +149,9 @@ Parameters
</ul>
</td>
<td>
<div>Delete files in <code>dest</code> that don&#x27;t exist (after transfer, not before) in the <code>src</code> path.</div>
<div>This option requires <code>recursive=yes</code>.</div>
<div>This option ignores excluded files and behaves like the rsync opt --delete-excluded.</div>
<div>Delete files in <em>dest</em> that do not exist (after transfer, not before) in the <em>src</em> path.</div>
<div>This option requires <em>recursive=true</em>.</div>
<div>This option ignores excluded files and behaves like the rsync opt <code>--delete-after</code>.</div>
</td>
</tr>
<tr>
@ -165,7 +185,7 @@ Parameters
<td>
<div>Port number for ssh on the destination host.</div>
<div>Prior to Ansible 2.0, the ansible_ssh_port inventory var took precedence over this value.</div>
<div>This parameter defaults to the value of <code>ansible_ssh_port</code> or <code>ansible_port</code>, the <code>remote_port</code> config setting or the value from ssh client configuration if none of the former have been set.</div>
<div>This parameter defaults to the value of <code>ansible_port</code>, the <code>remote_port</code> config setting or the value from ssh client configuration if none of the former have been set.</div>
</td>
</tr>
<tr>
@ -233,6 +253,7 @@ Parameters
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
/ <span style="color: purple">elements=string</span>
</div>
</td>
<td>
@ -384,6 +405,7 @@ Parameters
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">list</span>
/ <span style="color: purple">elements=string</span>
</div>
</td>
<td>
@ -443,7 +465,7 @@ Parameters
</td>
<td>
<div>Put user@ for the remote paths.</div>
<div>If you have a custom ssh config to define the remote user for a host that does not match the inventory user, you should set this parameter to <code>no</code>.</div>
<div>If you have a custom ssh config to define the remote user for a host that does not match the inventory user, you should set this parameter to <code>false</code>.</div>
</td>
</tr>
<tr>
@ -463,6 +485,27 @@ Parameters
<div>The path can be absolute or relative.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>ssh_connection_multiplexing</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
<li>yes</li>
</ul>
</td>
<td>
<div>SSH connection multiplexing for rsync is disabled by default to prevent misconfigured ControlSockets from resulting in failed SSH connections. This is accomplished by setting the SSH <code>ControlSocket</code> to <code>none</code>.</div>
<div>Set this option to <code>true</code> to allow multiplexing and reduce SSH connection overhead.</div>
<div>Note that simply setting this option to <code>true</code> is not enough; You must also configure SSH connection multiplexing in your SSH client config by setting values for <code>ControlMaster</code>, <code>ControlPersist</code> and <code>ControlPath</code>.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
@ -499,7 +542,8 @@ Parameters
</ul>
</td>
<td>
<div>Use the ssh_args specified in ansible.cfg.</div>
<div>In Ansible 2.10 and lower, it uses the ssh_args specified in <code>ansible.cfg</code>.</div>
<div>In Ansible 2.11 and onwards, when set to <code>true</code>, it uses all SSH connection configurations like <code>ansible_ssh_args</code>, <code>ansible_ssh_common_args</code>, and <code>ansible_ssh_extra_args</code>.</div>
</td>
</tr>
<tr>
@ -542,7 +586,7 @@ Notes
- Inspect the verbose output to validate the destination user/host/path are what was expected.
- To exclude files and directories from being synchronized, you may add ``.rsync-filter`` files to the source directory.
- rsync daemon must be up and running with correct permission when using rsync protocol in source or destination path.
- The ``synchronize`` module forces `--delay-updates` to avoid leaving a destination in a broken in-between state if the underlying rsync process encounters an error. Those synchronizing large numbers of files that are willing to trade safety for performance should call rsync directly.
- The ``synchronize`` module enables `--delay-updates` by default to avoid leaving a destination in a broken in-between state if the underlying rsync process encounters an error. Those synchronizing large numbers of files that are willing to trade safety for performance should disable this option.
- link_destination is subject to the same limitations as the underlying rsync daemon. Hard links are only preserved if the relative subtrees of the source and destination are the same. Attempts to hardlink into a directory that is a subdirectory of the source will be prevented.
@ -551,8 +595,8 @@ See Also
.. seealso::
:ref:`copy_module`
The official documentation on the **copy** module.
:ref:`ansible.builtin.copy_module`
The official documentation on the **ansible.builtin.copy** module.
:ref:`community.windows.win_robocopy_module`
The official documentation on the **community.windows.win_robocopy** module.
@ -560,7 +604,7 @@ See Also
Examples
--------
.. code-block:: yaml+jinja
.. code-block:: yaml
- name: Synchronization of src on the control machine to dest on the remote hosts
ansible.posix.synchronize:
@ -595,27 +639,27 @@ Examples
ansible.posix.synchronize:
src: some/relative/path
dest: /some/absolute/path
archive: no
archive: false
- name: Synchronization with --archive options enabled except for --recursive
ansible.posix.synchronize:
src: some/relative/path
dest: /some/absolute/path
recursive: no
recursive: false
- name: Synchronization with --archive options enabled except for --times, with --checksum option enabled
ansible.posix.synchronize:
src: some/relative/path
dest: /some/absolute/path
checksum: yes
times: no
checksum: true
times: false
- name: Synchronization without --archive options enabled except use --links
ansible.posix.synchronize:
src: some/relative/path
dest: /some/absolute/path
archive: no
links: yes
archive: false
links: true
- name: Synchronization of two paths both on the control machine
ansible.posix.synchronize:
@ -645,8 +689,8 @@ Examples
ansible.posix.synchronize:
src: some/relative/path
dest: /some/absolute/path
delete: yes
recursive: yes
delete: true
recursive: true
# This specific command is granted su privileges on the destination
- name: Synchronize using an alternate rsync command
@ -678,7 +722,7 @@ Examples
# Specify the rsync binary to use on remote host and on local host
- hosts: groupofhosts
vars:
ansible_rsync_path: /usr/gnu/bin/rsync
ansible_rsync_path: /usr/gnu/bin/rsync
tasks:
- name: copy /tmp/localpath/ to remote location /tmp/remotepath

View file

@ -58,14 +58,14 @@ Parameters
<b>name</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
/ <span style="color: red">required</span>
</div>
</td>
<td>
</td>
<td>
<div>The dot-separated path (aka <em>key</em>) specifying the sysctl variable.</div>
<div>The dot-separated path (also known as <em>key</em>) specifying the sysctl variable.</div>
<div style="font-size: small; color: darkgreen"><br/>aliases: key</div>
</td>
</tr>
@ -85,7 +85,7 @@ Parameters
</ul>
</td>
<td>
<div>If <code>yes</code>, performs a <em>/sbin/sysctl -p</em> if the <code>sysctl_file</code> is updated. If <code>no</code>, does not reload <em>sysctl</em> even if the <code>sysctl_file</code> is updated.</div>
<div>If <code>true</code>, performs a <em>/sbin/sysctl -p</em> if the <code>sysctl_file</code> is updated. If <code>false</code>, does not reload <em>sysctl</em> even if the <code>sysctl_file</code> is updated.</div>
</td>
</tr>
<tr>
@ -94,7 +94,7 @@ Parameters
<b>state</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
</div>
</td>
<td>
@ -113,7 +113,7 @@ Parameters
<b>sysctl_file</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">path</span>
</div>
</td>
<td>
@ -139,7 +139,7 @@ Parameters
</ul>
</td>
<td>
<div>Verify token value with the sysctl command and set with -w if necessary</div>
<div>Verify token value with the sysctl command and set with -w if necessary.</div>
</td>
</tr>
<tr>
@ -148,7 +148,7 @@ Parameters
<b>value</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">-</span>
<span style="color: purple">string</span>
</div>
</td>
<td>
@ -167,7 +167,7 @@ Parameters
Examples
--------
.. code-block:: yaml+jinja
.. code-block:: yaml
# Set vm.swappiness to 5 in /etc/sysctl.conf
- ansible.posix.sysctl:
@ -186,21 +186,21 @@ Examples
name: kernel.panic
value: '3'
sysctl_file: /tmp/test_sysctl.conf
reload: no
reload: false
# Set ip forwarding on in /proc and verify token value with the sysctl command
- ansible.posix.sysctl:
name: net.ipv4.ip_forward
value: '1'
sysctl_set: yes
sysctl_set: true
# Set ip forwarding on in /proc and in the sysctl file and reload if necessary
- ansible.posix.sysctl:
name: net.ipv4.ip_forward
value: '1'
sysctl_set: yes
sysctl_set: true
state: present
reload: yes
reload: true
@ -212,4 +212,4 @@ Status
Authors
~~~~~~~
- David CHANIAL (@davixx) <david.chanial@gmail.com>
- David CHANIAL (@davixx)

View file

@ -1,6 +1,6 @@
namespace: ansible
name: posix
version: 1.2.0
version: 1.5.4
readme: README.md
authors:
- Ansible (github.com/ansible)

View file

@ -1,2 +1,8 @@
---
requires_ansible: '>=2.9'
plugin_routing:
callback:
skippy:
deprecation:
removal_date: '2022-06-01'
warning_text: See the plugin documentation for more details

View file

@ -21,6 +21,7 @@ import os.path
from ansible import constants as C
from ansible.module_utils.six import string_types
from ansible.module_utils.six.moves import shlex_quote
from ansible.module_utils._text import to_text
from ansible.module_utils.common._collections_compat import MutableSequence
from ansible.module_utils.parsing.convert_bool import boolean
@ -28,6 +29,11 @@ from ansible.plugins.action import ActionBase
from ansible.plugins.loader import connection_loader
DOCKER = ['docker', 'community.general.docker', 'community.docker.docker']
PODMAN = ['podman', 'ansible.builtin.podman', 'containers.podman.podman']
BUILDAH = ['buildah', 'containers.podman.buildah']
class ActionModule(ActionBase):
def _get_absolute_path(self, path):
@ -66,13 +72,12 @@ class ActionModule(ActionBase):
return path
# If using docker or buildah, do not add user information
if self._remote_transport not in ['docker', 'community.general.docker', 'community.docker.docker', 'buildah', 'containers.podman.buildah'] and user:
if self._remote_transport not in DOCKER + PODMAN + BUILDAH and user:
user_prefix = '%s@' % (user, )
if self._host_is_ipv6_address(host):
return '[%s%s]:%s' % (user_prefix, host, path)
else:
return '%s%s:%s' % (user_prefix, host, path)
return '%s%s:%s' % (user_prefix, host, path)
def _process_origin(self, host, path, user):
@ -172,12 +177,25 @@ class ActionModule(ActionBase):
# Store remote connection type
self._remote_transport = self._connection.transport
use_ssh_args = _tmp_args.pop('use_ssh_args', None)
if use_ssh_args and self._connection.transport == 'ssh':
ssh_args = [
self._connection.get_option('ssh_args'),
self._connection.get_option('ssh_common_args'),
self._connection.get_option('ssh_extra_args'),
]
_tmp_args['ssh_args'] = ' '.join([a for a in ssh_args if a])
# Handle docker connection options
if self._remote_transport in ['docker', 'community.general.docker', 'community.docker.docker']:
if self._remote_transport in DOCKER:
self._docker_cmd = self._connection.docker_cmd
if self._play_context.docker_extra_args:
self._docker_cmd = "%s %s" % (self._docker_cmd, self._play_context.docker_extra_args)
elif self._remote_transport in PODMAN:
self._docker_cmd = self._connection._options['podman_executable']
if self._connection._options.get('podman_extra_args'):
self._docker_cmd = "%s %s" % (self._docker_cmd, self._connection._options['podman_extra_args'])
# self._connection accounts for delegate_to so
# remote_transport is the transport ansible thought it would need
@ -195,8 +213,8 @@ class ActionModule(ActionBase):
# ssh paramiko docker buildah and local are fully supported transports. Anything
# else only works with delegate_to
if delegate_to is None and self._connection.transport not in \
('ssh', 'paramiko', 'local', 'docker', 'community.general.docker', 'community.docker.docker', 'buildah', 'containers.podman.buildah'):
if delegate_to is None and self._connection.transport not in [
'ssh', 'paramiko', 'local'] + DOCKER + PODMAN + BUILDAH:
result['failed'] = True
result['msg'] = (
"synchronize uses rsync to function. rsync needs to connect to the remote "
@ -205,11 +223,8 @@ class ActionModule(ActionBase):
"so it cannot work." % self._connection.transport)
return result
use_ssh_args = _tmp_args.pop('use_ssh_args', None)
# Parameter name needed by the ansible module
_tmp_args['_local_rsync_path'] = task_vars.get('ansible_rsync_path') or 'rsync'
_tmp_args['_local_rsync_password'] = task_vars.get('ansible_ssh_pass') or task_vars.get('ansible_password')
# rsync thinks that one end of the connection is localhost and the
# other is the host we're running the task for (Note: We use
@ -317,8 +332,9 @@ class ActionModule(ActionBase):
if src is None or dest is None:
return dict(failed=True, msg="synchronize requires both src and dest parameters are set")
# Determine if we need a user@
# Determine if we need a user@ and a password
user = None
password = task_vars.get('ansible_ssh_pass', None) or task_vars.get('ansible_password', None)
if not dest_is_local:
# Src and dest rsync "path" handling
if boolean(_tmp_args.get('set_remote_user', 'yes'), strict=False):
@ -328,10 +344,12 @@ class ActionModule(ActionBase):
user = task_vars.get('ansible_user') or self._play_context.remote_user
if not user:
user = C.DEFAULT_REMOTE_USER
else:
user = task_vars.get('ansible_user') or self._play_context.remote_user
if self._templar is not None:
user = self._templar.template(user)
# Private key handling
# Use the private_key parameter if passed else use context private_key_file
_tmp_args['private_key'] = _tmp_args.get('private_key', self._play_context.private_key_file)
@ -345,12 +363,17 @@ class ActionModule(ActionBase):
# src is a local path, dest is a remote path: <user>@<host>
src = self._process_origin(src_host, src, user)
dest = self._process_remote(_tmp_args, dest_host, dest, user, inv_port in localhost_ports)
password = dest_host_inventory_vars.get('ansible_ssh_pass', None) or dest_host_inventory_vars.get('ansible_password', None)
if self._templar is not None:
password = self._templar.template(password)
else:
# Still need to munge paths (to account for roles) even if we aren't
# copying files between hosts
src = self._get_absolute_path(path=src)
dest = self._get_absolute_path(path=dest)
_tmp_args['_local_rsync_password'] = password
_tmp_args['src'] = src
_tmp_args['dest'] = dest
@ -363,7 +386,7 @@ class ActionModule(ActionBase):
if not dest_is_local:
# don't escalate for docker. doing --rsync-path with docker exec fails
# and we can switch directly to the user via docker arguments
if self._play_context.become and not rsync_path and self._remote_transport not in ['docker', 'community.general.docker', 'community.docker.docker']:
if self._play_context.become and not rsync_path and self._remote_transport not in DOCKER + PODMAN:
# If no rsync_path is set, become was originally set, and dest is
# remote then add privilege escalation here.
if self._play_context.become_method == 'sudo':
@ -380,19 +403,9 @@ class ActionModule(ActionBase):
_tmp_args['rsync_path'] = rsync_path
if use_ssh_args:
ssh_args = [
getattr(self._play_context, 'ssh_args', ''),
getattr(self._play_context, 'ssh_common_args', ''),
getattr(self._play_context, 'ssh_extra_args', ''),
]
_tmp_args['ssh_args'] = ' '.join([a for a in ssh_args if a])
# If launching synchronize against docker container
# use rsync_opts to support container to override rsh options
if self._remote_transport in [
'docker', 'community.general.docker', 'community.docker.docker', 'buildah', 'containers.podman.buildah'
] and not use_delegate:
if self._remote_transport in DOCKER + BUILDAH + PODMAN and not use_delegate:
# Replicate what we do in the module argumentspec handling for lists
if not isinstance(_tmp_args.get('rsync_opts'), MutableSequence):
tmp_rsync_opts = _tmp_args.get('rsync_opts', [])
@ -405,15 +418,15 @@ class ActionModule(ActionBase):
if '--blocking-io' not in _tmp_args['rsync_opts']:
_tmp_args['rsync_opts'].append('--blocking-io')
if self._remote_transport in ['docker', 'community.general.docker', 'community.docker.docker']:
if self._remote_transport in DOCKER + PODMAN:
if become and self._play_context.become_user:
_tmp_args['rsync_opts'].append("--rsh=%s exec -u %s -i" % (self._docker_cmd, self._play_context.become_user))
_tmp_args['rsync_opts'].append('--rsh=' + shlex_quote('%s exec -u %s -i' % (self._docker_cmd, self._play_context.become_user)))
elif user is not None:
_tmp_args['rsync_opts'].append("--rsh=%s exec -u %s -i" % (self._docker_cmd, user))
_tmp_args['rsync_opts'].append('--rsh=' + shlex_quote('%s exec -u %s -i' % (self._docker_cmd, user)))
else:
_tmp_args['rsync_opts'].append("--rsh=%s exec -i" % self._docker_cmd)
elif self._remote_transport in ['buildah', 'containers.podman.buildah']:
_tmp_args['rsync_opts'].append("--rsh=buildah run --")
_tmp_args['rsync_opts'].append('--rsh=' + shlex_quote('%s exec -i' % self._docker_cmd))
elif self._remote_transport in BUILDAH:
_tmp_args['rsync_opts'].append('--rsh=' + shlex_quote('buildah run --'))
# run the module and store the result
result.update(self._execute_module('ansible.posix.synchronize', module_args=_tmp_args, task_vars=task_vars))

View file

@ -11,8 +11,8 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
'supported_by': 'community'}
DOCUMENTATION = '''
callback: cgroup_perf_recap
callback_type: aggregate
name: cgroup_perf_recap
type: aggregate
requirements:
- whitelist in configuration
- cgroups

View file

@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: debug
name: debug
type: stdout
short_description: formatted stdout/stderr display
description:

View file

@ -7,7 +7,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: json
name: json
short_description: Ansible screen output as JSON
description:
- This callback converts all events into JSON output to stdout
@ -25,6 +25,16 @@ DOCUMENTATION = '''
- key: show_custom_stats
section: defaults
type: bool
json_indent:
name: Use indenting for the JSON output
description: 'If specified, use this many spaces for indenting in the JSON output. If <= 0, write to a single line.'
default: 4
env:
- name: ANSIBLE_JSON_INDENT
ini:
- key: json_indent
section: defaults
type: integer
notes:
- When using a strategy such as free, host_pinned, or a custom strategy, host results will
be added to new task results in ``.plays[].tasks[]``. As such, there will exist duplicate
@ -61,12 +71,19 @@ class CallbackModule(CallbackBase):
self._task_map = {}
self._is_lockstep = False
self.set_options()
self._json_indent = self.get_option('json_indent')
if self._json_indent <= 0:
self._json_indent = None
def _new_play(self, play):
self._is_lockstep = play.strategy in LOCKSTEP_CALLBACKS
return {
'play': {
'name': play.get_name(),
'id': to_text(play._uuid),
'path': to_text(play.get_path()),
'duration': {
'start': current_time()
}
@ -79,6 +96,7 @@ class CallbackModule(CallbackBase):
'task': {
'name': task.get_name(),
'id': to_text(task._uuid),
'path': to_text(task.get_path()),
'duration': {
'start': current_time()
}
@ -143,7 +161,7 @@ class CallbackModule(CallbackBase):
'global_custom_stats': global_custom_stats,
}
self._display.display(json.dumps(output, cls=AnsibleJSONEncoder, indent=4, sort_keys=True))
self._display.display(json.dumps(output, cls=AnsibleJSONEncoder, indent=self._json_indent, sort_keys=True))
def _record_task_result(self, on_info, result, **kwargs):
"""This function is used as a partial to add failed/skipped info in a single method"""

214
plugins/callback/jsonl.py Normal file
View file

@ -0,0 +1,214 @@
# (c) 2016, Matt Martz <matt@sivel.net>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: jsonl
short_description: Ansible screen output as JSONL (lines in json format)
description:
- This callback converts all events into JSON output to stdout
- This callback in contrast with ansible.posix.json uses less memory, because it doesn't store results.
type: stdout
requirements:
- Set as stdout in config
options:
show_custom_stats:
name: Show custom stats
description: 'This adds the custom stats set via the set_stats plugin to the play recap'
default: False
env:
- name: ANSIBLE_SHOW_CUSTOM_STATS
ini:
- key: show_custom_stats
section: defaults
type: bool
json_indent:
name: Use indenting for the JSON output
description: 'If specified, use this many spaces for indenting in the JSON output. If not specified or <= 0, write to a single line.'
default: 0
env:
- name: ANSIBLE_JSON_INDENT
ini:
- key: json_indent
section: defaults
type: integer
notes:
- When using a strategy such as free, host_pinned, or a custom strategy, host results will
be added to new task results in ``.plays[].tasks[]``. As such, there will exist duplicate
task objects indicated by duplicate task IDs at ``.plays[].tasks[].task.id``, each with an
individual host result for the task.
'''
import datetime
import json
import copy
from functools import partial
from ansible.inventory.host import Host
from ansible.module_utils._text import to_text
from ansible.parsing.ajson import AnsibleJSONEncoder
from ansible.plugins.callback import CallbackBase
LOCKSTEP_CALLBACKS = frozenset(('linear', 'debug'))
def current_time():
return '%sZ' % datetime.datetime.utcnow().isoformat()
class CallbackModule(CallbackBase):
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = 'stdout'
CALLBACK_NAME = 'ansible.posix.jsonl'
def __init__(self, display=None):
super(CallbackModule, self).__init__(display)
self.results = []
self._task_map = {}
self._is_lockstep = False
self.set_options()
self._json_indent = self.get_option('json_indent')
if self._json_indent <= 0:
self._json_indent = None
def _new_play(self, play):
self._is_lockstep = play.strategy in LOCKSTEP_CALLBACKS
return {
'play': {
'name': play.get_name(),
'id': to_text(play._uuid),
'path': to_text(play.get_path()),
'duration': {
'start': current_time()
}
},
'tasks': []
}
def _new_task(self, task):
return {
'task': {
'name': task.get_name(),
'id': to_text(task._uuid),
'path': to_text(task.get_path()),
'duration': {
'start': current_time()
}
},
'hosts': {}
}
def _find_result_task(self, host, task):
key = (host.get_name(), task._uuid)
return self._task_map.get(
key,
self.results[-1]['tasks'][-1]
)
def v2_playbook_on_play_start(self, play):
play_result = self._new_play(play)
self.results.append(play_result)
self._write_event('v2_playbook_on_play_start', play_result)
def v2_runner_on_start(self, host, task):
if self._is_lockstep:
return
key = (host.get_name(), task._uuid)
task_result = self._new_task(task)
self._task_map[key] = task_result
self.results[-1]['tasks'].append(task_result)
self._write_event('v2_runner_on_start', task_result)
def v2_playbook_on_task_start(self, task, is_conditional):
if not self._is_lockstep:
return
task_result = self._new_task(task)
self.results[-1]['tasks'].append(task_result)
self._write_event('v2_playbook_on_task_start', task_result)
def v2_playbook_on_handler_task_start(self, task):
if not self._is_lockstep:
return
task_result = self._new_task(task)
self.results[-1]['tasks'].append(task_result)
self._write_event('v2_playbook_on_handler_task_start', task_result)
def _convert_host_to_name(self, key):
if isinstance(key, (Host,)):
return key.get_name()
return key
def v2_playbook_on_stats(self, stats):
"""Display info about playbook statistics"""
hosts = sorted(stats.processed.keys())
summary = {}
for h in hosts:
s = stats.summarize(h)
summary[h] = s
custom_stats = {}
global_custom_stats = {}
if self.get_option('show_custom_stats') and stats.custom:
custom_stats.update(dict((self._convert_host_to_name(k), v) for k, v in stats.custom.items()))
global_custom_stats.update(custom_stats.pop('_run', {}))
output = {
'stats': summary,
'custom_stats': custom_stats,
'global_custom_stats': global_custom_stats,
}
self._write_event('v2_playbook_on_stats', output)
def _write_event(self, event_name, output):
output['_event'] = event_name
output['_timestamp'] = current_time()
self._display.display(json.dumps(output, cls=AnsibleJSONEncoder, indent=self._json_indent, separators=',:', sort_keys=True))
def _record_task_result(self, event_name, on_info, result, **kwargs):
"""This function is used as a partial to add failed/skipped info in a single method"""
host = result._host
task = result._task
result_copy = result._result.copy()
result_copy.update(on_info)
result_copy['action'] = task.action
task_result = self._find_result_task(host, task)
end_time = current_time()
task_result['task']['duration']['end'] = end_time
self.results[-1]['play']['duration']['end'] = end_time
task_result_copy = copy.deepcopy(task_result)
task_result_copy['hosts'][host.name] = result_copy
if not self._is_lockstep:
key = (host.get_name(), task._uuid)
del self._task_map[key]
self._write_event(event_name, task_result_copy)
def __getattribute__(self, name):
"""Return ``_record_task_result`` partial with a dict containing skipped/failed if necessary"""
if name not in ('v2_runner_on_ok', 'v2_runner_on_failed', 'v2_runner_on_unreachable', 'v2_runner_on_skipped'):
return object.__getattribute__(self, name)
on = name.rsplit('_', 1)[1]
on_info = {}
if on in ('failed', 'skipped'):
on_info[on] = True
return partial(self._record_task_result, name, on_info)

View file

@ -7,7 +7,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: profile_roles
name: profile_roles
type: aggregate
short_description: adds timing information to roles
description:

View file

@ -10,18 +10,18 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: profile_tasks
name: profile_tasks
type: aggregate
short_description: adds time information to tasks
description:
- Ansible callback plugin for timing individual tasks and overall execution time.
- "Mashup of 2 excellent original works: https://github.com/jlafon/ansible-profile,
https://github.com/junaid18183/ansible_home/blob/master/ansible_plugins/callback_plugins/timestamp.py.old"
- "Format: C(<task start timestamp> (<length of previous task>) <current elapsed playbook execution time>)"
- "Format: C(<task start timestamp>) C(<length of previous task>) C(<current elapsed playbook execution time>)"
- It also lists the top/bottom time consuming tasks in the summary (configurable)
- Before 2.4 only the environment variables were available for configuration.
requirements:
- whitelisting in configuration - see examples section below for details.
- enable in configuration - see examples section below for details.
options:
output_limit:
description: Number of tasks to display in the summary
@ -46,7 +46,7 @@ EXAMPLES = '''
example: >
To enable, add this to your ansible.cfg file in the defaults block
[defaults]
callback_whitelist = ansible.posix.profile_tasks
callbacks_enabled=ansible.posix.profile_tasks
sample output: >
#
# TASK: [ensure messaging security group exists] ********************************
@ -92,7 +92,8 @@ def filled(msg, fchar="*"):
def timestamp(self):
if self.current is not None:
self.stats[self.current]['time'] = time.time() - self.stats[self.current]['time']
elapsed = time.time() - self.stats[self.current]['started']
self.stats[self.current]['elapsed'] += elapsed
def tasktime():
@ -151,8 +152,15 @@ class CallbackModule(CallbackBase):
timestamp(self)
# Record the start time of the current task
# stats[TASK_UUID]:
# started: Current task start time. This value will be updated each time a task
# with the same UUID is executed when `serial` is specified in a playbook.
# elapsed: Elapsed time since the first serialized task was started
self.current = task._uuid
self.stats[self.current] = {'time': time.time(), 'name': task.get_name()}
if self.current not in self.stats:
self.stats[self.current] = {'started': time.time(), 'elapsed': 0.0, 'name': task.get_name()}
else:
self.stats[self.current]['started'] = time.time()
if self._display.verbosity >= 2:
self.stats[self.current]['path'] = task.get_path()
@ -178,7 +186,7 @@ class CallbackModule(CallbackBase):
if self.sort_order is not None:
results = sorted(
self.stats.items(),
key=lambda x: x[1]['time'],
key=lambda x: x[1]['elapsed'],
reverse=self.sort_order,
)
@ -187,7 +195,7 @@ class CallbackModule(CallbackBase):
# Print the timings
for uuid, result in results:
msg = u"{0:-<{2}}{1:->9}".format(result['name'] + u' ', u' {0:.02f}s'.format(result['time']), self._display.columns - 9)
msg = u"{0:-<{2}}{1:->9}".format(result['name'] + u' ', u' {0:.02f}s'.format(result['elapsed']), self._display.columns - 9)
if 'path' in result:
msg += u"\n{0:-<{1}}".format(result['path'] + u' ', self._display.columns)
self._display.display(msg)

View file

@ -7,19 +7,19 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: skippy
callback_type: stdout
name: skippy
type: stdout
requirements:
- set as main display callback
short_description: Ansible screen output that ignores skipped status
deprecated:
why: The 'default' callback plugin now supports this functionality
removed_at_date: 2022-06-01
alternative: "'default' callback plugin with 'display_skipped_hosts = no' option"
why: The 'default' callback plugin now supports this functionality
removed_at_date: '2022-06-01'
alternative: "'default' callback plugin with 'display_skipped_hosts = no' option"
extends_documentation_fragment:
- default_callback
description:
- This callback does the same as the default except it does not output skipped host/task/item status
- This callback does the same as the default except it does not output skipped host/task/item status
'''
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default

View file

@ -6,8 +6,8 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: timer
callback_type: aggregate
name: timer
type: aggregate
requirements:
- whitelist in configuration
short_description: Adds time to play stats

View file

@ -0,0 +1,344 @@
# Vendored copy of distutils/version.py from CPython 3.9.5
#
# Implements multiple version numbering conventions for the
# Python Module Distribution Utilities.
#
# PSF License (see PSF-license.txt or https://opensource.org/licenses/Python-2.0)
#
"""Provides classes to represent module version numbers (one class for
each style of version numbering). There are currently two such classes
implemented: StrictVersion and LooseVersion.
Every version number class implements the following interface:
* the 'parse' method takes a string and parses it to some internal
representation; if the string is an invalid version number,
'parse' raises a ValueError exception
* the class constructor takes an optional string argument which,
if supplied, is passed to 'parse'
* __str__ reconstructs the string that was passed to 'parse' (or
an equivalent string -- ie. one that will generate an equivalent
version number instance)
* __repr__ generates Python code to recreate the version number instance
* _cmp compares the current instance with either another instance
of the same class or a string (which will be parsed to an instance
of the same class, thus must follow the same rules)
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import re
try:
RE_FLAGS = re.VERBOSE | re.ASCII
except AttributeError:
RE_FLAGS = re.VERBOSE
class Version:
"""Abstract base class for version numbering classes. Just provides
constructor (__init__) and reproducer (__repr__), because those
seem to be the same for all version numbering classes; and route
rich comparisons to _cmp.
"""
def __init__(self, vstring=None):
if vstring:
self.parse(vstring)
def __repr__(self):
return "%s ('%s')" % (self.__class__.__name__, str(self))
def __eq__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c == 0
def __lt__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c < 0
def __le__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c <= 0
def __gt__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c > 0
def __ge__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c >= 0
# Interface for version-number classes -- must be implemented
# by the following classes (the concrete ones -- Version should
# be treated as an abstract class).
# __init__ (string) - create and take same action as 'parse'
# (string parameter is optional)
# parse (string) - convert a string representation to whatever
# internal representation is appropriate for
# this style of version numbering
# __str__ (self) - convert back to a string; should be very similar
# (if not identical to) the string supplied to parse
# __repr__ (self) - generate Python code to recreate
# the instance
# _cmp (self, other) - compare two version numbers ('other' may
# be an unparsed version string, or another
# instance of your version class)
class StrictVersion(Version):
"""Version numbering for anal retentives and software idealists.
Implements the standard interface for version number classes as
described above. A version number consists of two or three
dot-separated numeric components, with an optional "pre-release" tag
on the end. The pre-release tag consists of the letter 'a' or 'b'
followed by a number. If the numeric components of two version
numbers are equal, then one with a pre-release tag will always
be deemed earlier (lesser) than one without.
The following are valid version numbers (shown in the order that
would be obtained by sorting according to the supplied cmp function):
0.4 0.4.0 (these two are equivalent)
0.4.1
0.5a1
0.5b3
0.5
0.9.6
1.0
1.0.4a3
1.0.4b1
1.0.4
The following are examples of invalid version numbers:
1
2.7.2.2
1.3.a4
1.3pl1
1.3c4
The rationale for this version numbering system will be explained
in the distutils documentation.
"""
version_re = re.compile(r"^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$", RE_FLAGS)
def parse(self, vstring):
match = self.version_re.match(vstring)
if not match:
raise ValueError("invalid version number '%s'" % vstring)
(major, minor, patch, prerelease, prerelease_num) = match.group(1, 2, 4, 5, 6)
if patch:
self.version = tuple(map(int, [major, minor, patch]))
else:
self.version = tuple(map(int, [major, minor])) + (0,)
if prerelease:
self.prerelease = (prerelease[0], int(prerelease_num))
else:
self.prerelease = None
def __str__(self):
if self.version[2] == 0:
vstring = ".".join(map(str, self.version[0:2]))
else:
vstring = ".".join(map(str, self.version))
if self.prerelease:
vstring = vstring + self.prerelease[0] + str(self.prerelease[1])
return vstring
def _cmp(self, other):
if isinstance(other, str):
other = StrictVersion(other)
elif not isinstance(other, StrictVersion):
return NotImplemented
if self.version != other.version:
# numeric versions don't match
# prerelease stuff doesn't matter
if self.version < other.version:
return -1
else:
return 1
# have to compare prerelease
# case 1: neither has prerelease; they're equal
# case 2: self has prerelease, other doesn't; other is greater
# case 3: self doesn't have prerelease, other does: self is greater
# case 4: both have prerelease: must compare them!
if not self.prerelease and not other.prerelease:
return 0
elif self.prerelease and not other.prerelease:
return -1
elif not self.prerelease and other.prerelease:
return 1
elif self.prerelease and other.prerelease:
if self.prerelease == other.prerelease:
return 0
elif self.prerelease < other.prerelease:
return -1
else:
return 1
else:
raise AssertionError("never get here")
# end class StrictVersion
# The rules according to Greg Stein:
# 1) a version number has 1 or more numbers separated by a period or by
# sequences of letters. If only periods, then these are compared
# left-to-right to determine an ordering.
# 2) sequences of letters are part of the tuple for comparison and are
# compared lexicographically
# 3) recognize the numeric components may have leading zeroes
#
# The LooseVersion class below implements these rules: a version number
# string is split up into a tuple of integer and string components, and
# comparison is a simple tuple comparison. This means that version
# numbers behave in a predictable and obvious way, but a way that might
# not necessarily be how people *want* version numbers to behave. There
# wouldn't be a problem if people could stick to purely numeric version
# numbers: just split on period and compare the numbers as tuples.
# However, people insist on putting letters into their version numbers;
# the most common purpose seems to be:
# - indicating a "pre-release" version
# ('alpha', 'beta', 'a', 'b', 'pre', 'p')
# - indicating a post-release patch ('p', 'pl', 'patch')
# but of course this can't cover all version number schemes, and there's
# no way to know what a programmer means without asking him.
#
# The problem is what to do with letters (and other non-numeric
# characters) in a version number. The current implementation does the
# obvious and predictable thing: keep them as strings and compare
# lexically within a tuple comparison. This has the desired effect if
# an appended letter sequence implies something "post-release":
# eg. "0.99" < "0.99pl14" < "1.0", and "5.001" < "5.001m" < "5.002".
#
# However, if letters in a version number imply a pre-release version,
# the "obvious" thing isn't correct. Eg. you would expect that
# "1.5.1" < "1.5.2a2" < "1.5.2", but under the tuple/lexical comparison
# implemented here, this just isn't so.
#
# Two possible solutions come to mind. The first is to tie the
# comparison algorithm to a particular set of semantic rules, as has
# been done in the StrictVersion class above. This works great as long
# as everyone can go along with bondage and discipline. Hopefully a
# (large) subset of Python module programmers will agree that the
# particular flavour of bondage and discipline provided by StrictVersion
# provides enough benefit to be worth using, and will submit their
# version numbering scheme to its domination. The free-thinking
# anarchists in the lot will never give in, though, and something needs
# to be done to accommodate them.
#
# Perhaps a "moderately strict" version class could be implemented that
# lets almost anything slide (syntactically), and makes some heuristic
# assumptions about non-digits in version number strings. This could
# sink into special-case-hell, though; if I was as talented and
# idiosyncratic as Larry Wall, I'd go ahead and implement a class that
# somehow knows that "1.2.1" < "1.2.2a2" < "1.2.2" < "1.2.2pl3", and is
# just as happy dealing with things like "2g6" and "1.13++". I don't
# think I'm smart enough to do it right though.
#
# In any case, I've coded the test suite for this module (see
# ../test/test_version.py) specifically to fail on things like comparing
# "1.2a2" and "1.2". That's not because the *code* is doing anything
# wrong, it's because the simple, obvious design doesn't match my
# complicated, hairy expectations for real-world version numbers. It
# would be a snap to fix the test suite to say, "Yep, LooseVersion does
# the Right Thing" (ie. the code matches the conception). But I'd rather
# have a conception that matches common notions about version numbers.
class LooseVersion(Version):
"""Version numbering for anarchists and software realists.
Implements the standard interface for version number classes as
described above. A version number consists of a series of numbers,
separated by either periods or strings of letters. When comparing
version numbers, the numeric components will be compared
numerically, and the alphabetic components lexically. The following
are all valid version numbers, in no particular order:
1.5.1
1.5.2b2
161
3.10a
8.02
3.4j
1996.07.12
3.2.pl0
3.1.1.6
2g6
11g
0.960923
2.2beta29
1.13++
5.5.kw
2.0b1pl0
In fact, there is no such thing as an invalid version number under
this scheme; the rules for comparison are simple and predictable,
but may not always give the results you want (for some definition
of "want").
"""
component_re = re.compile(r"(\d+ | [a-z]+ | \.)", re.VERBOSE)
def __init__(self, vstring=None):
if vstring:
self.parse(vstring)
def parse(self, vstring):
# I've given up on thinking I can reconstruct the version string
# from the parsed tuple -- so I just store the string here for
# use by __str__
self.vstring = vstring
components = [x for x in self.component_re.split(vstring) if x and x != "."]
for i, obj in enumerate(components):
try:
components[i] = int(obj)
except ValueError:
pass
self.version = components
def __str__(self):
return self.vstring
def __repr__(self):
return "LooseVersion ('%s')" % str(self)
def _cmp(self, other):
if isinstance(other, str):
other = LooseVersion(other)
elif not isinstance(other, LooseVersion):
return NotImplemented
if self.version == other.version:
return 0
if self.version < other.version:
return -1
if self.version > other.version:
return 1
# end class LooseVersion

View file

@ -4,11 +4,11 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
from ansible_collections.ansible.posix.plugins.module_utils.version import LooseVersion
from ansible.module_utils.basic import missing_required_lib
__metaclass__ = type
# Imports and info for sanity checking
from distutils.version import LooseVersion
FW_VERSION = None
fw = None
@ -315,6 +315,5 @@ class FirewallTransaction(object):
if import_failure:
module.fail_json(
msg='Python Module not found: firewalld and its python module are required for this module, \
version 0.2.11 or newer required (0.3.9 or newer for offline operations)'
msg=missing_required_lib('firewall') + '. Version 0.2.11 or newer required (0.3.9 or newer for offline operations)'
)

View file

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2021, Felix Fontein <felix@fontein.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""Provide version object to compare version numbers."""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# Once we drop support for Ansible 2.9, ansible-base 2.10, and ansible-core 2.11, we can
# remove the _version.py file, and replace the following import by
#
# from ansible.module_utils.compat.version import LooseVersion
from ._version import LooseVersion, StrictVersion
__all__ = ['LooseVersion', 'StrictVersion']

View file

@ -20,7 +20,7 @@ options:
description:
- The full path of the file or object.
type: path
required: yes
required: true
aliases: [ name ]
state:
description:
@ -33,17 +33,18 @@ options:
description:
- Whether to follow symlinks on the path if a symlink is encountered.
type: bool
default: yes
default: true
default:
description:
- If the target is a directory, setting this to C(yes) will make it the default ACL for entities created inside the directory.
- Setting C(default) to C(yes) causes an error if the path is a file.
- If the target is a directory, setting this to C(true) will make it the default ACL for entities created inside the directory.
- Setting C(default) to C(true) causes an error if the path is a file.
type: bool
default: no
default: false
entity:
description:
- The actual user or group that the ACL applies to when matching entity types user or group are selected.
type: str
default: ""
etype:
description:
- The entity type of the ACL to apply, see C(setfacl) documentation for more info.
@ -69,13 +70,13 @@ options:
- Incompatible with C(state=query).
- Alias C(recurse) added in version 1.3.0.
type: bool
default: no
default: false
aliases: [ recurse ]
use_nfsv4_acls:
description:
- Use NFSv4 ACLs instead of POSIX ACLs.
type: bool
default: no
default: false
recalculate_mask:
description:
- Select if and when to recalculate the effective right masks of the files.
@ -115,7 +116,7 @@ EXAMPLES = r'''
entity: joe
etype: user
permissions: rw
default: yes
default: true
state: present
- name: Same as previous but using entry shorthand

View file

@ -44,7 +44,7 @@ options:
description:
- If a matching job is present a new job will not be added.
type: bool
default: no
default: false
requirements:
- at
author:
@ -68,7 +68,7 @@ EXAMPLES = r'''
command: ls -d / >/dev/null
count: 20
units: minutes
unique: yes
unique: true
'''
import os

View file

@ -34,13 +34,13 @@ options:
manage_dir:
description:
- Whether this module should manage the directory of the authorized key file.
- If set to C(yes), the module will create the directory, as well as set the owner and permissions
- If set to C(true), the module will create the directory, as well as set the owner and permissions
of an existing directory.
- Be sure to set C(manage_dir=no) if you are using an alternate directory for authorized_keys,
- Be sure to set C(manage_dir=false) if you are using an alternate directory for authorized_keys,
as set with C(path), since you could lock yourself out of SSH access.
- See the example below.
type: bool
default: yes
default: true
state:
description:
- Whether the given key (with the given key_options) should or should not be in the file.
@ -58,15 +58,15 @@ options:
- This option is not loop aware, so if you use C(with_) , it will be exclusive per iteration of the loop.
- If you want multiple keys in the file you need to pass them all to C(key) in a single batch as mentioned above.
type: bool
default: no
default: false
validate_certs:
description:
- This only applies if using a https url as the source of the keys.
- If set to C(no), the SSL certificates will not be validated.
- This should only set to C(no) used on personally controlled sites using self-signed certificates as it avoids verifying the source site.
- Prior to 2.1 the code worked as if this was set to C(yes).
- If set to C(false), the SSL certificates will not be validated.
- This should only set to C(false) used on personally controlled sites using self-signed certificates as it avoids verifying the source site.
- Prior to 2.1 the code worked as if this was set to C(true).
type: bool
default: yes
default: true
comment:
description:
- Change the comment on the public key.
@ -77,7 +77,7 @@ options:
description:
- Follow path symlink instead of replacing it.
type: bool
default: no
default: false
author: Ansible Core Team
'''
@ -94,13 +94,19 @@ EXAMPLES = r'''
state: present
key: https://github.com/charlie.keys
- name: Set authorized keys taken from url using lookup
ansible.posix.authorized_key:
user: charlie
state: present
key: "{{ lookup('url', 'https://github.com/charlie.keys', split_lines=False) }}"
- name: Set authorized key in alternate location
ansible.posix.authorized_key:
user: charlie
state: present
key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
path: /etc/ssh/authorized_keys/charlie
manage_dir: False
manage_dir: false
- name: Set up multiple authorized keys
ansible.posix.authorized_key:
@ -123,14 +129,14 @@ EXAMPLES = r'''
user: charlie
state: present
key: https://github.com/user.keys
validate_certs: False
validate_certs: false
- name: Set authorized key, removing all the authorized keys already set
ansible.posix.authorized_key:
user: root
key: "{{ lookup('file', 'public_keys/doe-jane') }}"
state: present
exclusive: True
exclusive: true
- name: Set authorized key for user ubuntu copying it from current user
ansible.posix.authorized_key:
@ -144,7 +150,7 @@ exclusive:
description: If the key has been forced to be exclusive or not.
returned: success
type: bool
sample: False
sample: false
key:
description: The key that the module was running against.
returned: success
@ -164,7 +170,7 @@ manage_dir:
description: Whether this module managed the directory of the authorized key file.
returned: success
type: bool
sample: True
sample: true
path:
description: Alternate path to the authorized_keys file
returned: success
@ -186,7 +192,7 @@ user:
type: str
sample: user
validate_certs:
description: This only applies if using a https url as the source of the keys. If set to C(no), the SSL certificates will not be validated.
description: This only applies if using a https url as the source of the keys. If set to C(false), the SSL certificates will not be validated.
returned: success
type: bool
sample: true
@ -341,6 +347,8 @@ def keyfile(module, user, write=False, path=None, manage_dir=True, follow=False)
basedir = os.path.dirname(keysfile)
if not os.path.exists(basedir):
os.makedirs(basedir)
f = None
try:
f = open(keysfile, "w") # touches file so we can set ownership and perms
finally:

View file

@ -19,6 +19,10 @@ options:
- Name of a service to add/remove to/from firewalld.
- The service must be listed in output of firewall-cmd --get-services.
type: str
protocol:
description:
- Name of a protocol to add/remove to/from firewalld.
type: str
port:
description:
- Name of a port or port range to add/remove to/from firewalld.
@ -81,14 +85,14 @@ options:
permanent:
description:
- Should this configuration be in the running firewalld configuration or persist across reboots.
- As of Ansible 2.3, permanent operations can operate on firewalld configs when it is not running (requires firewalld >= 3.0.9).
- Note that if this is C(no), immediate is assumed C(yes).
- As of Ansible 2.3, permanent operations can operate on firewalld configs when it is not running (requires firewalld >= 0.3.9).
- Note that if this is C(false), immediate is assumed C(true).
type: bool
immediate:
description:
- Should this configuration be applied immediately, if set as permanent.
type: bool
default: no
default: false
state:
description:
- Enable or disable a setting.
@ -114,7 +118,7 @@ options:
description:
- firewalld Zone target
- If state is set to C(absent), this will reset the target to default
choices: [ default, ACCEPT, DROP, REJECT ]
choices: [ default, ACCEPT, DROP, "%%REJECT%%" ]
type: str
version_added: 1.2.0
notes:
@ -128,8 +132,11 @@ notes:
The module will not take care of this for you implicitly because that would undo any previously performed immediate actions which were not
permanent. Therefore, if you require immediate access to a newly created zone it is recommended you reload firewalld immediately after the zone
creation returns with a changed state and before you perform any other immediate, non-permanent actions on that zone.
- This module needs C(python-firewall) or C(python3-firewall) on managed nodes.
It is usually provided as a subset with C(firewalld) from the OS distributor for the OS default Python interpreter.
requirements:
- firewalld >= 0.2.11
- python-firewall >= 0.2.11
author:
- Adam Miller (@maxamillion)
'''
@ -138,29 +145,35 @@ EXAMPLES = r'''
- name: permit traffic in default zone for https service
ansible.posix.firewalld:
service: https
permanent: yes
permanent: true
state: enabled
- name: permit ospf traffic
ansible.posix.firewalld:
protocol: ospf
permanent: true
state: enabled
- name: do not permit traffic in default zone on port 8081/tcp
ansible.posix.firewalld:
port: 8081/tcp
permanent: yes
permanent: true
state: disabled
- ansible.posix.firewalld:
port: 161-162/udp
permanent: yes
permanent: true
state: enabled
- ansible.posix.firewalld:
zone: dmz
service: http
permanent: yes
permanent: true
state: enabled
- ansible.posix.firewalld:
rich_rule: rule service name="ftp" audit limit value="1/m" accept
permanent: yes
permanent: true
state: enabled
- ansible.posix.firewalld:
@ -171,48 +184,49 @@ EXAMPLES = r'''
- ansible.posix.firewalld:
zone: trusted
interface: eth2
permanent: yes
permanent: true
state: enabled
- ansible.posix.firewalld:
masquerade: yes
masquerade: true
state: enabled
permanent: yes
permanent: true
zone: dmz
- ansible.posix.firewalld:
zone: custom
state: present
permanent: yes
permanent: true
- ansible.posix.firewalld:
zone: drop
state: enabled
permanent: yes
icmp_block_inversion: yes
permanent: true
icmp_block_inversion: true
- ansible.posix.firewalld:
zone: drop
state: enabled
permanent: yes
permanent: true
icmp_block: echo-request
- ansible.posix.firewalld:
zone: internal
state: present
permanent: yes
permanent: true
target: ACCEPT
- name: Redirect port 443 to 8443 with Rich Rule
ansible.posix.firewalld:
rich_rule: rule family=ipv4 forward-port port=443 protocol=tcp to-port=8443
zone: public
permanent: yes
immediate: yes
permanent: true
immediate: true
state: enabled
'''
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.parsing.convert_bool import boolean
from ansible_collections.ansible.posix.plugins.module_utils.firewalld import FirewallTransaction, fw_offline
try:
@ -339,6 +353,47 @@ class ServiceTransaction(FirewallTransaction):
self.update_fw_settings(fw_zone, fw_settings)
class ProtocolTransaction(FirewallTransaction):
"""
ProtocolTransaction
"""
def __init__(self, module, action_args=None, zone=None, desired_state=None, permanent=False, immediate=False):
super(ProtocolTransaction, self).__init__(
module, action_args=action_args, desired_state=desired_state, zone=zone, permanent=permanent, immediate=immediate
)
def get_enabled_immediate(self, protocol, timeout):
if protocol in self.fw.getProtocols(self.zone):
return True
else:
return False
def get_enabled_permanent(self, protocol, timeout):
fw_zone, fw_settings = self.get_fw_zone_settings()
if protocol in fw_settings.getProtocols():
return True
else:
return False
def set_enabled_immediate(self, protocol, timeout):
self.fw.addProtocol(self.zone, protocol, timeout)
def set_enabled_permanent(self, protocol, timeout):
fw_zone, fw_settings = self.get_fw_zone_settings()
fw_settings.addProtocol(protocol)
self.update_fw_settings(fw_zone, fw_settings)
def set_disabled_immediate(self, protocol, timeout):
self.fw.removeProtocol(self.zone, protocol)
def set_disabled_permanent(self, protocol, timeout):
fw_zone, fw_settings = self.get_fw_zone_settings()
fw_settings.removeProtocol(protocol)
self.update_fw_settings(fw_zone, fw_settings)
class MasqueradeTransaction(FirewallTransaction):
"""
MasqueradeTransaction
@ -465,6 +520,7 @@ class InterfaceTransaction(FirewallTransaction):
old_zone_obj = self.fw.config.get_zone(zone)
if interface in old_zone_obj.interfaces:
iface_zone_objs.append(old_zone_obj)
if len(iface_zone_objs) > 1:
# Even it shouldn't happen, it's actually possible that
# the same interface is in several zone XML files
@ -474,18 +530,17 @@ class InterfaceTransaction(FirewallTransaction):
len(iface_zone_objs)
)
)
old_zone_obj = iface_zone_objs[0]
if old_zone_obj.name != self.zone:
old_zone_settings = FirewallClientZoneSettings(
self.fw.config.get_zone_config(old_zone_obj)
)
elif len(iface_zone_objs) == 1 and iface_zone_objs[0].name != self.zone:
old_zone_obj = iface_zone_objs[0]
old_zone_config = self.fw.config.get_zone_config(old_zone_obj)
old_zone_settings = FirewallClientZoneSettings(list(old_zone_config))
old_zone_settings.removeInterface(interface) # remove from old
self.fw.config.set_zone_config(
old_zone_obj,
old_zone_settings.settings
)
fw_settings.addInterface(interface) # add to new
self.fw.config.set_zone_config(fw_zone, fw_settings.settings)
fw_settings.addInterface(interface) # add to new
self.fw.config.set_zone_config(fw_zone, fw_settings.settings)
else:
old_zone_name = self.fw.config().getZoneOfInterface(interface)
if old_zone_name != self.zone:
@ -671,25 +726,33 @@ class ZoneTransaction(FirewallTransaction):
self.module.fail_json(msg=self.tx_not_permanent_error_msg)
def get_enabled_permanent(self):
zones = self.fw.config().listZones()
zone_names = [self.fw.config().getZone(z).get_property("name") for z in zones]
if self.zone in zone_names:
return True
if self.fw_offline:
zones = self.fw.config.get_zones()
zone_names = [self.fw.config.get_zone(z).name for z in zones]
else:
return False
zones = self.fw.config().listZones()
zone_names = [self.fw.config().getZone(z).get_property("name") for z in zones]
return self.zone in zone_names
def set_enabled_immediate(self):
self.module.fail_json(msg=self.tx_not_permanent_error_msg)
def set_enabled_permanent(self):
self.fw.config().addZone(self.zone, FirewallClientZoneSettings())
if self.fw_offline:
self.fw.config.new_zone(self.zone, FirewallClientZoneSettings().settings)
else:
self.fw.config().addZone(self.zone, FirewallClientZoneSettings())
def set_disabled_immediate(self):
self.module.fail_json(msg=self.tx_not_permanent_error_msg)
def set_disabled_permanent(self):
zone_obj = self.fw.config().getZoneByName(self.zone)
zone_obj.remove()
if self.fw_offline:
zone = self.fw.config.get_zone(self.zone)
self.fw.config.remove_zone(zone)
else:
zone_obj = self.fw.config().getZoneByName(self.zone)
zone_obj.remove()
class ForwardPortTransaction(FirewallTransaction):
@ -706,7 +769,7 @@ class ForwardPortTransaction(FirewallTransaction):
if self.fw_offline:
dummy, fw_settings = self.get_fw_zone_settings()
return fw_settings.queryForwardPort(port=port, protocol=proto, to_port=toport, to_addr=toaddr)
return self.fw.queryForwardPort(port=port, protocol=proto, to_port=toport, to_addr=toaddr)
return self.fw.queryForwardPort(zone=self.zone, port=port, protocol=proto, toport=toport, toaddr=toaddr)
def get_enabled_permanent(self, port, proto, toport, toaddr, timeout):
dummy, fw_settings = self.get_fw_zone_settings()
@ -736,6 +799,7 @@ def main():
icmp_block=dict(type='str'),
icmp_block_inversion=dict(type='str'),
service=dict(type='str'),
protocol=dict(type='str'),
port=dict(type='str'),
port_forward=dict(type='list', elements='dict'),
rich_rule=dict(type='str'),
@ -748,7 +812,7 @@ def main():
interface=dict(type='str'),
masquerade=dict(type='str'),
offline=dict(type='bool'),
target=dict(type='str', choices=['default', 'ACCEPT', 'DROP', 'REJECT']),
target=dict(type='str', choices=['default', 'ACCEPT', 'DROP', '%%REJECT%%']),
),
supports_check_mode=True,
required_by=dict(
@ -756,6 +820,10 @@ def main():
target=('zone',),
source=('permanent',),
),
mutually_exclusive=[
['icmp_block', 'icmp_block_inversion', 'service', 'protocol', 'port', 'port_forward', 'rich_rule',
'interface', 'masquerade', 'source', 'target']
],
)
permanent = module.params['permanent']
@ -782,20 +850,22 @@ def main():
icmp_block = module.params['icmp_block']
icmp_block_inversion = module.params['icmp_block_inversion']
service = module.params['service']
protocol = module.params['protocol']
rich_rule = module.params['rich_rule']
source = module.params['source']
zone = module.params['zone']
target = module.params['target']
port = None
if module.params['port'] is not None:
if '/' in module.params['port']:
port, protocol = module.params['port'].strip().split('/')
port, port_protocol = module.params['port'].strip().split('/')
else:
protocol = None
if not protocol:
port_protocol = None
if not port_protocol:
module.fail_json(msg='improper port format (missing protocol?)')
else:
port = None
port_protocol = None
port_forward_toaddr = ''
port_forward = None
@ -812,33 +882,11 @@ def main():
if 'toaddr' in port_forward:
port_forward_toaddr = port_forward['toaddr']
modification_count = 0
if icmp_block is not None:
modification_count += 1
if icmp_block_inversion is not None:
modification_count += 1
if service is not None:
modification_count += 1
if port is not None:
modification_count += 1
if port_forward is not None:
modification_count += 1
if rich_rule is not None:
modification_count += 1
if interface is not None:
modification_count += 1
if masquerade is not None:
modification_count += 1
if source is not None:
modification_count += 1
if target is not None:
modification_count += 1
if modification_count > 1:
module.fail_json(
msg='can only operate on port, service, rich_rule, masquerade, icmp_block, icmp_block_inversion, interface or source at once'
)
elif (modification_count > 0) and (desired_state in ['absent', 'present']) and (target is None):
modification = False
if any([icmp_block, icmp_block_inversion, service, protocol, port, port_forward, rich_rule,
interface, masquerade, source, target]):
modification = True
if modification and desired_state in ['absent', 'present'] and target is None:
module.fail_json(
msg='absent and present state can only be used in zone level operations'
)
@ -860,12 +908,21 @@ def main():
msgs.append("Changed icmp-block %s to %s" % (icmp_block, desired_state))
if icmp_block_inversion is not None:
# Type of icmp_block_inversion will be changed to boolean in a future release.
icmp_block_inversion_status = True
try:
icmp_block_inversion_status = boolean(icmp_block_inversion, True)
except TypeError:
module.warn('The value of the icmp_block_inversion option is "%s". '
'The type of the option will be changed from string to boolean in a future release. '
'To avoid unexpected behavior, please change the value to boolean.' % icmp_block_inversion)
expected_state = 'enabled' if (desired_state == 'enabled') == icmp_block_inversion_status else 'disabled'
transaction = IcmpBlockInversionTransaction(
module,
action_args=(),
zone=zone,
desired_state=desired_state,
desired_state=expected_state,
permanent=permanent,
immediate=immediate,
)
@ -891,6 +948,22 @@ def main():
if changed is True:
msgs.append("Changed service %s to %s" % (service, desired_state))
if protocol is not None:
transaction = ProtocolTransaction(
module,
action_args=(protocol, timeout),
zone=zone,
desired_state=desired_state,
permanent=permanent,
immediate=immediate,
)
changed, transaction_msgs = transaction.run()
msgs = msgs + transaction_msgs
if changed is True:
msgs.append("Changed protocol %s to %s" % (protocol, desired_state))
if source is not None:
transaction = SourceTransaction(
@ -909,7 +982,7 @@ def main():
transaction = PortTransaction(
module,
action_args=(port, protocol, timeout),
action_args=(port, port_protocol, timeout),
zone=zone,
desired_state=desired_state,
permanent=permanent,
@ -921,7 +994,7 @@ def main():
if changed is True:
msgs.append(
"Changed port %s to %s" % (
"%s/%s" % (port, protocol), desired_state
"%s/%s" % (port, port_protocol), desired_state
)
)
@ -979,12 +1052,21 @@ def main():
msgs = msgs + transaction_msgs
if masquerade is not None:
# Type of masquerade will be changed to boolean in a future release.
masquerade_status = True
try:
masquerade_status = boolean(masquerade, True)
except TypeError:
module.warn('The value of the masquerade option is "%s". '
'The type of the option will be changed from string to boolean in a future release. '
'To avoid unexpected behavior, please change the value to boolean.' % masquerade)
expected_state = 'enabled' if (desired_state == 'enabled') == masquerade_status else 'disabled'
transaction = MasqueradeTransaction(
module,
action_args=(),
zone=zone,
desired_state=desired_state,
desired_state=expected_state,
permanent=permanent,
immediate=immediate,
)
@ -1007,7 +1089,7 @@ def main():
msgs = msgs + transaction_msgs
''' If there are no changes within the zone we are operating on the zone itself '''
if modification_count == 0 and desired_state in ['absent', 'present']:
if not modification and desired_state in ['absent', 'present']:
transaction = ZoneTransaction(
module,

Some files were not shown because too many files have changed in this diff Show more