mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 15:15:26 +01:00
Compare commits
257 commits
a072f0b2ef
...
92dc532b49
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92dc532b49 | ||
|
|
6deb45c943 | ||
|
|
7af8b05105 | ||
|
|
41bbe0dcbd | ||
|
|
9dbedb6d4c | ||
|
|
26a968e1f0 | ||
|
|
a5227da4c4 | ||
|
|
fd95dcade2 | ||
|
|
19a961c118 | ||
|
|
adb459b64e | ||
|
|
d0d7f7d362 | ||
|
|
542643e786 | ||
|
|
2cde4cdb26 | ||
|
|
12a1c25f5e | ||
|
|
7062be892e | ||
|
|
20c2c30d23 | ||
|
|
4f1e6b4a6d | ||
|
|
806ab9ef9d | ||
|
|
2ed8bdc8e8 | ||
|
|
622aef2aad | ||
|
|
5165572e9e | ||
|
|
6c46a924b9 | ||
|
|
ab1bc5df9f | ||
|
|
4106ec65f9 | ||
|
|
f48515aad3 | ||
|
|
3bbf2e3cd5 | ||
|
|
ae0380d671 | ||
|
|
4f46ff218f | ||
|
|
07f1e11015 | ||
|
|
202609e425 | ||
|
|
f1b36ba1c2 | ||
|
|
0eb6a7a437 | ||
|
|
15954f8def | ||
|
|
41ce2cc8f9 | ||
|
|
b9feff586f | ||
|
|
281f957ece | ||
|
|
da1713ed3e | ||
|
|
7fb9cc95c3 | ||
|
|
3a5ba91d92 | ||
|
|
1c560e93d2 | ||
|
|
daf0b89fcb | ||
|
|
083f3aab64 | ||
|
|
9d1f67042e | ||
|
|
cddfa80d84 | ||
|
|
91a6e30d78 | ||
|
|
940d914904 | ||
|
|
b6587a783e | ||
|
|
7d069b597f | ||
|
|
38dd009615 | ||
|
|
7cf3934ef0 | ||
|
|
26c182c8ef | ||
|
|
ce24b6c746 | ||
|
|
a417ac80f0 | ||
|
|
009ed3bed5 | ||
|
|
1eb594b836 | ||
|
|
f47c5d6039 | ||
|
|
ab94cc7294 | ||
|
|
0e92d30fd3 | ||
|
|
583e4a6d6b | ||
|
|
dc7ee92827 | ||
|
|
a62acdfc5a | ||
|
|
01f19cde25 | ||
|
|
32742c3486 | ||
|
|
553b49245f | ||
|
|
84c56e1814 | ||
|
|
41d8029ef5 | ||
|
|
5eb019b2c1 | ||
|
|
94523978d2 | ||
|
|
14accca52f | ||
|
|
d64db13643 | ||
|
|
fd32da0e99 | ||
|
|
0d2ff1d2d8 | ||
|
|
2ac6fbb84b | ||
|
|
b2f053a856 | ||
|
|
a9920ae189 | ||
|
|
ee9df94762 | ||
|
|
8a07431bf8 | ||
|
|
02de0c6a76 | ||
|
|
42af89d019 | ||
|
|
8ccd0b800b | ||
|
|
727efe9fd2 | ||
|
|
bbc511dbc8 | ||
|
|
6695394af6 | ||
|
|
04b8a5f918 | ||
|
|
f109c162b0 | ||
|
|
a2ab6881db | ||
|
|
ec72fdc3ab | ||
|
|
d6a997b37d | ||
|
|
d537e7ded8 | ||
|
|
bd9aa64a2b | ||
|
|
6b7dc6ee0a | ||
|
|
a831f22b83 | ||
|
|
cf8e77cf7d | ||
|
|
c4742cfa81 | ||
|
|
cc93ee8232 | ||
|
|
e97087e616 | ||
|
|
e647e147a1 | ||
|
|
9575b9be64 | ||
|
|
4229db1bbe | ||
|
|
bf0ad4aad2 | ||
|
|
0fff8fde30 | ||
|
|
adcb28f806 | ||
|
|
d0e1504f8a | ||
|
|
090706b581 | ||
|
|
e52ae8a9bc | ||
|
|
7df358d74f | ||
|
|
dcd9598e48 | ||
|
|
fc5894171d | ||
|
|
a3b8fdbf25 | ||
|
|
69228e79d2 | ||
|
|
d1fbbb7905 | ||
|
|
50f87b0d15 | ||
|
|
4512e7b1e9 | ||
|
|
297a10fec7 | ||
|
|
139e103b0f | ||
|
|
83a933772c | ||
|
|
6c9616291e | ||
|
|
0224e4d415 | ||
|
|
cc20deaad2 | ||
|
|
5e0a6592ca | ||
|
|
acd5a2b17e | ||
|
|
e629ae2d7c | ||
|
|
abfe36c62f | ||
|
|
6c0b91a3ee | ||
|
|
f7fac90009 | ||
|
|
c4be75114b | ||
|
|
6da0cbb3d3 | ||
|
|
17fc3bcce6 | ||
|
|
d7c7d1d2c8 | ||
|
|
b8ed919011 | ||
|
|
04089e80fb | ||
|
|
55bd196e82 | ||
|
|
f451f2211b | ||
|
|
18c847a8a0 | ||
|
|
ee65205607 | ||
|
|
2c9c3a0f54 | ||
|
|
c1f830f3df | ||
|
|
2d3f55caa7 | ||
|
|
ab3bf45c6c | ||
|
|
00a22a525c | ||
|
|
eebfff4eb8 | ||
|
|
2ee9cc533a | ||
|
|
6d5145e285 | ||
|
|
45519c68be | ||
|
|
33f2ef8f11 | ||
|
|
dc4da60aff | ||
|
|
c520b68276 | ||
|
|
3ab812953f | ||
|
|
0e71c0e530 | ||
|
|
04fdbffca1 | ||
|
|
def5d2bae0 | ||
|
|
aecf81a23b | ||
|
|
373250a0ce | ||
|
|
62d060a173 | ||
|
|
b5247a27d4 | ||
|
|
792714f598 | ||
|
|
b886d7691f | ||
|
|
a383c6b27c | ||
|
|
ac611b801f | ||
|
|
68e7ddb7a7 | ||
|
|
cbd915c8ea | ||
|
|
3acced944b | ||
|
|
90cdaf873d | ||
|
|
44a23e363b | ||
|
|
a45448bb26 | ||
|
|
95785bbbbd | ||
|
|
43ead73934 | ||
|
|
16436f4f55 | ||
|
|
cd04f5a092 | ||
|
|
a8fcc028c0 | ||
|
|
667ebef95c | ||
|
|
f17fda3162 | ||
|
|
35a910a698 | ||
|
|
90385b97d8 | ||
|
|
a42d7f0420 | ||
|
|
12c00aa810 | ||
|
|
deac6a412e | ||
|
|
9525e23dc7 | ||
|
|
69a46eb0e8 | ||
|
|
36efb13c23 | ||
|
|
607b7cfcb4 | ||
|
|
af2af9cff3 | ||
|
|
40a9ff36bb | ||
|
|
2768c58f90 | ||
|
|
a15e376bb9 | ||
|
|
e366b90f39 | ||
|
|
d1be5519e6 | ||
|
|
3514f9d3dc | ||
|
|
9890937bcc | ||
|
|
8fda5f8678 | ||
|
|
399f5e2f09 | ||
|
|
1ca54d181d | ||
|
|
8f58cbb41c | ||
|
|
aaa96c2011 | ||
|
|
6ca7a7c0a4 | ||
|
|
4304552677 | ||
|
|
b09750ca7f | ||
|
|
5a2b3662cb | ||
|
|
595ee76b69 | ||
|
|
96c342fd67 | ||
|
|
53d47e1763 | ||
|
|
6e2230c1b3 | ||
|
|
f0f0b0a2e2 | ||
|
|
3d57a17ed6 | ||
|
|
610717ca76 | ||
|
|
dc8f7d68df | ||
|
|
1626c3d5e6 | ||
|
|
e396e5cb43 | ||
|
|
4a67de7b08 | ||
|
|
7f16f56c5b | ||
|
|
391d113a95 | ||
|
|
01bccb08a9 | ||
|
|
249e64a64d | ||
|
|
12941f6d9a | ||
|
|
617302ba94 | ||
|
|
ab9eaf24bc | ||
|
|
fad1d3a870 | ||
|
|
c21fb99f54 | ||
|
|
a65807edc3 | ||
|
|
dad5379461 | ||
|
|
bd594970a8 | ||
|
|
c244abd82f | ||
|
|
42d2b9c65a | ||
|
|
7a62e01af6 | ||
|
|
18614bb82d | ||
|
|
944f5416c9 | ||
|
|
ce3d0fdfa4 | ||
|
|
244c9b2066 | ||
|
|
f85f2904c9 | ||
|
|
db12a40a4c | ||
|
|
5282ece77e | ||
|
|
133ffe51fb | ||
|
|
b3e395a4a3 | ||
|
|
424004c4c0 | ||
|
|
dd2782d81c | ||
|
|
f7f5f89899 | ||
|
|
2b7a35c346 | ||
|
|
fee81b19a8 | ||
|
|
1ebacfb195 | ||
|
|
ab5c1d9911 | ||
|
|
4be66cfb34 | ||
|
|
c5d49b2a91 | ||
|
|
a03e652437 | ||
|
|
e815909859 | ||
|
|
f2601b01da | ||
|
|
27434455e5 | ||
|
|
25cfc56f6f | ||
|
|
c596feab78 | ||
|
|
049292669b | ||
|
|
310c68e6dd | ||
|
|
fcb2a466e0 | ||
|
|
757b544cf3 | ||
|
|
9f384c00a3 | ||
|
|
0118bf0cb9 | ||
|
|
553b0ea4f7 | ||
|
|
20e294e026 | ||
|
|
18469dbb3e |
151 changed files with 5090 additions and 646 deletions
|
|
@ -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:
|
||||
|
|
|
|||
135
CHANGELOG.rst
135
CHANGELOG.rst
|
|
@ -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
48
PSF-license.txt
Normal 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.
|
||||
21
README.md
21
README.md
|
|
@ -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
4
bindep.txt
Normal 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]
|
||||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
bugfixes:
|
||||
- sysctl - do not persist sysctl when value is invalid (https://github.com/ansible-collections/ansible.posix/pull/101).
|
||||
|
|
@ -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)
|
||||
|
|
@ -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)."
|
||||
|
|
@ -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).
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
minor_changes:
|
||||
- acl - add new alias ``recurse`` for ``recursive`` parameter (https://github.com/ansible-collections/ansible.posix/issues/124).
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- mount - returns ``backup_file`` value when a backup fstab is created.
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- Migrate hacking/cgroup_perf_recap_graph.py to this collection, since the cgroup_perf_recap callback lives here.
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- authorized_key - add a list of valid key types (https://github.com/ansible-collections/ansible.posix/issues/134).
|
||||
|
|
@ -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).
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- Mount - Handle remount with new options (https://github.com/ansible/ansible/issues/59460).
|
||||
|
|
@ -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).
|
||||
|
|
@ -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).
|
||||
|
|
@ -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).
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
minor_changes:
|
||||
- synchronize - add ``delay_updates`` option (https://github.com/ansible-collections/ansible.posix/issues/157).
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
bugfixes:
|
||||
- at - append line-separator to the end of the ``command`` (https://github.com/ansible-collections/ansible.posix/issues/169).
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
trivial:
|
||||
- synchronize - fix typo in ``delete`` parameter (https://github.com/ansible-collections/ansible.posix/issues/175).
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
bugfixes:
|
||||
- firewalld - ensure idempotency with firewalld 0.9.3 (https://github.com/ansible-collections/ansible.posix/issues/179).
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
bugfixes:
|
||||
- authorized_keys - Added FIDO2 security keys (https://github.com/ansible-collections/ansible.posix/issues/17).
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
trivial:
|
||||
- testing - update codecov.sh URL (https://github.com/ansible-collections/ansible.posix/pull/181).
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
bugfixes:
|
||||
- "mount - Handle ``boot`` option on Solaris correctly (https://github.com/ansible-collections/ansible.posix/issues/184)."
|
||||
|
|
@ -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).
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
trivial:
|
||||
- firewalld - specify unit for ``timeout`` parameter in docs (https://github.com/ansible-collections/ansible.posix/issues/193).
|
||||
|
|
@ -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).
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- Enabled tags in galaxy.yml (https://github.com/ansible-collections/ansible.posix/issues/18).
|
||||
|
|
@ -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).
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
bugfixes:
|
||||
- csh - define ``ECHO`` and ``COMMAND_SEP`` (https://github.com/ansible-collections/ansible.posix/issues/204).
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
trivial:
|
||||
- Make the mount module integration tests more human readable.
|
||||
|
|
@ -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)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
trivial:
|
||||
- authorized_key - Split tasks/main.yml in integration tests to each function block.
|
||||
|
|
@ -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).
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
bugfixes:
|
||||
- selinux - add missing configuration keys for /etc/selinux/config (https://github.com/ansible-collections/ansible.posix/issues/23)
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- Removed ANSIBLE_METADATA from all the modules.
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- Typecast results before use in profile_tasks callback (https://github.com/ansible/ansible/issues/69563).
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- Update EXAMPLES section in modules to use FQCN.
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- Revert "mount - Check if src exists before mounted (ansible/ansible#61752)".
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- Revert "Enable at, patch and synchronize tests (https://github.com/ansible-collections/ansible.posix/pull/5)".
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
bugfixes:
|
||||
- authorized_keys - fix inconsistent return value for check mode (https://github.com/ansible-collections/ansible.posix/issues/37)
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- Remove license key from galaxy.yml.
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- Remove sanity jobs from shippable (https://github.com/ansible-collections/ansible.posix/pull/43).
|
||||
2
changelogs/fragments/466-tests.yml
Normal file
2
changelogs/fragments/466-tests.yml
Normal 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)."
|
||||
3
changelogs/fragments/477_ci_update.yml
Normal file
3
changelogs/fragments/477_ci_update.yml
Normal 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)."
|
||||
3
changelogs/fragments/487_ci_update.yml
Normal file
3
changelogs/fragments/487_ci_update.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
trivial:
|
||||
- "Drop FreeBSD12.4 from CI for ansible-core:devel(https://github.com/ansible-collections/ansible.posix/issues/486)."
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- Update README.md (https://github.com/ansible-collections/ansible.posix/pull/4/).
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- Enable tests for at, patch and synchronize modules (https://github.com/ansible-collections/ansible.posix/pull/5).
|
||||
|
|
@ -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)
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- CI should use devel (https://github.com/ansible-collections/ansible.posix/pull/6).
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- Fix synchronize to work with renamed docker and buildah connection plugins.
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- Allow unsetting existing environment vars via environment by specifying a null value (https://github.com/ansible/ansible/pull/68236).
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
bugfixes:
|
||||
- synchronize - fix for private_key overriding in synchronize module.
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- at - add AIX support (https://github.com/ansible-collections/ansible.posix/pull/99).
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
minor_changes:
|
||||
- firewalld - add firewalld module to ansible.posix collection
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- firewalld - bring the ``target`` feature back (https://github.com/ansible-collections/ansible.posix/issues/112).
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
major_changes:
|
||||
- Bootstrap Collection (https://github.com/ansible-collections/ansible.posix/pull/1).
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- fix sanity test for various modules.
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
trivial:
|
||||
- Add sanity test ignore file for ansible version 2.12
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
minor_changes:
|
||||
- skippy - fixed the deprecation warning (by date) for skippy callback plugin
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
minor_changes:
|
||||
- synchronize - fix typo (https://github.com/ansible-collections/ansible.posix/pull/198).
|
||||
2
changelogs/fragments/test-reqs.yml
Normal file
2
changelogs/fragments/test-reqs.yml
Normal 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."
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- added 2.11 branch to test matrix, added ignore-2.12.txt.
|
||||
1
codecov.yml
Normal file
1
codecov.yml
Normal file
|
|
@ -0,0 +1 @@
|
|||
comment: false
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
526
docs/ansible.posix.firewalld_info_module.rst
Normal file
526
docs/ansible.posix.firewalld_info_module.rst
Normal 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> ←</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;">['external', 'internal']</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"> </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"> </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"> </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"> </td>
|
||||
<td class="elbow-placeholder"> </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"> </td>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </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"> </td>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </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;">['icmp', 'ipv6-icmp']</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </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"> </td>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </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;">['echo-request']</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </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;">['eth0', 'eth1']</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </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"> </td>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </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;">[['22', 'tcp'], ['80', 'tcp']]</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </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;">['icmp', 'ipv6-icmp']</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </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;">['rule protocol value="icmp" reject', 'rule priority="32767" reject']</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </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;">['dhcp', 'dns', 'ssh']</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </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;">[['30000', 'tcp'], ['30001', 'tcp']]</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </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;">['172.16.30.0/24', '172.16.31.0/24']</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </td>
|
||||
<td class="elbow-placeholder"> </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;">['foo', 'bar']</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/><br/>
|
||||
|
||||
|
||||
Status
|
||||
------
|
||||
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
- Hideki Saito (@saito-hideki)
|
||||
|
|
@ -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 >= 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 >= 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
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -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'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'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
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -84,9 +84,9 @@ Parameters
|
|||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<div>Setting to <code>yes</code> will disable patch's heuristic for transforming CRLF line endings into LF.</div>
|
||||
<div>Setting to <code>true</code> will disable patch'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 'no', the patch source file is looked up from the module'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'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:
|
||||
|
|
|
|||
103
docs/ansible.posix.rhel_facts_module.rst
Normal file
103
docs/ansible.posix.rhel_facts_module.rst
Normal 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;">{'pkg_mgr': 'ansible.posix.rhel_facts'}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/><br/>
|
||||
|
||||
|
||||
|
||||
Status
|
||||
------
|
||||
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
- Adam Miller (@maxamillion)
|
||||
156
docs/ansible.posix.rhel_rpm_ostree_module.rst
Normal file
156
docs/ansible.posix.rhel_rpm_ostree_module.rst
Normal 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>></code>, <code><</code>, <code>>=</code>, <code><=</code>. Example - <code>name>=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>'*'</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'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)
|
||||
175
docs/ansible.posix.rpm_ostree_upgrade_module.rst
Normal file
175
docs/ansible.posix.rpm_ostree_upgrade_module.rst
Normal 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> ←</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> ←</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> ←</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)
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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> ←</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:
|
||||
|
|
|
|||
|
|
@ -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> ←</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'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> ←</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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
namespace: ansible
|
||||
name: posix
|
||||
version: 1.2.0
|
||||
version: 1.5.4
|
||||
readme: README.md
|
||||
authors:
|
||||
- Ansible (github.com/ansible)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
214
plugins/callback/jsonl.py
Normal 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)
|
||||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
344
plugins/module_utils/_version.py
Normal file
344
plugins/module_utils/_version.py
Normal 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
|
||||
|
|
@ -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)'
|
||||
)
|
||||
|
|
|
|||
20
plugins/module_utils/version.py
Normal file
20
plugins/module_utils/version.py
Normal 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']
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
Loading…
Reference in a new issue