mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-04 05:04:22 -07:00
Compare commits
385 commits
Author | SHA1 | Date | |
---|---|---|---|
|
34d9809c0d | ||
|
cb26c50d65 |
||
|
67269f302d |
||
|
fd48bc38f1 |
||
|
f89102ffdc | ||
|
3d3328ecaf |
||
|
fee8278015 |
||
|
93c121d4a6 |
||
|
12a21e0517 | ||
|
7e49c825f7 |
||
|
4cce99abb5 |
||
|
5a7a3b2f5e | ||
|
d481a6b0d4 | ||
|
7a9253e68b |
||
|
7945d5afbe | ||
|
c28021b662 | ||
|
3dd39fedd2 |
||
|
6d8549f00a |
||
|
805362f337 |
||
|
c0b5119034 |
||
|
fd8a452f22 |
||
|
6d46e650b7 |
||
|
b4468bd4c7 |
||
|
e2af16b03f |
||
|
3abf169a2f |
||
|
5039265621 |
||
|
b52b754a3d |
||
|
9aef7ad67e |
||
|
0e15608149 |
||
|
844e3a581c |
||
|
3c86bb9cda | ||
|
8222f1f064 |
||
|
78e552469a | ||
|
acdf0cdc2f |
||
|
1246c3357b |
||
|
c5f939fbc5 | ||
|
666c07acee | ||
|
bcbd04a8fd |
||
|
36cb2c22a1 |
||
|
419893eb65 |
||
|
2448503e8b |
||
|
8b1a193a49 |
||
|
69bb4420d8 |
||
|
69590f55ac |
||
|
69cb9b7578 | ||
|
72e4deee9b |
||
|
f12f69d2a5 |
||
|
ff7a8f8018 |
||
|
08cfbf4f99 |
||
|
513ea79c19 | ||
|
0409f4048b |
||
|
3aa6185f09 | ||
|
9a7fb38301 | ||
|
0b33bf4e5a |
||
|
961a7cea8b |
||
|
7916877179 |
||
|
7df07f31a6 |
||
|
928cdaaf87 |
||
|
3727bf7cd4 |
||
|
845b13d5aa |
||
|
fa3e6673d0 | ||
|
84033ec80a |
||
|
3bceabce93 |
||
|
0dd960d8ab |
||
|
e1b338cf41 |
||
|
f2e8354229 |
||
|
abc435466d |
||
|
3c49c096a9 |
||
|
de754eacbc |
||
|
0ccb961ff7 |
||
|
c6429e7740 |
||
|
ba7439e657 |
||
|
013fb9c006 |
||
|
9a6bd80613 |
||
|
17d11cb587 |
||
|
933166b984 |
||
|
162add04b9 |
||
|
faaeacfaa0 |
||
|
bbf3cae316 | ||
|
53ebbe4b94 | ||
|
2674e2494d |
||
|
341f86e2bc |
||
|
dd63fb5347 |
||
|
b418b2c00d |
||
|
382c0a4af6 |
||
|
1a0a44d179 |
||
|
18e4637042 |
||
|
fb68abd6b2 | ||
|
2d5999c579 |
||
|
525ed41a0a |
||
|
4a4fe8c61f |
||
|
f9e4bc85e9 |
||
|
bde1c721e0 |
||
|
285c97e7ea | ||
|
d45a889c3f |
||
|
1e7294716e |
||
|
88c605a344 |
||
|
4a41ab583a |
||
|
5d86045048 |
||
|
2eb067e3e0 | ||
|
2ffbfef2ff | ||
|
b23eb4babd |
||
|
56a906e42b |
||
|
0361154ff3 |
||
|
d1f7752b57 |
||
|
c6e557b1ec | ||
|
ec183626e5 |
||
|
af762a4c4e | ||
|
124246b763 | ||
|
cb4b8bc3cc |
||
|
c7773afebf |
||
|
ae8015667c |
||
|
e98daa9f39 |
||
|
6f3cfd3385 |
||
|
015496fa9e |
||
|
f44697016f |
||
|
0bc4970953 |
||
|
4dd76284e9 |
||
|
a66b9fc5c9 |
||
|
87d63c5bed |
||
|
e1d229f2c5 |
||
|
7506742c38 |
||
|
c64705474d |
||
|
b8968c5c1c | ||
|
1ccfc3b821 |
||
|
595c105a29 |
||
|
e120c64a21 |
||
|
8031011497 |
||
|
961ba0ddcc |
||
|
5d094c3bf3 |
||
|
19b6f9ef3f |
||
|
3dd1c9d64a |
||
|
f9086b4680 |
||
|
861cbc29be |
||
|
3f5445274c |
||
|
f9ee387f68 |
||
|
aa3a43cfa8 |
||
|
988d760372 |
||
|
f78c1b304c |
||
|
1e3a825e16 |
||
|
34fe33163b |
||
|
396eb1d7e4 |
||
|
baef8580ec | ||
|
d8505bd8d9 | ||
|
aa0df4d81d |
||
|
c349861190 |
||
|
a853e561f1 |
||
|
1d9367ebea |
||
|
f1cf0c1949 |
||
|
5b26e09319 | ||
|
3cc5a5bc8d |
||
|
cd0818e488 |
||
|
ad197a303a |
||
|
cdbf70d781 |
||
|
c77661c184 |
||
|
d99a7974ad |
||
|
0fcd23a3f1 |
||
|
49fc40b275 |
||
|
c6c65ee554 |
||
|
d385caa73f |
||
|
2b52822043 |
||
|
9ebb5b270a | ||
|
7b9ba8d2e2 |
||
|
d33467611e | ||
|
9e0eeb0b94 | ||
|
5fd97399b0 |
||
|
eb14bd572d |
||
|
beff4063b3 |
||
|
b6cd89c677 |
||
|
9c535cb17d | ||
|
772b5b1ad3 |
||
|
e5ab4be82d |
||
|
65dd204dab |
||
|
5112994fd4 |
||
|
0d4d3f6b73 |
||
|
4a7b93df64 |
||
|
ab20c90929 |
||
|
721ea50420 | ||
|
23b646d5c2 |
||
|
1e78ff58d5 |
||
|
280a5b0e61 |
||
|
21a840eab7 |
||
|
6f98adf602 | ||
|
8c45cba53c | ||
|
9fe31235d8 |
||
|
fc7609628e |
||
|
a1d4051a12 |
||
|
acdf19c9e6 |
||
|
e2513b318e |
||
|
cc2794ad05 |
||
|
154b5f86fd |
||
|
e302058e2d |
||
|
1affd48260 |
||
|
dc5a89b040 |
||
|
71d8109275 |
||
|
73362a1e43 |
||
|
bc4fda8b14 |
||
|
2766898ea8 |
||
|
02f123877a |
||
|
d4c29e19c0 |
||
|
200ab045fa |
||
|
9b4decd831 |
||
|
566ec0a002 |
||
|
2e72051b6c |
||
|
89d33bbd7b |
||
|
76b6c8e184 |
||
|
fdc279def9 |
||
|
a471fa88b8 |
||
|
bf4e5dc3c0 |
||
|
185bdaaa39 |
||
|
55d44975dd |
||
|
43772cfbbb |
||
|
e93b6231ec | ||
|
605a557a8d |
||
|
d97f1a31ba |
||
|
5949b29a12 |
||
|
993d580adc |
||
|
1ac7783c5c |
||
|
f0724c0975 |
||
|
f3aca8a575 |
||
|
ad1cf82a34 |
||
|
42d0a55984 |
||
|
4f4d962f7c |
||
|
5343880fa5 |
||
|
5ea44edc64 |
||
|
8152cb3e1f |
||
|
eae0c4f92b |
||
|
57277e0661 |
||
|
53a941cee7 |
||
|
e6edf9cdea |
||
|
5550ba1946 |
||
|
374378beeb |
||
|
5222df306b |
||
|
788c722b3e |
||
|
2ddbda2aa7 |
||
|
cb939cbb75 |
||
|
7db1613730 |
||
|
38a16b421d |
||
|
bd8b7e3737 | ||
|
057f7196c7 | ||
|
8d8fc3d3ba |
||
|
5f7a3ac896 |
||
|
23ac1b62c3 |
||
|
186d410f63 |
||
|
1978100d25 |
||
|
6fec5a7005 |
||
|
aca2afc6f8 |
||
|
adda8d3113 |
||
|
21ed66a097 | ||
|
73a1ac2f1c |
||
|
7c3b441246 |
||
|
19613ce111 |
||
|
594ca4f983 |
||
|
af08ea33b1 |
||
|
7f729d99a2 |
||
|
5b62e0edd6 |
||
|
b935dcedd8 |
||
|
c58181bdc9 |
||
|
f71af21287 |
||
|
1a48ebd699 |
||
|
5e1be68b01 |
||
|
812431e7fe |
||
|
04f36f0bac |
||
|
2f3d3aaf76 |
||
|
e7024c3f97 |
||
|
0c2642aa2e |
||
|
2f62b6bbc6 |
||
|
5c10ed5f5c | ||
|
a4bac47520 |
||
|
b396ceb6c3 | ||
|
e4911a0278 | ||
|
1b3e9d8e99 |
||
|
6243112067 |
||
|
7d23c90c6e |
||
|
825bd81e44 |
||
|
e10f95836e |
||
|
176f6a62ae |
||
|
b1b6134f69 |
||
|
5103c3cea0 |
||
|
8444902289 |
||
|
2e1040bfa5 |
||
|
5c5ae113c9 |
||
|
1d7843465d |
||
|
b79f286a66 |
||
|
45e1d0a01a |
||
|
c7213ec1b5 |
||
|
7c9dd8d8ad |
||
|
9842b057b0 |
||
|
63eca8e68c |
||
|
569bd30148 |
||
|
70acdf1f6d |
||
|
86caa19f78 |
||
|
f9acef140f |
||
|
31a147f0eb |
||
|
9b0ebef408 |
||
|
4c734ea134 | ||
|
ccf71fb483 |
||
|
585d4e8784 |
||
|
47f235dc68 |
||
|
08200954e9 |
||
|
9e66e2c653 |
||
|
510ad54062 |
||
|
a89ca23ecc |
||
|
2261bd62de |
||
|
3726b50a92 |
||
|
037948fde9 |
||
|
9597b7c110 |
||
|
780a7c6a38 |
||
|
4c24a12462 |
||
|
990fffb563 |
||
|
1d9bfc206b |
||
|
3b74e9b646 |
||
|
37308c929b |
||
|
2945509a55 |
||
|
57be1e8be4 |
||
|
086b4e4fb8 |
||
|
92dcf1e0b2 |
||
|
78a02b84f3 | ||
|
7846cddab8 |
||
|
b0af1e9c75 |
||
|
f6349578c6 |
||
|
e4287becb1 |
||
|
005e8b151a | ||
|
cd2e55e2ab |
||
|
1ff276ec34 |
||
|
c16c4a32d1 |
||
|
3a01ceb355 |
||
|
8ca91ab283 |
||
|
c88a40d3e3 |
||
|
0dfd02c1ca |
||
|
5d9072030e |
||
|
49765f103b |
||
|
1782efb09e |
||
|
d8807e9b51 |
||
|
d823d71442 |
||
|
46d2cddbde | ||
|
069b785cb2 | ||
|
090d3f3709 |
||
|
68a9b66966 |
||
|
f96c6476fe |
||
|
fc0f677535 |
||
|
9a986473bd |
||
|
e9f0e49283 |
||
|
5eff31e760 |
||
|
39c58d5469 | ||
|
20d7be4f38 |
||
|
2d26fba0b9 |
||
|
d6168a196b |
||
|
02de81c39e |
||
|
4096b9fa5a |
||
|
fe3a3a7638 |
||
|
7cac741e77 |
||
|
f84ebed63f |
||
|
f905a1bc94 |
||
|
b0470f2e59 |
||
|
42175e38b2 |
||
|
8e79844b75 |
||
|
1338db358a |
||
|
06c4439a1c |
||
|
16d5d5fc57 |
||
|
71af3226f3 |
||
|
b3037a46be |
||
|
f7df19adbd |
||
|
3bca21aa1b |
||
|
1bb3d41e15 |
||
|
f214f206c3 |
||
|
9b8011d692 |
||
|
f227038f38 |
||
|
86a2996814 |
||
|
eb154003cf |
||
|
212871fcaf |
||
|
1795a67b8e |
||
|
a71c0af9cc | ||
|
569cde6c3e | ||
|
f0db1d1f6b |
||
|
5a36e84b86 |
||
|
a74c6db77f | ||
|
9a14980ca7 |
||
|
8c9effce1f |
||
|
51ec3594dd |
||
|
802f8ea224 |
||
|
23af148021 |
||
|
1a2c2d0a64 | ||
|
80243f8180 | ||
|
13b5c4092a |
1405 changed files with 71216 additions and 65623 deletions
|
@ -29,14 +29,14 @@ schedules:
|
|||
always: true
|
||||
branches:
|
||||
include:
|
||||
- stable-11
|
||||
- stable-10
|
||||
- stable-9
|
||||
- cron: 0 11 * * 0
|
||||
displayName: Weekly (old stable branches)
|
||||
always: true
|
||||
branches:
|
||||
include:
|
||||
- stable-9
|
||||
- stable-8
|
||||
|
||||
variables:
|
||||
- name: checkoutPath
|
||||
|
@ -51,25 +51,12 @@ variables:
|
|||
resources:
|
||||
containers:
|
||||
- container: default
|
||||
image: quay.io/ansible/azure-pipelines-test-container:7.0.0
|
||||
image: quay.io/ansible/azure-pipelines-test-container:6.0.0
|
||||
|
||||
pool: Standard
|
||||
|
||||
stages:
|
||||
### Sanity
|
||||
- stage: Sanity_devel
|
||||
displayName: Sanity devel
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Test {0}
|
||||
testFormat: devel/sanity/{0}
|
||||
targets:
|
||||
- test: 1
|
||||
- test: 2
|
||||
- test: 3
|
||||
- test: 4
|
||||
- stage: Sanity_2_19
|
||||
displayName: Sanity 2.19
|
||||
dependsOn: []
|
||||
|
@ -109,22 +96,20 @@ stages:
|
|||
- test: 2
|
||||
- test: 3
|
||||
- test: 4
|
||||
### Units
|
||||
- stage: Units_devel
|
||||
displayName: Units devel
|
||||
- stage: Sanity_2_16
|
||||
displayName: Sanity 2.16
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: devel/units/{0}/1
|
||||
nameFormat: Test {0}
|
||||
testFormat: 2.16/sanity/{0}
|
||||
targets:
|
||||
- test: 3.9
|
||||
- test: '3.10'
|
||||
- test: '3.11'
|
||||
- test: '3.12'
|
||||
- test: '3.13'
|
||||
- test: '3.14'
|
||||
- test: 1
|
||||
- test: 2
|
||||
- test: 3
|
||||
- test: 4
|
||||
### Units
|
||||
- stage: Units_2_19
|
||||
displayName: Units 2.19
|
||||
dependsOn: []
|
||||
|
@ -135,8 +120,11 @@ stages:
|
|||
testFormat: 2.19/units/{0}/1
|
||||
targets:
|
||||
- test: 3.8
|
||||
- test: "3.11"
|
||||
- test: "3.13"
|
||||
- test: 3.9
|
||||
- test: '3.10'
|
||||
- test: '3.11'
|
||||
- test: '3.12'
|
||||
- test: '3.13'
|
||||
- stage: Units_2_18
|
||||
displayName: Units 2.18
|
||||
dependsOn: []
|
||||
|
@ -147,7 +135,6 @@ stages:
|
|||
testFormat: 2.18/units/{0}/1
|
||||
targets:
|
||||
- test: 3.8
|
||||
- test: "3.11"
|
||||
- test: "3.13"
|
||||
- stage: Units_2_17
|
||||
displayName: Units 2.17
|
||||
|
@ -159,50 +146,39 @@ stages:
|
|||
testFormat: 2.17/units/{0}/1
|
||||
targets:
|
||||
- test: 3.7
|
||||
- test: "3.10"
|
||||
- test: "3.12"
|
||||
|
||||
## Remote
|
||||
- stage: Remote_devel_extra_vms
|
||||
displayName: Remote devel extra VMs
|
||||
- stage: Units_2_16
|
||||
displayName: Units 2.16
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: devel/{0}
|
||||
nameFormat: Python {0}
|
||||
testFormat: 2.16/units/{0}/1
|
||||
targets:
|
||||
- name: Alpine 3.22
|
||||
test: alpine/3.22
|
||||
# - name: Fedora 42
|
||||
# test: fedora/42
|
||||
- test: 2.7
|
||||
- test: 3.6
|
||||
- test: "3.11"
|
||||
|
||||
## Remote
|
||||
- stage: Remote_2_19_extra_vms
|
||||
displayName: Remote 2.19 extra VMs
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.19/{0}
|
||||
targets:
|
||||
- name: Alpine 3.21
|
||||
test: alpine/3.21
|
||||
# - name: Fedora 41
|
||||
# test: fedora/41
|
||||
- name: Ubuntu 22.04
|
||||
test: ubuntu/22.04
|
||||
- name: Ubuntu 24.04
|
||||
test: ubuntu/24.04
|
||||
groups:
|
||||
- vm
|
||||
- stage: Remote_devel
|
||||
displayName: Remote devel
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: devel/{0}
|
||||
targets:
|
||||
- name: macOS 15.3
|
||||
test: macos/15.3
|
||||
- name: RHEL 10.0
|
||||
test: rhel/10.0
|
||||
- name: RHEL 9.6
|
||||
test: rhel/9.6
|
||||
- name: FreeBSD 14.3
|
||||
test: freebsd/14.3
|
||||
- name: FreeBSD 13.5
|
||||
test: freebsd/13.5
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- stage: Remote_2_19
|
||||
displayName: Remote 2.19
|
||||
dependsOn: []
|
||||
|
@ -211,12 +187,16 @@ stages:
|
|||
parameters:
|
||||
testFormat: 2.19/{0}
|
||||
targets:
|
||||
- name: RHEL 9.5
|
||||
test: rhel/9.5
|
||||
- name: macOS 15.3
|
||||
test: macos/15.3
|
||||
- name: RHEL 10.0
|
||||
test: rhel/10.0
|
||||
- name: RHEL 9.5
|
||||
test: rhel/9.5
|
||||
- name: FreeBSD 14.2
|
||||
test: freebsd/14.2
|
||||
- name: FreeBSD 13.5
|
||||
test: freebsd/13.5
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
|
@ -247,36 +227,38 @@ stages:
|
|||
parameters:
|
||||
testFormat: 2.17/{0}
|
||||
targets:
|
||||
- name: FreeBSD 13.5
|
||||
test: freebsd/13.5
|
||||
- name: FreeBSD 13.3
|
||||
test: freebsd/13.3
|
||||
- name: RHEL 9.3
|
||||
test: rhel/9.3
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
|
||||
### Docker
|
||||
- stage: Docker_devel
|
||||
displayName: Docker devel
|
||||
- stage: Remote_2_16
|
||||
displayName: Remote 2.16
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: devel/linux/{0}
|
||||
testFormat: 2.16/{0}
|
||||
targets:
|
||||
- name: Fedora 42
|
||||
test: fedora42
|
||||
- name: Alpine 3.22
|
||||
test: alpine322
|
||||
- name: Ubuntu 22.04
|
||||
test: ubuntu2204
|
||||
- name: Ubuntu 24.04
|
||||
test: ubuntu2404
|
||||
- name: macOS 13.2
|
||||
test: macos/13.2
|
||||
- name: RHEL 9.2
|
||||
test: rhel/9.2
|
||||
- name: RHEL 8.8
|
||||
test: rhel/8.8
|
||||
- name: RHEL 7.9
|
||||
test: rhel/7.9
|
||||
# - name: FreeBSD 13.2
|
||||
# test: freebsd/13.2
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
|
||||
### Docker
|
||||
- stage: Docker_2_19
|
||||
displayName: Docker 2.19
|
||||
dependsOn: []
|
||||
|
@ -289,6 +271,10 @@ stages:
|
|||
test: fedora41
|
||||
- name: Alpine 3.21
|
||||
test: alpine321
|
||||
- name: Ubuntu 22.04
|
||||
test: ubuntu2204
|
||||
- name: Ubuntu 24.04
|
||||
test: ubuntu2404
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
|
@ -329,15 +315,35 @@ stages:
|
|||
- 1
|
||||
- 2
|
||||
- 3
|
||||
|
||||
### Community Docker
|
||||
- stage: Docker_community_devel
|
||||
displayName: Docker (community images) devel
|
||||
- stage: Docker_2_16
|
||||
displayName: Docker 2.16
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: devel/linux-community/{0}
|
||||
testFormat: 2.16/linux/{0}
|
||||
targets:
|
||||
- name: Fedora 38
|
||||
test: fedora38
|
||||
- name: openSUSE 15
|
||||
test: opensuse15
|
||||
- name: Alpine 3
|
||||
test: alpine3
|
||||
- name: CentOS 7
|
||||
test: centos7
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
|
||||
### Community Docker
|
||||
- stage: Docker_community_2_19
|
||||
displayName: Docker (community images) 2.19
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.19/linux-community/{0}
|
||||
targets:
|
||||
- name: Debian Bullseye
|
||||
test: debian-bullseye/3.9
|
||||
|
@ -352,18 +358,6 @@ stages:
|
|||
|
||||
### Generic
|
||||
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
|
||||
# - stage: Generic_devel
|
||||
# displayName: Generic devel
|
||||
# dependsOn: []
|
||||
# jobs:
|
||||
# - template: templates/matrix.yml
|
||||
# parameters:
|
||||
# nameFormat: Python {0}
|
||||
# testFormat: devel/generic/{0}/1
|
||||
# targets:
|
||||
# - test: '3.9'
|
||||
# - test: '3.12'
|
||||
# - test: '3.14'
|
||||
# - stage: Generic_2_19
|
||||
# displayName: Generic 2.19
|
||||
# dependsOn: []
|
||||
|
@ -373,7 +367,8 @@ stages:
|
|||
# nameFormat: Python {0}
|
||||
# testFormat: 2.19/generic/{0}/1
|
||||
# targets:
|
||||
# - test: '3.9'
|
||||
# - test: '3.8'
|
||||
# - test: '3.11'
|
||||
# - test: '3.13'
|
||||
# - stage: Generic_2_18
|
||||
# displayName: Generic 2.18
|
||||
|
@ -397,32 +392,44 @@ stages:
|
|||
# targets:
|
||||
# - test: '3.7'
|
||||
# - test: '3.12'
|
||||
# - stage: Generic_2_16
|
||||
# displayName: Generic 2.16
|
||||
# dependsOn: []
|
||||
# jobs:
|
||||
# - template: templates/matrix.yml
|
||||
# parameters:
|
||||
# nameFormat: Python {0}
|
||||
# testFormat: 2.16/generic/{0}/1
|
||||
# targets:
|
||||
# - test: '2.7'
|
||||
# - test: '3.6'
|
||||
# - test: '3.11'
|
||||
|
||||
- stage: Summary
|
||||
condition: succeededOrFailed()
|
||||
dependsOn:
|
||||
- Sanity_devel
|
||||
- Sanity_2_19
|
||||
- Sanity_2_18
|
||||
- Sanity_2_17
|
||||
- Units_devel
|
||||
- Sanity_2_16
|
||||
- Units_2_19
|
||||
- Units_2_18
|
||||
- Units_2_17
|
||||
- Remote_devel_extra_vms
|
||||
- Remote_devel
|
||||
- Units_2_16
|
||||
- Remote_2_19_extra_vms
|
||||
- Remote_2_19
|
||||
- Remote_2_18
|
||||
- Remote_2_17
|
||||
- Docker_devel
|
||||
- Remote_2_16
|
||||
- Docker_2_19
|
||||
- Docker_2_18
|
||||
- Docker_2_17
|
||||
- Docker_community_devel
|
||||
- Docker_2_16
|
||||
- Docker_community_2_19
|
||||
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
|
||||
# - Generic_devel
|
||||
# - Generic_2_19
|
||||
# - Generic_2_18
|
||||
# - Generic_2_17
|
||||
# - Generic_2_16
|
||||
jobs:
|
||||
- template: templates/coverage.yml
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
# Copyright (c) Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# YAML reformatting
|
||||
d032de3b16eed11ea3a31cd3d96d78f7c46a2ee0
|
||||
e8f965fbf8154ea177c6622da149f2ae8533bd3c
|
||||
e938ca5f20651abc160ee6aba10014013d04dcc1
|
||||
eaa5e07b2866e05b6c7b5628ca92e9cb1142d008
|
130
.github/BOTMETA.yml
vendored
130
.github/BOTMETA.yml
vendored
|
@ -61,6 +61,7 @@ files:
|
|||
$callbacks/elastic.py:
|
||||
keywords: apm observability
|
||||
maintainers: v1v
|
||||
$callbacks/hipchat.py: {}
|
||||
$callbacks/jabber.py: {}
|
||||
$callbacks/log_plays.py: {}
|
||||
$callbacks/loganalytics.py:
|
||||
|
@ -77,8 +78,6 @@ files:
|
|||
$callbacks/opentelemetry.py:
|
||||
keywords: opentelemetry observability
|
||||
maintainers: v1v
|
||||
$callbacks/print_task.py:
|
||||
maintainers: demonpig
|
||||
$callbacks/say.py:
|
||||
keywords: brew cask darwin homebrew macosx macports osx
|
||||
labels: macos say
|
||||
|
@ -92,8 +91,6 @@ files:
|
|||
maintainers: ryancurrah
|
||||
$callbacks/syslog_json.py:
|
||||
maintainers: imjoseangel
|
||||
$callbacks/tasks_only.py:
|
||||
maintainers: felixfontein
|
||||
$callbacks/timestamp.py:
|
||||
maintainers: kurokobo
|
||||
$callbacks/unixy.py:
|
||||
|
@ -120,8 +117,6 @@ files:
|
|||
$connections/saltstack.py:
|
||||
labels: saltstack
|
||||
maintainers: mscherer
|
||||
$connections/wsl.py:
|
||||
maintainers: rgl
|
||||
$connections/zone.py:
|
||||
maintainers: $team_ansible_core
|
||||
$doc_fragments/:
|
||||
|
@ -141,8 +136,6 @@ files:
|
|||
$doc_fragments/xenserver.py:
|
||||
labels: xenserver
|
||||
maintainers: bvitnik
|
||||
$filters/accumulate.py:
|
||||
maintainers: VannTen
|
||||
$filters/counter.py:
|
||||
maintainers: keilr
|
||||
$filters/crc32.py:
|
||||
|
@ -165,14 +158,6 @@ files:
|
|||
maintainers: Ajpantuso
|
||||
$filters/jc.py:
|
||||
maintainers: kellyjonbrazil
|
||||
$filters/json_diff.yml:
|
||||
maintainers: numo68
|
||||
$filters/json_patch.py:
|
||||
maintainers: numo68
|
||||
$filters/json_patch.yml:
|
||||
maintainers: numo68
|
||||
$filters/json_patch_recipe.yml:
|
||||
maintainers: numo68
|
||||
$filters/json_query.py: {}
|
||||
$filters/keep_keys.py:
|
||||
maintainers: vbotka
|
||||
|
@ -209,8 +194,6 @@ files:
|
|||
maintainers: resmo
|
||||
$filters/to_months.yml:
|
||||
maintainers: resmo
|
||||
$filters/to_prettytable.py:
|
||||
maintainers: tgadiev
|
||||
$filters/to_seconds.yml:
|
||||
maintainers: resmo
|
||||
$filters/to_time_unit.yml:
|
||||
|
@ -229,8 +212,6 @@ files:
|
|||
maintainers: opoplawski
|
||||
$inventories/gitlab_runners.py:
|
||||
maintainers: morph027
|
||||
$inventories/iocage.py:
|
||||
maintainers: vbotka
|
||||
$inventories/icinga2.py:
|
||||
maintainers: BongoEADGC6
|
||||
$inventories/linode.py:
|
||||
|
@ -246,9 +227,13 @@ files:
|
|||
keywords: opennebula dynamic inventory script
|
||||
labels: cloud opennebula
|
||||
maintainers: feldsam
|
||||
$inventories/proxmox.py:
|
||||
maintainers: $team_virt ilijamt krauthosting
|
||||
$inventories/scaleway.py:
|
||||
labels: cloud scaleway
|
||||
maintainers: $team_scaleway
|
||||
$inventories/stackpath_compute.py:
|
||||
maintainers: shayrybak
|
||||
$inventories/virtualbox.py: {}
|
||||
$inventories/xen_orchestra.py:
|
||||
maintainers: ddelnano shinuza
|
||||
|
@ -292,6 +277,9 @@ files:
|
|||
$lookups/lastpass.py: {}
|
||||
$lookups/lmdb_kv.py:
|
||||
maintainers: jpmens
|
||||
$lookups/manifold.py:
|
||||
labels: manifold
|
||||
maintainers: galanoff
|
||||
$lookups/merge_variables.py:
|
||||
maintainers: rlenferink m-a-r-k-e alpex8
|
||||
$lookups/onepass:
|
||||
|
@ -303,8 +291,6 @@ files:
|
|||
$lookups/onepassword_raw.py:
|
||||
ignore: scottsb
|
||||
maintainers: azenk
|
||||
$lookups/onepassword_ssh_key.py:
|
||||
maintainers: mohammedbabelly20
|
||||
$lookups/passwordstore.py: {}
|
||||
$lookups/random_pet.py:
|
||||
maintainers: Akasurde
|
||||
|
@ -322,12 +308,8 @@ files:
|
|||
maintainers: delineaKrehl tylerezimmerman
|
||||
$module_utils/:
|
||||
labels: module_utils
|
||||
$module_utils/android_sdkmanager.py:
|
||||
maintainers: shamilovstas
|
||||
$module_utils/btrfs.py:
|
||||
maintainers: gnfzdz
|
||||
$module_utils/cmd_runner_fmt.py:
|
||||
maintainers: russoz
|
||||
$module_utils/cmd_runner.py:
|
||||
maintainers: russoz
|
||||
$module_utils/deps.py:
|
||||
|
@ -374,13 +356,9 @@ files:
|
|||
$module_utils/oracle/oci_utils.py:
|
||||
labels: cloud
|
||||
maintainers: $team_oracle
|
||||
$module_utils/pacemaker.py:
|
||||
maintainers: munchtoast
|
||||
$module_utils/pipx.py:
|
||||
labels: pipx
|
||||
maintainers: russoz
|
||||
$module_utils/pkg_req.py:
|
||||
maintainers: russoz
|
||||
$module_utils/python_runner.py:
|
||||
maintainers: russoz
|
||||
$module_utils/puppet.py:
|
||||
|
@ -402,8 +380,6 @@ files:
|
|||
maintainers: russoz
|
||||
$module_utils/ssh.py:
|
||||
maintainers: russoz
|
||||
$module_utils/systemd.py:
|
||||
maintainers: NomakCooper
|
||||
$module_utils/storage/hpe3par/hpe3par.py:
|
||||
maintainers: farhan7500 gautamphegde
|
||||
$module_utils/utm_utils.py:
|
||||
|
@ -415,8 +391,6 @@ files:
|
|||
$module_utils/wdc_redfish_utils.py:
|
||||
labels: wdc_redfish_utils
|
||||
maintainers: $team_wdc
|
||||
$module_utils/xdg_mime.py:
|
||||
maintainers: mhalano
|
||||
$module_utils/xenserver.py:
|
||||
labels: xenserver
|
||||
maintainers: bvitnik
|
||||
|
@ -443,8 +417,6 @@ files:
|
|||
ignore: DavidWittman jiuka
|
||||
labels: alternatives
|
||||
maintainers: mulby
|
||||
$modules/android_sdk.py:
|
||||
maintainers: shamilovstas
|
||||
$modules/ansible_galaxy_install.py:
|
||||
maintainers: russoz
|
||||
$modules/apache2_mod_proxy.py:
|
||||
|
@ -500,6 +472,8 @@ files:
|
|||
maintainers: NickatEpic
|
||||
$modules/cisco_webex.py:
|
||||
maintainers: drew-russell
|
||||
$modules/clc_:
|
||||
maintainers: clc-runner
|
||||
$modules/cloud_init_data_facts.py:
|
||||
maintainers: resmo
|
||||
$modules/cloudflare_dns.py:
|
||||
|
@ -531,8 +505,6 @@ files:
|
|||
ignore: skornehl
|
||||
$modules/dconf.py:
|
||||
maintainers: azaghal
|
||||
$modules/decompress.py:
|
||||
maintainers: shamilovstas
|
||||
$modules/deploy_helper.py:
|
||||
maintainers: ramondelafuente
|
||||
$modules/dimensiondata_network.py:
|
||||
|
@ -658,6 +630,8 @@ files:
|
|||
maintainers: marns93
|
||||
$modules/hg.py:
|
||||
maintainers: yeukhon
|
||||
$modules/hipchat.py:
|
||||
maintainers: pb8226 shirou
|
||||
$modules/homebrew.py:
|
||||
ignore: ryansb
|
||||
keywords: brew cask darwin homebrew macosx macports osx
|
||||
|
@ -783,14 +757,10 @@ files:
|
|||
maintainers: brettmilford unnecessary-username juanmcasanova
|
||||
$modules/jenkins_build_info.py:
|
||||
maintainers: juanmcasanova
|
||||
$modules/jenkins_credential.py:
|
||||
maintainers: YoussefKhalidAli
|
||||
$modules/jenkins_job.py:
|
||||
maintainers: sermilrod
|
||||
$modules/jenkins_job_info.py:
|
||||
maintainers: stpierre
|
||||
$modules/jenkins_node.py:
|
||||
maintainers: phyrwork
|
||||
$modules/jenkins_plugin.py:
|
||||
maintainers: jtyr
|
||||
$modules/jenkins_script.py:
|
||||
|
@ -827,8 +797,6 @@ files:
|
|||
maintainers: fynncfchen johncant
|
||||
$modules/keycloak_clientsecret_regenerate.py:
|
||||
maintainers: fynncfchen johncant
|
||||
$modules/keycloak_component.py:
|
||||
maintainers: fivetide
|
||||
$modules/keycloak_group.py:
|
||||
maintainers: adamgoossens
|
||||
$modules/keycloak_identity_provider.py:
|
||||
|
@ -861,8 +829,6 @@ files:
|
|||
maintainers: ahussey-redhat
|
||||
$modules/kibana_plugin.py:
|
||||
maintainers: barryib
|
||||
$modules/krb_ticket.py:
|
||||
maintainers: abakanovskii
|
||||
$modules/launchd.py:
|
||||
maintainers: martinm82
|
||||
$modules/layman.py:
|
||||
|
@ -873,8 +839,6 @@ files:
|
|||
maintainers: drybjed jtyr noles
|
||||
$modules/ldap_entry.py:
|
||||
maintainers: jtyr
|
||||
$modules/ldap_inc.py:
|
||||
maintainers: pduveau
|
||||
$modules/ldap_passwd.py:
|
||||
maintainers: KellerFuchs jtyr
|
||||
$modules/ldap_search.py:
|
||||
|
@ -901,8 +865,6 @@ files:
|
|||
maintainers: nerzhul
|
||||
$modules/lvg.py:
|
||||
maintainers: abulimov
|
||||
$modules/lvm_pv.py:
|
||||
maintainers: klention
|
||||
$modules/lvg_rename.py:
|
||||
maintainers: lszomor
|
||||
$modules/lvol.py:
|
||||
|
@ -1057,9 +1019,7 @@ files:
|
|||
$modules/ovh_monthly_billing.py:
|
||||
maintainers: fraff
|
||||
$modules/pacemaker_cluster.py:
|
||||
maintainers: matbu munchtoast
|
||||
$modules/pacemaker_resource.py:
|
||||
maintainers: munchtoast
|
||||
maintainers: matbu
|
||||
$modules/packet_:
|
||||
maintainers: nurfet-becirevic t0mk
|
||||
$modules/packet_device.py:
|
||||
|
@ -1135,6 +1095,32 @@ files:
|
|||
maintainers: $team_bsd berenddeboer
|
||||
$modules/pritunl_:
|
||||
maintainers: Lowess
|
||||
$modules/profitbricks:
|
||||
maintainers: baldwinSPC
|
||||
$modules/proxmox:
|
||||
keywords: kvm libvirt proxmox qemu
|
||||
labels: proxmox virt
|
||||
maintainers: $team_virt UnderGreen krauthosting
|
||||
ignore: tleguern
|
||||
$modules/proxmox.py:
|
||||
ignore: skvidal
|
||||
maintainers: UnderGreen krauthosting
|
||||
$modules/proxmox_disk.py:
|
||||
maintainers: castorsky krauthosting
|
||||
$modules/proxmox_kvm.py:
|
||||
ignore: skvidal
|
||||
maintainers: helldorado krauthosting
|
||||
$modules/proxmox_nic.py:
|
||||
maintainers: Kogelvis krauthosting
|
||||
$modules/proxmox_node_info.py:
|
||||
maintainers: jwbernin krauthosting
|
||||
$modules/proxmox_storage_contents_info.py:
|
||||
maintainers: l00ptr krauthosting
|
||||
$modules/proxmox_tasks_info:
|
||||
maintainers: paginabianca krauthosting
|
||||
$modules/proxmox_template.py:
|
||||
ignore: skvidal
|
||||
maintainers: UnderGreen krauthosting
|
||||
$modules/pubnub_blocks.py:
|
||||
maintainers: parfeon pubnub
|
||||
$modules/pulp_repo.py:
|
||||
|
@ -1173,6 +1159,12 @@ files:
|
|||
keywords: kvm libvirt proxmox qemu
|
||||
labels: rhevm virt
|
||||
maintainers: $team_virt TimothyVandenbrande
|
||||
$modules/rhn_channel.py:
|
||||
labels: rhn_channel
|
||||
maintainers: vincentvdk alikins $team_rhn
|
||||
$modules/rhn_register.py:
|
||||
labels: rhn_register
|
||||
maintainers: jlaska $team_rhn
|
||||
$modules/rhsm_release.py:
|
||||
maintainers: seandst $team_rhsm
|
||||
$modules/rhsm_repository.py:
|
||||
|
@ -1336,12 +1328,6 @@ files:
|
|||
maintainers: precurse
|
||||
$modules/sysrc.py:
|
||||
maintainers: dlundgren
|
||||
$modules/systemd_creds_decrypt.py:
|
||||
maintainers: konstruktoid
|
||||
$modules/systemd_creds_encrypt.py:
|
||||
maintainers: konstruktoid
|
||||
$modules/systemd_info.py:
|
||||
maintainers: NomakCooper
|
||||
$modules/sysupgrade.py:
|
||||
maintainers: precurse
|
||||
$modules/taiga_issue.py:
|
||||
|
@ -1415,8 +1401,6 @@ files:
|
|||
maintainers: dinoocch the-maldridge
|
||||
$modules/xcc_:
|
||||
maintainers: panyy3 renxulei
|
||||
$modules/xdg_mime.py:
|
||||
maintainers: mhalano
|
||||
$modules/xenserver_:
|
||||
maintainers: bvitnik
|
||||
$modules/xenserver_facts.py:
|
||||
|
@ -1449,8 +1433,6 @@ files:
|
|||
maintainers: natefoo
|
||||
$modules/znode.py:
|
||||
maintainers: treyperry
|
||||
$modules/zpool.py:
|
||||
maintainers: tomhesse
|
||||
$modules/zpool_facts:
|
||||
keywords: beadm dladm illumos ipadm nexenta omnios openindiana pfexec smartos solaris sunos zfs zpool
|
||||
labels: solaris
|
||||
|
@ -1465,9 +1447,6 @@ files:
|
|||
maintainers: $team_suse
|
||||
$plugin_utils/ansible_type.py:
|
||||
maintainers: vbotka
|
||||
$modules/zypper_repository_info.py:
|
||||
labels: zypper
|
||||
maintainers: $team_suse TobiasZeuch181
|
||||
$plugin_utils/keys_filter.py:
|
||||
maintainers: vbotka
|
||||
$plugin_utils/unsafe.py:
|
||||
|
@ -1517,22 +1496,6 @@ files:
|
|||
maintainers: russoz
|
||||
docs/docsite/rst/guide_deps.rst:
|
||||
maintainers: russoz
|
||||
docs/docsite/rst/guide_iocage.rst:
|
||||
maintainers: russoz felixfontein
|
||||
docs/docsite/rst/guide_iocage_inventory.rst:
|
||||
maintainers: vbotka
|
||||
docs/docsite/rst/guide_iocage_inventory_aliases.rst:
|
||||
maintainers: vbotka
|
||||
docs/docsite/rst/guide_iocage_inventory_basics.rst:
|
||||
maintainers: vbotka
|
||||
docs/docsite/rst/guide_iocage_inventory_dhcp.rst:
|
||||
maintainers: vbotka
|
||||
docs/docsite/rst/guide_iocage_inventory_hooks.rst:
|
||||
maintainers: vbotka
|
||||
docs/docsite/rst/guide_iocage_inventory_properties.rst:
|
||||
maintainers: vbotka
|
||||
docs/docsite/rst/guide_iocage_inventory_tags.rst:
|
||||
maintainers: vbotka
|
||||
docs/docsite/rst/guide_modulehelper.rst:
|
||||
maintainers: russoz
|
||||
docs/docsite/rst/guide_online.rst:
|
||||
|
@ -1541,8 +1504,6 @@ files:
|
|||
maintainers: baldwinSPC nurfet-becirevic t0mk teebes
|
||||
docs/docsite/rst/guide_scaleway.rst:
|
||||
maintainers: $team_scaleway
|
||||
docs/docsite/rst/guide_uthelper.rst:
|
||||
maintainers: russoz
|
||||
docs/docsite/rst/guide_vardict.rst:
|
||||
maintainers: russoz
|
||||
docs/docsite/rst/test_guide.rst:
|
||||
|
@ -1594,6 +1555,7 @@ macros:
|
|||
team_oracle: manojmeda mross22 nalsaber
|
||||
team_purestorage: bannaych dnix101 genegr lionmax opslounge raekins sdodsley sile16
|
||||
team_redfish: mraineri tomasg2012 xmadsen renxulei rajeevkallur bhavya06 jyundt
|
||||
team_rhn: FlossWare alikins barnabycourt vritant
|
||||
team_rhsm: cnsnyder ptoscano
|
||||
team_scaleway: remyleone abarbare
|
||||
team_solaris: bcoca fishman jasperla jpdasma mator scathatheworm troy2914 xen0l
|
||||
|
|
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
|
@ -9,7 +9,3 @@ updates:
|
|||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
groups:
|
||||
ci:
|
||||
patterns:
|
||||
- "*"
|
||||
|
|
110
.github/workflows/ansible-test.yml
vendored
110
.github/workflows/ansible-test.yml
vendored
|
@ -7,7 +7,7 @@
|
|||
# https://github.com/marketplace/actions/ansible-test
|
||||
|
||||
name: EOL CI
|
||||
"on":
|
||||
on:
|
||||
# Run EOL CI against all pushes (direct commits, also merged PRs), Pull Requests
|
||||
push:
|
||||
branches:
|
||||
|
@ -29,7 +29,14 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
ansible:
|
||||
- '2.16'
|
||||
- '2.13'
|
||||
- '2.14'
|
||||
- '2.15'
|
||||
# Ansible-test on various stable branches does not yet work well with cgroups v2.
|
||||
# Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
|
||||
# image for these stable branches. The list of branches where this is necessary will
|
||||
# shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
|
||||
# for the latest list.
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Perform sanity testing
|
||||
|
@ -44,6 +51,11 @@ jobs:
|
|||
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools
|
||||
|
||||
units:
|
||||
# Ansible-test on various stable branches does not yet work well with cgroups v2.
|
||||
# Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
|
||||
# image for these stable branches. The list of branches where this is necessary will
|
||||
# shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
|
||||
# for the latest list.
|
||||
runs-on: ubuntu-latest
|
||||
name: EOL Units (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})
|
||||
strategy:
|
||||
|
@ -57,12 +69,20 @@ jobs:
|
|||
exclude:
|
||||
- ansible: ''
|
||||
include:
|
||||
- ansible: '2.16'
|
||||
- ansible: '2.13'
|
||||
python: '2.7'
|
||||
- ansible: '2.16'
|
||||
python: '3.6'
|
||||
- ansible: '2.16'
|
||||
python: '3.11'
|
||||
- ansible: '2.13'
|
||||
python: '3.8'
|
||||
- ansible: '2.13'
|
||||
python: '2.7'
|
||||
- ansible: '2.13'
|
||||
python: '3.8'
|
||||
- ansible: '2.14'
|
||||
python: '3.9'
|
||||
- ansible: '2.15'
|
||||
python: '3.5'
|
||||
- ansible: '2.15'
|
||||
python: '3.10'
|
||||
|
||||
steps:
|
||||
- name: >-
|
||||
|
@ -82,6 +102,11 @@ jobs:
|
|||
testing-type: units
|
||||
|
||||
integration:
|
||||
# Ansible-test on various stable branches does not yet work well with cgroups v2.
|
||||
# Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
|
||||
# image for these stable branches. The list of branches where this is necessary will
|
||||
# shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
|
||||
# for the latest list.
|
||||
runs-on: ubuntu-latest
|
||||
name: EOL I (Ⓐ${{ matrix.ansible }}+${{ matrix.docker }}+py${{ matrix.python }}:${{ matrix.target }})
|
||||
strategy:
|
||||
|
@ -98,56 +123,81 @@ jobs:
|
|||
exclude:
|
||||
- ansible: ''
|
||||
include:
|
||||
# 2.16
|
||||
# CentOS 7 does not work in GHA, that's why it's not listed here.
|
||||
- ansible: '2.16'
|
||||
docker: fedora38
|
||||
# 2.13
|
||||
- ansible: '2.13'
|
||||
docker: fedora35
|
||||
python: ''
|
||||
target: azp/posix/1/
|
||||
- ansible: '2.16'
|
||||
docker: fedora38
|
||||
- ansible: '2.13'
|
||||
docker: fedora35
|
||||
python: ''
|
||||
target: azp/posix/2/
|
||||
- ansible: '2.16'
|
||||
docker: fedora38
|
||||
- ansible: '2.13'
|
||||
docker: fedora35
|
||||
python: ''
|
||||
target: azp/posix/3/
|
||||
- ansible: '2.16'
|
||||
docker: opensuse15
|
||||
- ansible: '2.13'
|
||||
docker: opensuse15py2
|
||||
python: ''
|
||||
target: azp/posix/1/
|
||||
- ansible: '2.16'
|
||||
docker: opensuse15
|
||||
- ansible: '2.13'
|
||||
docker: opensuse15py2
|
||||
python: ''
|
||||
target: azp/posix/2/
|
||||
- ansible: '2.16'
|
||||
docker: opensuse15
|
||||
- ansible: '2.13'
|
||||
docker: opensuse15py2
|
||||
python: ''
|
||||
target: azp/posix/3/
|
||||
- ansible: '2.16'
|
||||
- ansible: '2.13'
|
||||
docker: alpine3
|
||||
python: ''
|
||||
target: azp/posix/1/
|
||||
- ansible: '2.16'
|
||||
- ansible: '2.13'
|
||||
docker: alpine3
|
||||
python: ''
|
||||
target: azp/posix/2/
|
||||
- ansible: '2.16'
|
||||
- ansible: '2.13'
|
||||
docker: alpine3
|
||||
python: ''
|
||||
target: azp/posix/3/
|
||||
# 2.14
|
||||
- ansible: '2.14'
|
||||
docker: alpine3
|
||||
python: ''
|
||||
target: azp/posix/1/
|
||||
- ansible: '2.14'
|
||||
docker: alpine3
|
||||
python: ''
|
||||
target: azp/posix/2/
|
||||
- ansible: '2.14'
|
||||
docker: alpine3
|
||||
python: ''
|
||||
target: azp/posix/3/
|
||||
# 2.15
|
||||
- ansible: '2.15'
|
||||
docker: fedora37
|
||||
python: ''
|
||||
target: azp/posix/1/
|
||||
- ansible: '2.15'
|
||||
docker: fedora37
|
||||
python: ''
|
||||
target: azp/posix/2/
|
||||
- ansible: '2.15'
|
||||
docker: fedora37
|
||||
python: ''
|
||||
target: azp/posix/3/
|
||||
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
|
||||
# - ansible: '2.16'
|
||||
# - ansible: '2.13'
|
||||
# docker: default
|
||||
# python: '2.7'
|
||||
# python: '3.9'
|
||||
# target: azp/generic/1/
|
||||
# - ansible: '2.16'
|
||||
# - ansible: '2.14'
|
||||
# docker: default
|
||||
# python: '3.6'
|
||||
# python: '3.10'
|
||||
# target: azp/generic/1/
|
||||
# - ansible: '2.16'
|
||||
# - ansible: '2.15'
|
||||
# docker: default
|
||||
# python: '3.11'
|
||||
# python: '3.9'
|
||||
# target: azp/generic/1/
|
||||
|
||||
steps:
|
||||
|
|
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
|
@ -5,7 +5,7 @@
|
|||
|
||||
name: "Code scanning - action"
|
||||
|
||||
"on":
|
||||
on:
|
||||
schedule:
|
||||
- cron: '26 19 * * 1'
|
||||
workflow_dispatch:
|
||||
|
|
52
.yamllint
52
.yamllint
|
@ -1,52 +0,0 @@
|
|||
---
|
||||
# Copyright (c) Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
extends: default
|
||||
|
||||
ignore: |
|
||||
/changelogs/
|
||||
|
||||
rules:
|
||||
line-length:
|
||||
max: 1000
|
||||
level: error
|
||||
document-start: disable
|
||||
document-end: disable
|
||||
truthy:
|
||||
level: error
|
||||
allowed-values:
|
||||
- 'true'
|
||||
- 'false'
|
||||
indentation:
|
||||
spaces: 2
|
||||
indent-sequences: true
|
||||
key-duplicates: enable
|
||||
trailing-spaces: enable
|
||||
new-line-at-end-of-file: disable
|
||||
hyphens:
|
||||
max-spaces-after: 1
|
||||
empty-lines:
|
||||
max: 2
|
||||
max-start: 0
|
||||
max-end: 0
|
||||
commas:
|
||||
max-spaces-before: 0
|
||||
min-spaces-after: 1
|
||||
max-spaces-after: 1
|
||||
colons:
|
||||
max-spaces-before: 0
|
||||
max-spaces-after: 1
|
||||
brackets:
|
||||
min-spaces-inside: 0
|
||||
max-spaces-inside: 0
|
||||
braces:
|
||||
min-spaces-inside: 0
|
||||
max-spaces-inside: 1
|
||||
octal-values:
|
||||
forbid-implicit-octal: true
|
||||
forbid-explicit-octal: true
|
||||
comments:
|
||||
min-spaces-from-content: 1
|
||||
comments-indentation: false
|
1026
CHANGELOG.md
1026
CHANGELOG.md
File diff suppressed because it is too large
Load diff
942
CHANGELOG.rst
942
CHANGELOG.rst
|
@ -1,6 +1,938 @@
|
|||
Placeholder changelog
|
||||
=====================
|
||||
===============================
|
||||
Community General Release Notes
|
||||
===============================
|
||||
|
||||
This file is a placeholder; a version-specific ``CHANGELOG-vX.rst`` will be generated during releases from fragments
|
||||
under ``changelogs/fragments``. On release branches once a release has been created, consult the branch's version-specific
|
||||
file for changes that have occurred in that branch.
|
||||
.. contents:: Topics
|
||||
|
||||
This changelog describes changes after version 8.0.0.
|
||||
|
||||
v9.5.9
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Bugfix release.
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- yaml callback plugin - adjust to latest changes in ansible-core devel (https://github.com/ansible-collections/community.general/pull/10212).
|
||||
- yaml callback plugin - when using ansible-core 2.19.0b2 or newer, uses a new utility provided by ansible-core. This allows us to remove all hacks and vendored code that was part of the plugin for ansible-core versions with Data Tagging so far (https://github.com/ansible-collections/community.general/pull/10242).
|
||||
|
||||
v9.5.8
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix release.
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- cobbler_system - fix bug with Cobbler >= 3.4.0 caused by giving more than 2 positional arguments to ``CobblerXMLRPCInterface.get_system_handle()`` (https://github.com/ansible-collections/community.general/issues/8506, https://github.com/ansible-collections/community.general/pull/10145).
|
||||
- kdeconfig - allow option values beginning with a dash (https://github.com/ansible-collections/community.general/issues/10127, https://github.com/ansible-collections/community.general/pull/10128).
|
||||
- keycloak_user_rolemapping - fix ``--diff`` mode (https://github.com/ansible-collections/community.general/issues/10067, https://github.com/ansible-collections/community.general/pull/10075).
|
||||
- pickle cache plugin - avoid extra JSON serialization with ansible-core >= 2.19 (https://github.com/ansible-collections/community.general/pull/10136).
|
||||
- rundeck_acl_policy - ensure that project ACLs are sent to the correct endpoint (https://github.com/ansible-collections/community.general/pull/10097).
|
||||
- sysrc - split the output of ``sysrc -e -a`` on the first ``=`` only (https://github.com/ansible-collections/community.general/issues/10120, https://github.com/ansible-collections/community.general/pull/10121).
|
||||
|
||||
v9.5.7
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- apache2_module - added workaround for new PHP module name, from ``php7_module`` to ``php_module`` (https://github.com/ansible-collections/community.general/pull/9951).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- dependent look plugin - make compatible with ansible-core's Data Tagging feature (https://github.com/ansible-collections/community.general/pull/9833).
|
||||
- diy callback plugin - make compatible with ansible-core's Data Tagging feature (https://github.com/ansible-collections/community.general/pull/9833).
|
||||
- github_deploy_key - check that key really exists on 422 to avoid masking other errors (https://github.com/ansible-collections/community.general/issues/6718, https://github.com/ansible-collections/community.general/pull/10011).
|
||||
- hashids and unicode_normalize filter plugins - avoid deprecated ``AnsibleFilterTypeError`` on ansible-core 2.19 (https://github.com/ansible-collections/community.general/pull/9992).
|
||||
- keycloak_authentication - fix authentification config duplication for Keycloak < 26.2.0 (https://github.com/ansible-collections/community.general/pull/9987).
|
||||
- keycloak_client - fix the idempotency regression by normalizing the Keycloak response for ``after_client`` (https://github.com/ansible-collections/community.general/issues/9905, https://github.com/ansible-collections/community.general/pull/9976).
|
||||
- proxmox inventory plugin - fix ``ansible_host`` staying empty for certain Proxmox nodes (https://github.com/ansible-collections/community.general/issues/5906, https://github.com/ansible-collections/community.general/pull/9952).
|
||||
- proxmox_disk - fail gracefully if ``storage`` is required but not provided by the user (https://github.com/ansible-collections/community.general/issues/9941, https://github.com/ansible-collections/community.general/pull/9963).
|
||||
- reveal_ansible_type filter plugin and ansible_type test plugin - make compatible with ansible-core's Data Tagging feature (https://github.com/ansible-collections/community.general/pull/9833).
|
||||
- sysrc - no longer always reporting ``changed=true`` when ``state=absent``. This fixes the method ``exists()`` (https://github.com/ansible-collections/community.general/issues/10004, https://github.com/ansible-collections/community.general/pull/10005).
|
||||
- yaml callback plugin - use ansible-core internals to avoid breakage with Data Tagging (https://github.com/ansible-collections/community.general/pull/9833).
|
||||
|
||||
Known Issues
|
||||
------------
|
||||
|
||||
- reveal_ansible_type filter plugin and ansible_type test plugin - note that ansible-core's Data Tagging feature implements new aliases, such as ``_AnsibleTaggedStr`` for ``str``, ``_AnsibleTaggedInt`` for ``int``, and ``_AnsibleTaggedFloat`` for ``float`` (https://github.com/ansible-collections/community.general/pull/9833).
|
||||
|
||||
v9.5.6
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- consul_token - fix idempotency when ``policies`` or ``roles`` are supplied by name (https://github.com/ansible-collections/community.general/issues/9841, https://github.com/ansible-collections/community.general/pull/9845).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- cloudlare_dns - handle exhausted response stream in case of HTTP errors to show nice error message to the user (https://github.com/ansible-collections/community.general/issues/9782, https://github.com/ansible-collections/community.general/pull/9818).
|
||||
- dnf_versionlock - add support for dnf5 (https://github.com/ansible-collections/community.general/issues/9556).
|
||||
- homebrew_cask - handle unusual brew version strings (https://github.com/ansible-collections/community.general/issues/8432, https://github.com/ansible-collections/community.general/pull/9881).
|
||||
- ipa_host - module revoked existing host certificates even if ``user_certificate`` was not given (https://github.com/ansible-collections/community.general/pull/9694).
|
||||
- nmcli - enable changing only the order of DNS servers or search suffixes (https://github.com/ansible-collections/community.general/issues/8724, https://github.com/ansible-collections/community.general/pull/9880).
|
||||
- proxmox_vm_info - the module no longer expects that the key ``template`` exists in a dictionary returned by Proxmox (https://github.com/ansible-collections/community.general/issues/9875, https://github.com/ansible-collections/community.general/pull/9910).
|
||||
- sudoers - display stdout and stderr raised while failed validation (https://github.com/ansible-collections/community.general/issues/9674, https://github.com/ansible-collections/community.general/pull/9871).
|
||||
|
||||
v9.5.5
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix release.
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- apache2_mod_proxy - make compatible with Python 3 (https://github.com/ansible-collections/community.general/pull/9762).
|
||||
- apache2_mod_proxy - passing the cluster's page as referer for the member's pages. This makes the module actually work again for halfway modern Apache versions. According to some comments founds on the net the referer was required since at least 2019 for some versions of Apache 2 (https://github.com/ansible-collections/community.general/pull/9762).
|
||||
- cloudflare_dns - fix crash when deleting a DNS record or when updating a record with ``solo=true`` (https://github.com/ansible-collections/community.general/issues/9652, https://github.com/ansible-collections/community.general/pull/9649).
|
||||
- elasticsearch_plugin - fix ``ERROR: D is not a recognized option`` issue when configuring proxy settings (https://github.com/ansible-collections/community.general/pull/9774, https://github.com/ansible-collections/community.general/issues/9773).
|
||||
- keycloak_client - fix and improve existing tests. The module showed a diff without actual changes, solved by improving the ``normalise_cr()`` function (https://github.com/ansible-collections/community.general/pull/9644).
|
||||
- keycloak_client - in check mode, detect whether the lists in before client (for example redirect URI list) contain items that the lists in the desired client do not contain (https://github.com/ansible-collections/community.general/pull/9739).
|
||||
- passwordstore lookup plugin - fix subkey creation even when ``create=false`` (https://github.com/ansible-collections/community.general/issues/9105, https://github.com/ansible-collections/community.general/pull/9106).
|
||||
- proxmox inventory plugin - plugin did not update cache correctly after ``meta: refresh_inventory`` (https://github.com/ansible-collections/community.general/issues/9710, https://github.com/ansible-collections/community.general/pull/9760).
|
||||
- redhat_subscription - use the "enable_content" option (when available) when
|
||||
registering using D-Bus, to ensure that subscription-manager enables the
|
||||
content on registration; this is particular important on EL 10+ and Fedora
|
||||
41+
|
||||
(https://github.com/ansible-collections/community.general/pull/9778).
|
||||
- xml - ensure file descriptor is closed (https://github.com/ansible-collections/community.general/pull/9695).
|
||||
|
||||
v9.5.4
|
||||
======
|
||||
|
||||
Security Fixes
|
||||
--------------
|
||||
|
||||
- keycloak_client - Sanitize ``saml.encryption.private.key`` so it does not show in the logs (https://github.com/ansible-collections/community.general/pull/9621).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- redhat_subscription - do not try to unsubscribe (i.e. remove subscriptions)
|
||||
when unregistering a system: newer versions of subscription-manager, as
|
||||
available in EL 10 and Fedora 41+, do not support entitlements anymore, and
|
||||
thus unsubscribing will fail
|
||||
(https://github.com/ansible-collections/community.general/pull/9578).
|
||||
|
||||
v9.5.3
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- proxmox module utils - add method ``api_task_complete`` that can wait for task completion and return error message (https://github.com/ansible-collections/community.general/pull/9256).
|
||||
|
||||
Security Fixes
|
||||
--------------
|
||||
|
||||
- keycloak_authentication - API calls did not properly set the ``priority`` during update resulting in incorrectly sorted authentication flows. This apparently only affects Keycloak 25 or newer (https://github.com/ansible-collections/community.general/pull/9263).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- dig lookup plugin - correctly handle ``NoNameserver`` exception (https://github.com/ansible-collections/community.general/pull/9363, https://github.com/ansible-collections/community.general/issues/9362).
|
||||
- htpasswd - report changes when file permissions are adjusted (https://github.com/ansible-collections/community.general/issues/9485, https://github.com/ansible-collections/community.general/pull/9490).
|
||||
- proxmox_disk - fix async method and make ``resize_disk`` method handle errors correctly (https://github.com/ansible-collections/community.general/pull/9256).
|
||||
- proxmox_template - fix the wrong path called on ``proxmox_template.task_status`` (https://github.com/ansible-collections/community.general/issues/9276, https://github.com/ansible-collections/community.general/pull/9277).
|
||||
- qubes connection plugin - fix the printing of debug information (https://github.com/ansible-collections/community.general/pull/9334).
|
||||
- redfish_utils module utils - Fix ``VerifyBiosAttributes`` command on multi system resource nodes (https://github.com/ansible-collections/community.general/pull/9234).
|
||||
|
||||
v9.5.2
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- proxmox inventory plugin - fix urllib3 ``InsecureRequestWarnings`` not being suppressed when a token is used (https://github.com/ansible-collections/community.general/pull/9099).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- dnf_config_manager - fix hanging when prompting to import GPG keys (https://github.com/ansible-collections/community.general/pull/9124, https://github.com/ansible-collections/community.general/issues/8830).
|
||||
- dnf_config_manager - forces locale to ``C`` before module starts. If the locale was set to non-English, the output of the ``dnf config-manager`` could not be parsed (https://github.com/ansible-collections/community.general/pull/9157, https://github.com/ansible-collections/community.general/issues/9046).
|
||||
- flatpak - force the locale language to ``C`` when running the flatpak command (https://github.com/ansible-collections/community.general/pull/9187, https://github.com/ansible-collections/community.general/issues/8883).
|
||||
- github_key - in check mode, a faulty call to ```datetime.strftime(...)``` was being made which generated an exception (https://github.com/ansible-collections/community.general/issues/9185).
|
||||
- homebrew_cask - allow ``+`` symbol in Homebrew cask name validation regex (https://github.com/ansible-collections/community.general/pull/9128).
|
||||
- keycloak_client - fix diff by removing code that turns the attributes dict which contains additional settings into a list (https://github.com/ansible-collections/community.general/pull/9077).
|
||||
- keycloak_clientscope - fix diff and ``end_state`` by removing the code that turns the attributes dict, which contains additional config items, into a list (https://github.com/ansible-collections/community.general/pull/9082).
|
||||
- keycloak_clientscope_type - sort the default and optional clientscope lists to improve the diff (https://github.com/ansible-collections/community.general/pull/9202).
|
||||
- redfish_utils module utils - remove undocumented default applytime (https://github.com/ansible-collections/community.general/pull/9114).
|
||||
- slack - fail if Slack API response is not OK with error message (https://github.com/ansible-collections/community.general/pull/9198).
|
||||
|
||||
v9.5.1
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- redfish_utils module utils - schedule a BIOS configuration job at next reboot when the BIOS config is changed (https://github.com/ansible-collections/community.general/pull/9012).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- bitwarden lookup plugin - support BWS v0.3.0 syntax breaking change (https://github.com/ansible-collections/community.general/pull/9028).
|
||||
- collection_version lookup plugin - use ``importlib`` directly instead of the deprecated and in ansible-core 2.19 removed ``ansible.module_utils.compat.importlib`` (https://github.com/ansible-collections/community.general/pull/9084).
|
||||
- gitlab_label - update label's color (https://github.com/ansible-collections/community.general/pull/9010).
|
||||
- keycloak_clientscope_type - fix detect changes in check mode (https://github.com/ansible-collections/community.general/issues/9092, https://github.com/ansible-collections/community.general/pull/9093).
|
||||
- keycloak_group - fix crash caused in subgroup creation. The crash was caused by a missing or empty ``subGroups`` property in Keycloak ≥23 (https://github.com/ansible-collections/community.general/issues/8788, https://github.com/ansible-collections/community.general/pull/8979).
|
||||
- modprobe - fix check mode not being honored for ``persistent`` option (https://github.com/ansible-collections/community.general/issues/9051, https://github.com/ansible-collections/community.general/pull/9052).
|
||||
- one_host - fix if statements for cases when ``ID=0`` (https://github.com/ansible-collections/community.general/issues/1199, https://github.com/ansible-collections/community.general/pull/8907).
|
||||
- one_image - fix module failing due to a class method typo (https://github.com/ansible-collections/community.general/pull/9056).
|
||||
- one_image_info - fix module failing due to a class method typo (https://github.com/ansible-collections/community.general/pull/9056).
|
||||
- one_vnet - fix module failing due to a variable typo (https://github.com/ansible-collections/community.general/pull/9019).
|
||||
- redfish_utils module utils - fix issue with URI parsing to gracefully handling trailing slashes when extracting member identifiers (https://github.com/ansible-collections/community.general/issues/9047, https://github.com/ansible-collections/community.general/pull/9057).
|
||||
|
||||
v9.5.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix and feature release.
|
||||
|
||||
Please note that this is the last feature release for community.general 9.x.y.
|
||||
From now on, new features will only go into community.general 10.x.y.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- dig lookup plugin - add ``port`` option to specify DNS server port (https://github.com/ansible-collections/community.general/pull/8966).
|
||||
- flatpak - improve the parsing of Flatpak application IDs based on official guidelines (https://github.com/ansible-collections/community.general/pull/8909).
|
||||
- gio_mime - adjust code ahead of the old ``VardDict`` deprecation (https://github.com/ansible-collections/community.general/pull/8855).
|
||||
- gitlab_deploy_key - better construct when using ``dict.items()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- gitlab_group - add many new parameters (https://github.com/ansible-collections/community.general/pull/8908).
|
||||
- gitlab_group - better construct when using ``dict.items()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- gitlab_issue - better construct when using ``dict.items()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- gitlab_merge_request - better construct when using ``dict.items()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- gitlab_runner - better construct when using ``dict.items()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- icinga2_host - replace loop with dict comprehension (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- jira - adjust code ahead of the old ``VardDict`` deprecation (https://github.com/ansible-collections/community.general/pull/8856).
|
||||
- keycloak_client - add ``client-x509`` choice to ``client_authenticator_type`` (https://github.com/ansible-collections/community.general/pull/8973).
|
||||
- keycloak_user_federation - add the user federation config parameter ``referral`` to the module arguments (https://github.com/ansible-collections/community.general/pull/8954).
|
||||
- memset_dns_reload - replace loop with ``dict()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- memset_memstore_info - replace loop with ``dict()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- memset_server_info - replace loop with ``dict()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- memset_zone - replace loop with ``dict()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- memset_zone_domain - replace loop with ``dict()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- memset_zone_record - replace loop with ``dict()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- nmcli - add ``conn_enable`` param to reload connection (https://github.com/ansible-collections/community.general/issues/3752, https://github.com/ansible-collections/community.general/issues/8704, https://github.com/ansible-collections/community.general/pull/8897).
|
||||
- nmcli - add ``state=up`` and ``state=down`` to enable/disable connections (https://github.com/ansible-collections/community.general/issues/3752, https://github.com/ansible-collections/community.general/issues/8704, https://github.com/ansible-collections/community.general/issues/7152, https://github.com/ansible-collections/community.general/pull/8897).
|
||||
- nmcli - better construct when using ``dict.items()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- npm - add ``force`` parameter to allow ``--force`` (https://github.com/ansible-collections/community.general/pull/8885).
|
||||
- one_image - add option ``persistent`` to manage image persistence (https://github.com/ansible-collections/community.general/issues/3578, https://github.com/ansible-collections/community.general/pull/8889).
|
||||
- one_image - extend xsd scheme to make it return a lot more info about image (https://github.com/ansible-collections/community.general/pull/8889).
|
||||
- one_image - refactor code to make it more similar to ``one_template`` and ``one_vnet`` (https://github.com/ansible-collections/community.general/pull/8889).
|
||||
- one_image_info - extend xsd scheme to make it return a lot more info about image (https://github.com/ansible-collections/community.general/pull/8889).
|
||||
- one_image_info - refactor code to make it more similar to ``one_template`` and ``one_vnet`` (https://github.com/ansible-collections/community.general/pull/8889).
|
||||
- open_iscsi - allow login to a portal with multiple targets without specifying any of them (https://github.com/ansible-collections/community.general/pull/8719).
|
||||
- opennebula.py - add VM ``id`` and VM ``host`` to inventory host data (https://github.com/ansible-collections/community.general/pull/8532).
|
||||
- passwordstore lookup plugin - add subkey creation/update support (https://github.com/ansible-collections/community.general/pull/8952).
|
||||
- proxmox inventory plugin - clean up authentication code (https://github.com/ansible-collections/community.general/pull/8917).
|
||||
- redfish_command - add handling of the ``PasswordChangeRequired`` message from services in the ``UpdateUserPassword`` command to directly modify the user's password if the requested user is the one invoking the operation (https://github.com/ansible-collections/community.general/issues/8652, https://github.com/ansible-collections/community.general/pull/8653).
|
||||
- redfish_confg - remove ``CapacityBytes`` from required paramaters of the ``CreateVolume`` command (https://github.com/ansible-collections/community.general/pull/8956).
|
||||
- redfish_config - add parameter ``storage_none_volume_deletion`` to ``CreateVolume`` command in order to control the automatic deletion of non-RAID volumes (https://github.com/ansible-collections/community.general/pull/8990).
|
||||
- redfish_info - adds ``RedfishURI`` and ``StorageId`` to Disk inventory (https://github.com/ansible-collections/community.general/pull/8937).
|
||||
- scaleway_container - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8858).
|
||||
- scaleway_container_info - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8858).
|
||||
- scaleway_container_namespace - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8858).
|
||||
- scaleway_container_namespace_info - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8858).
|
||||
- scaleway_container_registry - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8858).
|
||||
- scaleway_container_registry_info - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8858).
|
||||
- scaleway_function - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8858).
|
||||
- scaleway_function_info - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8858).
|
||||
- scaleway_function_namespace - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8858).
|
||||
- scaleway_function_namespace_info - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8858).
|
||||
- scaleway_user_data - better construct when using ``dict.items()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
- udm_dns_record - replace loop with ``dict.update()`` (https://github.com/ansible-collections/community.general/pull/8876).
|
||||
|
||||
Deprecated Features
|
||||
-------------------
|
||||
|
||||
- hipchat - the hipchat service has been discontinued and the self-hosted variant has been End of Life since 2020. The module is therefore deprecated and will be removed from community.general 11.0.0 if nobody provides compelling reasons to still keep it (https://github.com/ansible-collections/community.general/pull/8919).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- cloudflare_dns - fix changing Cloudflare SRV records (https://github.com/ansible-collections/community.general/issues/8679, https://github.com/ansible-collections/community.general/pull/8948).
|
||||
- cmd_runner module utils - call to ``get_best_parsable_locales()`` was missing parameter (https://github.com/ansible-collections/community.general/pull/8929).
|
||||
- dig lookup plugin - fix using only the last nameserver specified (https://github.com/ansible-collections/community.general/pull/8970).
|
||||
- django_command - option ``command`` is now split lexically before passed to underlying PythonRunner (https://github.com/ansible-collections/community.general/pull/8944).
|
||||
- homectl - the module now tries to use ``legacycrypt`` on Python 3.13+ (https://github.com/ansible-collections/community.general/issues/4691, https://github.com/ansible-collections/community.general/pull/8987).
|
||||
- ini_file - pass absolute paths to ``module.atomic_move()`` (https://github.com/ansible/ansible/issues/83950, https://github.com/ansible-collections/community.general/pull/8925).
|
||||
- ipa_host - add ``force_create``, fix ``enabled`` and ``disabled`` states (https://github.com/ansible-collections/community.general/issues/1094, https://github.com/ansible-collections/community.general/pull/8920).
|
||||
- ipa_hostgroup - fix ``enabled `` and ``disabled`` states (https://github.com/ansible-collections/community.general/issues/8408, https://github.com/ansible-collections/community.general/pull/8900).
|
||||
- java_keystore - pass absolute paths to ``module.atomic_move()`` (https://github.com/ansible/ansible/issues/83950, https://github.com/ansible-collections/community.general/pull/8925).
|
||||
- jenkins_plugin - pass absolute paths to ``module.atomic_move()`` (https://github.com/ansible/ansible/issues/83950, https://github.com/ansible-collections/community.general/pull/8925).
|
||||
- kdeconfig - pass absolute paths to ``module.atomic_move()`` (https://github.com/ansible/ansible/issues/83950, https://github.com/ansible-collections/community.general/pull/8925).
|
||||
- keycloak_realm - fix change detection in check mode by sorting the lists in the realms beforehand (https://github.com/ansible-collections/community.general/pull/8877).
|
||||
- keycloak_user_federation - add module argument allowing users to configure the update mode for the parameter ``bindCredential`` (https://github.com/ansible-collections/community.general/pull/8898).
|
||||
- keycloak_user_federation - minimize change detection by setting ``krbPrincipalAttribute`` to ``''`` in Keycloak responses if missing (https://github.com/ansible-collections/community.general/pull/8785).
|
||||
- keycloak_user_federation - remove ``lastSync`` parameter from Keycloak responses to minimize diff/changes (https://github.com/ansible-collections/community.general/pull/8812).
|
||||
- keycloak_userprofile - fix empty response when fetching userprofile component by removing ``parent=parent_id`` filter (https://github.com/ansible-collections/community.general/pull/8923).
|
||||
- keycloak_userprofile - improve diff by deserializing the fetched ``kc.user.profile.config`` and serialize it only when sending back (https://github.com/ansible-collections/community.general/pull/8940).
|
||||
- lxd_container - fix bug introduced in previous commit (https://github.com/ansible-collections/community.general/pull/8895, https://github.com/ansible-collections/community.general/issues/8888).
|
||||
- one_service - fix service creation after it was deleted with ``unique`` parameter (https://github.com/ansible-collections/community.general/issues/3137, https://github.com/ansible-collections/community.general/pull/8887).
|
||||
- pam_limits - pass absolute paths to ``module.atomic_move()`` (https://github.com/ansible/ansible/issues/83950, https://github.com/ansible-collections/community.general/pull/8925).
|
||||
- python_runner module utils - parameter ``path_prefix`` was being handled as string when it should be a list (https://github.com/ansible-collections/community.general/pull/8944).
|
||||
- udm_user - the module now tries to use ``legacycrypt`` on Python 3.13+ (https://github.com/ansible-collections/community.general/issues/4690, https://github.com/ansible-collections/community.general/pull/8987).
|
||||
|
||||
New Modules
|
||||
-----------
|
||||
|
||||
- community.general.ipa_getkeytab - Manage keytab file in FreeIPA.
|
||||
|
||||
v9.4.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Bugfix and feature release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- MH module utils - add parameter ``when`` to ``cause_changes`` decorator (https://github.com/ansible-collections/community.general/pull/8766).
|
||||
- MH module utils - minor refactor in decorators (https://github.com/ansible-collections/community.general/pull/8766).
|
||||
- alternatives - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- apache2_mod_proxy - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- apache2_mod_proxy - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- consul_acl - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- copr - Added ``includepkgs`` and ``excludepkgs`` parameters to limit the list of packages fetched or excluded from the repository(https://github.com/ansible-collections/community.general/pull/8779).
|
||||
- credstash lookup plugin - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- csv module utils - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- deco MH module utils - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- etcd3 - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- gio_mime - mute the old ``VarDict`` deprecation (https://github.com/ansible-collections/community.general/pull/8776).
|
||||
- gitlab_group - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- gitlab_project - add option ``issues_access_level`` to enable/disable project issues (https://github.com/ansible-collections/community.general/pull/8760).
|
||||
- gitlab_project - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- gitlab_project - sorted parameters in order to avoid future merge conflicts (https://github.com/ansible-collections/community.general/pull/8759).
|
||||
- hashids filter plugin - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- hwc_ecs_instance - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- hwc_evs_disk - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- hwc_vpc_eip - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- hwc_vpc_peering_connect - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- hwc_vpc_port - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- hwc_vpc_subnet - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- imc_rest - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- ipa_otptoken - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- jira - mute the old ``VarDict`` deprecation (https://github.com/ansible-collections/community.general/pull/8776).
|
||||
- jira - replace deprecated params when using decorator ``cause_changes`` (https://github.com/ansible-collections/community.general/pull/8791).
|
||||
- keep_keys filter plugin - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- keycloak module utils - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- keycloak_client - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- keycloak_clientscope - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- keycloak_identity_provider - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- keycloak_user_federation - add module argument allowing users to optout of the removal of unspecified mappers, for example to keep the keycloak default mappers (https://github.com/ansible-collections/community.general/pull/8764).
|
||||
- keycloak_user_federation - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- keycloak_user_federation - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- keycloak_user_federation - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- linode - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- lxc_container - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- lxd_container - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- manageiq_provider - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- ocapi_utils - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- one_service - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- one_vm - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- onepassword lookup plugin - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- pids - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- pipx - added new states ``install_all``, ``uninject``, ``upgrade_shared``, ``pin``, and ``unpin`` (https://github.com/ansible-collections/community.general/pull/8809).
|
||||
- pipx - added parameter ``global`` to module (https://github.com/ansible-collections/community.general/pull/8793).
|
||||
- pipx - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- pipx_info - added parameter ``global`` to module (https://github.com/ansible-collections/community.general/pull/8793).
|
||||
- pipx_info - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- pkg5_publisher - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- proxmox - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- proxmox_disk - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- proxmox_kvm - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- proxmox_kvm - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- redfish_utils - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- redfish_utils module utils - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- redis cache plugin - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- remove_keys filter plugin - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- replace_keys filter plugin - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- scaleway - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- scaleway module utils - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- scaleway_compute - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- scaleway_ip - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- scaleway_lb - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- scaleway_security_group - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- scaleway_security_group - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- scaleway_user_data - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- sensu_silence - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- snmp_facts - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- sorcery - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8833).
|
||||
- ufw - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
- unsafe plugin utils - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- vardict module utils - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- vars MH module utils - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8814).
|
||||
- vmadm - replace Python 2.6 construct with dict comprehensions (https://github.com/ansible-collections/community.general/pull/8822).
|
||||
|
||||
Deprecated Features
|
||||
-------------------
|
||||
|
||||
- MH decorator cause_changes module utils - deprecate parameters ``on_success`` and ``on_failure`` (https://github.com/ansible-collections/community.general/pull/8791).
|
||||
- pipx - support for versions of the command line tool ``pipx`` older than ``1.7.0`` is deprecated and will be removed in community.general 11.0.0 (https://github.com/ansible-collections/community.general/pull/8793).
|
||||
- pipx_info - support for versions of the command line tool ``pipx`` older than ``1.7.0`` is deprecated and will be removed in community.general 11.0.0 (https://github.com/ansible-collections/community.general/pull/8793).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- gitlab_group_access_token - fix crash in check mode caused by attempted access to a newly created access token (https://github.com/ansible-collections/community.general/pull/8796).
|
||||
- gitlab_project - fix ``container_expiration_policy`` not being applied when creating a new project (https://github.com/ansible-collections/community.general/pull/8790).
|
||||
- gitlab_project - fix crash caused by old Gitlab projects not having a ``container_expiration_policy`` attribute (https://github.com/ansible-collections/community.general/pull/8790).
|
||||
- gitlab_project_access_token - fix crash in check mode caused by attempted access to a newly created access token (https://github.com/ansible-collections/community.general/pull/8796).
|
||||
- keycloak_realm_key - fix invalid usage of ``parent_id`` (https://github.com/ansible-collections/community.general/issues/7850, https://github.com/ansible-collections/community.general/pull/8823).
|
||||
- keycloak_user_federation - fix key error when removing mappers during an update and new mappers are specified in the module args (https://github.com/ansible-collections/community.general/pull/8762).
|
||||
- keycloak_user_federation - fix the ``UnboundLocalError`` that occurs when an ID is provided for a user federation mapper (https://github.com/ansible-collections/community.general/pull/8831).
|
||||
- keycloak_user_federation - sort desired and after mapper list by name (analog to before mapper list) to minimize diff and make change detection more accurate (https://github.com/ansible-collections/community.general/pull/8761).
|
||||
- proxmox inventory plugin - fixed a possible error on concatenating responses from proxmox. In case an API call unexpectedly returned an empty result, the inventory failed with a fatal error. Added check for empty response (https://github.com/ansible-collections/community.general/issues/8798, https://github.com/ansible-collections/community.general/pull/8794).
|
||||
|
||||
New Modules
|
||||
-----------
|
||||
|
||||
- community.general.keycloak_userprofile - Allows managing Keycloak User Profiles.
|
||||
- community.general.one_vnet - Manages OpenNebula virtual networks.
|
||||
|
||||
v9.3.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix and feature release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- cgroup_memory_recap, hipchat, jabber, log_plays, loganalytics, logentries, logstash, slack, splunk, sumologic, syslog_json callback plugins - make sure that all options are typed (https://github.com/ansible-collections/community.general/pull/8628).
|
||||
- chef_databag, consul_kv, cyberarkpassword, dsv, etcd, filetree, hiera, onepassword, onepassword_doc, onepassword_raw, passwordstore, redis, shelvefile, tss lookup plugins - make sure that all options are typed (https://github.com/ansible-collections/community.general/pull/8626).
|
||||
- chroot, funcd, incus, iocage, jail, lxc, lxd, qubes, zone connection plugins - make sure that all options are typed (https://github.com/ansible-collections/community.general/pull/8627).
|
||||
- cobbler, linode, lxd, nmap, online, scaleway, stackpath_compute, virtualbox inventory plugins - make sure that all options are typed (https://github.com/ansible-collections/community.general/pull/8625).
|
||||
- doas, dzdo, ksu, machinectl, pbrun, pfexec, pmrun, sesu, sudosu become plugins - make sure that all options are typed (https://github.com/ansible-collections/community.general/pull/8623).
|
||||
- gconftool2 - make use of ``ModuleHelper`` features to simplify code (https://github.com/ansible-collections/community.general/pull/8711).
|
||||
- gitlab_project - add option ``container_expiration_policy`` to schedule container registry cleanup (https://github.com/ansible-collections/community.general/pull/8674).
|
||||
- gitlab_project - add option ``model_registry_access_level`` to disable model registry (https://github.com/ansible-collections/community.general/pull/8688).
|
||||
- gitlab_project - add option ``pages_access_level`` to disable project pages (https://github.com/ansible-collections/community.general/pull/8688).
|
||||
- gitlab_project - add option ``repository_access_level`` to disable project repository (https://github.com/ansible-collections/community.general/pull/8674).
|
||||
- gitlab_project - add option ``service_desk_enabled`` to disable service desk (https://github.com/ansible-collections/community.general/pull/8688).
|
||||
- locale_gen - add support for multiple locales (https://github.com/ansible-collections/community.general/issues/8677, https://github.com/ansible-collections/community.general/pull/8682).
|
||||
- memcached, pickle, redis, yaml cache plugins - make sure that all options are typed (https://github.com/ansible-collections/community.general/pull/8624).
|
||||
- opentelemetry callback plugin - fix default value for ``store_spans_in_file`` causing traces to be produced to a file named ``None`` (https://github.com/ansible-collections/community.general/issues/8566, https://github.com/ansible-collections/community.general/pull/8741).
|
||||
- passwordstore lookup plugin - add the current user to the lockfile file name to address issues on multi-user systems (https://github.com/ansible-collections/community.general/pull/8689).
|
||||
- pipx - add parameter ``suffix`` to module (https://github.com/ansible-collections/community.general/pull/8675, https://github.com/ansible-collections/community.general/issues/8656).
|
||||
- pkgng - add option ``use_globs`` (default ``true``) to optionally disable glob patterns (https://github.com/ansible-collections/community.general/issues/8632, https://github.com/ansible-collections/community.general/pull/8633).
|
||||
- proxmox inventory plugin - add new fact for LXC interface details (https://github.com/ansible-collections/community.general/pull/8713).
|
||||
- redis, redis_info - add ``client_cert`` and ``client_key`` options to specify path to certificate for Redis authentication (https://github.com/ansible-collections/community.general/pull/8654).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- gitlab_runner - fix ``paused`` parameter being ignored (https://github.com/ansible-collections/community.general/pull/8648).
|
||||
- homebrew_cask - fix ``upgrade_all`` returns ``changed`` when nothing upgraded (https://github.com/ansible-collections/community.general/issues/8707, https://github.com/ansible-collections/community.general/pull/8708).
|
||||
- keycloak_user_federation - get cleartext IDP ``clientSecret`` from full realm info to detect changes to it (https://github.com/ansible-collections/community.general/issues/8294, https://github.com/ansible-collections/community.general/pull/8735).
|
||||
- keycloak_user_federation - remove existing user federation mappers if they are not present in the federation configuration and will not be updated (https://github.com/ansible-collections/community.general/issues/7169, https://github.com/ansible-collections/community.general/pull/8695).
|
||||
- proxmox - fixed an issue where the new volume handling incorrectly converted ``null`` values into ``"None"`` strings (https://github.com/ansible-collections/community.general/pull/8646).
|
||||
- proxmox - fixed an issue where volume strings where overwritten instead of appended to in the new ``build_volume()`` method (https://github.com/ansible-collections/community.general/pull/8646).
|
||||
- proxmox - removed the forced conversion of non-string values to strings to be consistent with the module documentation (https://github.com/ansible-collections/community.general/pull/8646).
|
||||
|
||||
New Modules
|
||||
-----------
|
||||
|
||||
- community.general.bootc_manage - Bootc Switch and Upgrade.
|
||||
- community.general.homebrew_services - Services manager for Homebrew.
|
||||
- community.general.keycloak_realm_keys_metadata_info - Allows obtaining Keycloak realm keys metadata via Keycloak API.
|
||||
|
||||
v9.2.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix and feature release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- CmdRunner module utils - the parameter ``force_lang`` now supports the special value ``auto`` which will automatically try and determine the best parsable locale in the system (https://github.com/ansible-collections/community.general/pull/8517).
|
||||
- proxmox - add ``disk_volume`` and ``mount_volumes`` keys for better readability (https://github.com/ansible-collections/community.general/pull/8542).
|
||||
- proxmox - translate the old ``disk`` and ``mounts`` keys to the new handling internally (https://github.com/ansible-collections/community.general/pull/8542).
|
||||
- proxmox_template - small refactor in logic for determining whether a template exists or not (https://github.com/ansible-collections/community.general/pull/8516).
|
||||
- redfish_* modules - adds ``ciphers`` option for custom cipher selection (https://github.com/ansible-collections/community.general/pull/8533).
|
||||
- sudosu become plugin - added an option (``alt_method``) to enhance compatibility with more versions of ``su`` (https://github.com/ansible-collections/community.general/pull/8214).
|
||||
- virtualbox inventory plugin - expose a new parameter ``enable_advanced_group_parsing`` to change how the VirtualBox dynamic inventory parses VM groups (https://github.com/ansible-collections/community.general/issues/8508, https://github.com/ansible-collections/community.general/pull/8510).
|
||||
- wdc_redfish_command - minor change to handle upgrade file for Redfish WD platforms (https://github.com/ansible-collections/community.general/pull/8444).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- bitwarden lookup plugin - fix ``KeyError`` in ``search_field`` (https://github.com/ansible-collections/community.general/issues/8549, https://github.com/ansible-collections/community.general/pull/8557).
|
||||
- keycloak_clientscope - remove IDs from clientscope and its protocol mappers on comparison for changed check (https://github.com/ansible-collections/community.general/pull/8545).
|
||||
- nsupdate - fix 'index out of range' error when changing NS records by falling back to authority section of the response (https://github.com/ansible-collections/community.general/issues/8612, https://github.com/ansible-collections/community.general/pull/8614).
|
||||
- proxmox - fix idempotency on creation of mount volumes using Proxmox' special ``<storage>:<size>`` syntax (https://github.com/ansible-collections/community.general/issues/8407, https://github.com/ansible-collections/community.general/pull/8542).
|
||||
- redfish_utils module utils - do not fail when language is not exactly "en" (https://github.com/ansible-collections/community.general/pull/8613).
|
||||
|
||||
New Plugins
|
||||
-----------
|
||||
|
||||
Filter
|
||||
~~~~~~
|
||||
|
||||
- community.general.reveal_ansible_type - Return input type.
|
||||
|
||||
Test
|
||||
~~~~
|
||||
|
||||
- community.general.ansible_type - Validate input type.
|
||||
|
||||
v9.1.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular feature and bugfix release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- CmdRunner module util - argument formats can be specified as plain functions without calling ``cmd_runner_fmt.as_func()`` (https://github.com/ansible-collections/community.general/pull/8479).
|
||||
- ansible_galaxy_install - add upgrade feature (https://github.com/ansible-collections/community.general/pull/8431, https://github.com/ansible-collections/community.general/issues/8351).
|
||||
- cargo - add option ``directory``, which allows source directory to be specified (https://github.com/ansible-collections/community.general/pull/8480).
|
||||
- cmd_runner module utils - add decorator ``cmd_runner_fmt.stack`` (https://github.com/ansible-collections/community.general/pull/8415).
|
||||
- cmd_runner_fmt module utils - simplify implementation of ``cmd_runner_fmt.as_bool_not()`` (https://github.com/ansible-collections/community.general/pull/8512).
|
||||
- ipa_dnsrecord - adds ``SSHFP`` record type for managing SSH fingerprints in FreeIPA DNS (https://github.com/ansible-collections/community.general/pull/8404).
|
||||
- keycloak_client - assign auth flow by name (https://github.com/ansible-collections/community.general/pull/8428).
|
||||
- openbsd_pkg - adds diff support to show changes in installed package list. This does not yet work for check mode (https://github.com/ansible-collections/community.general/pull/8402).
|
||||
- proxmox - allow specification of the API port when using proxmox_* (https://github.com/ansible-collections/community.general/issues/8440, https://github.com/ansible-collections/community.general/pull/8441).
|
||||
- proxmox_vm_info - add ``network`` option to retrieve current network information (https://github.com/ansible-collections/community.general/pull/8471).
|
||||
- redfish_command - add ``wait`` and ``wait_timeout`` options to allow a user to block a command until a service is accessible after performing the requested command (https://github.com/ansible-collections/community.general/issues/8051, https://github.com/ansible-collections/community.general/pull/8434).
|
||||
- redfish_info - add command ``CheckAvailability`` to check if a service is accessible (https://github.com/ansible-collections/community.general/issues/8051, https://github.com/ansible-collections/community.general/pull/8434).
|
||||
- redis_info - adds support for getting cluster info (https://github.com/ansible-collections/community.general/pull/8464).
|
||||
|
||||
Deprecated Features
|
||||
-------------------
|
||||
|
||||
- CmdRunner module util - setting the value of the ``ignore_none`` parameter within a ``CmdRunner`` context is deprecated and that feature should be removed in community.general 12.0.0 (https://github.com/ansible-collections/community.general/pull/8479).
|
||||
- git_config - the ``list_all`` option has been deprecated and will be removed in community.general 11.0.0. Use the ``community.general.git_config_info`` module instead (https://github.com/ansible-collections/community.general/pull/8453).
|
||||
- git_config - using ``state=present`` without providing ``value`` is deprecated and will be disallowed in community.general 11.0.0. Use the ``community.general.git_config_info`` module instead to read a value (https://github.com/ansible-collections/community.general/pull/8453).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- git_config - fix behavior of ``state=absent`` if ``value`` is present (https://github.com/ansible-collections/community.general/issues/8436, https://github.com/ansible-collections/community.general/pull/8452).
|
||||
- keycloak_realm - add normalizations for ``attributes`` and ``protocol_mappers`` (https://github.com/ansible-collections/community.general/pull/8496).
|
||||
- launched - correctly report changed status in check mode (https://github.com/ansible-collections/community.general/pull/8406).
|
||||
- opennebula inventory plugin - fix invalid reference to IP when inventory runs against NICs with no IPv4 address (https://github.com/ansible-collections/community.general/pull/8489).
|
||||
- opentelemetry callback - do not save the JSON response when using the ``ansible.builtin.uri`` module (https://github.com/ansible-collections/community.general/pull/8430).
|
||||
- opentelemetry callback - do not save the content response when using the ``ansible.builtin.slurp`` module (https://github.com/ansible-collections/community.general/pull/8430).
|
||||
- paman - do not fail if an empty list of packages has been provided and there is nothing to do (https://github.com/ansible-collections/community.general/pull/8514).
|
||||
|
||||
Known Issues
|
||||
------------
|
||||
|
||||
- homectl - the module does not work under Python 3.13 or newer, since it relies on the removed ``crypt`` standard library module (https://github.com/ansible-collections/community.general/issues/4691, https://github.com/ansible-collections/community.general/pull/8497).
|
||||
- udm_user - the module does not work under Python 3.13 or newer, since it relies on the removed ``crypt`` standard library module (https://github.com/ansible-collections/community.general/issues/4690, https://github.com/ansible-collections/community.general/pull/8497).
|
||||
|
||||
New Plugins
|
||||
-----------
|
||||
|
||||
Filter
|
||||
~~~~~~
|
||||
|
||||
- community.general.keep_keys - Keep specific keys from dictionaries in a list.
|
||||
- community.general.remove_keys - Remove specific keys from dictionaries in a list.
|
||||
- community.general.replace_keys - Replace specific keys in a list of dictionaries.
|
||||
|
||||
New Modules
|
||||
-----------
|
||||
|
||||
- community.general.consul_agent_check - Add, modify, and delete checks within a consul cluster.
|
||||
- community.general.consul_agent_service - Add, modify and delete services within a consul cluster.
|
||||
- community.general.django_check - Wrapper for C(django-admin check).
|
||||
- community.general.django_createcachetable - Wrapper for C(django-admin createcachetable).
|
||||
|
||||
v9.0.1
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Bugfix release for inclusion in Ansible 10.0.0rc1.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- ansible_galaxy_install - minor refactor in the module (https://github.com/ansible-collections/community.general/pull/8413).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- cpanm - use new ``VarDict`` to prevent deprecation warning (https://github.com/ansible-collections/community.general/issues/8410, https://github.com/ansible-collections/community.general/pull/8411).
|
||||
- django module utils - use new ``VarDict`` to prevent deprecation warning (https://github.com/ansible-collections/community.general/issues/8410, https://github.com/ansible-collections/community.general/pull/8411).
|
||||
- gconftool2_info - use new ``VarDict`` to prevent deprecation warning (https://github.com/ansible-collections/community.general/issues/8410, https://github.com/ansible-collections/community.general/pull/8411).
|
||||
- homebrew - do not fail when brew prints warnings (https://github.com/ansible-collections/community.general/pull/8406, https://github.com/ansible-collections/community.general/issues/7044).
|
||||
- hponcfg - use new ``VarDict`` to prevent deprecation warning (https://github.com/ansible-collections/community.general/issues/8410, https://github.com/ansible-collections/community.general/pull/8411).
|
||||
- kernel_blacklist - use new ``VarDict`` to prevent deprecation warning (https://github.com/ansible-collections/community.general/issues/8410, https://github.com/ansible-collections/community.general/pull/8411).
|
||||
- keycloak_client - fix TypeError when sanitizing the ``saml.signing.private.key`` attribute in the module's diff or state output. The ``sanitize_cr`` function expected a dict where in some cases a list might occur (https://github.com/ansible-collections/community.general/pull/8403).
|
||||
- locale_gen - use new ``VarDict`` to prevent deprecation warning (https://github.com/ansible-collections/community.general/issues/8410, https://github.com/ansible-collections/community.general/pull/8411).
|
||||
- mksysb - use new ``VarDict`` to prevent deprecation warning (https://github.com/ansible-collections/community.general/issues/8410, https://github.com/ansible-collections/community.general/pull/8411).
|
||||
- pipx_info - use new ``VarDict`` to prevent deprecation warning (https://github.com/ansible-collections/community.general/issues/8410, https://github.com/ansible-collections/community.general/pull/8411).
|
||||
- snap - use new ``VarDict`` to prevent deprecation warning (https://github.com/ansible-collections/community.general/issues/8410, https://github.com/ansible-collections/community.general/pull/8411).
|
||||
- snap_alias - use new ``VarDict`` to prevent deprecation warning (https://github.com/ansible-collections/community.general/issues/8410, https://github.com/ansible-collections/community.general/pull/8411).
|
||||
|
||||
v9.0.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
This is release 9.0.0 of ``community.general``, released on 2024-05-20.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- PythonRunner module utils - specialisation of ``CmdRunner`` to execute Python scripts (https://github.com/ansible-collections/community.general/pull/8289).
|
||||
- Use offset-aware ``datetime.datetime`` objects (with timezone UTC) instead of offset-naive UTC timestamps, which are deprecated in Python 3.12 (https://github.com/ansible-collections/community.general/pull/8222).
|
||||
- aix_lvol - refactor module to pass list of arguments to ``module.run_command()`` instead of relying on interpretation by a shell (https://github.com/ansible-collections/community.general/pull/8264).
|
||||
- apt_rpm - add new states ``latest`` and ``present_not_latest``. The value ``latest`` is equivalent to the current behavior of ``present``, which will upgrade a package if a newer version exists. ``present_not_latest`` does what most users would expect ``present`` to do: it does not upgrade if the package is already installed. The current behavior of ``present`` will be deprecated in a later version, and eventually changed to that of ``present_not_latest`` (https://github.com/ansible-collections/community.general/issues/8217, https://github.com/ansible-collections/community.general/pull/8247).
|
||||
- apt_rpm - refactor module to pass list of arguments to ``module.run_command()`` instead of relying on interpretation by a shell (https://github.com/ansible-collections/community.general/pull/8264).
|
||||
- bitwarden lookup plugin - add ``bw_session`` option, to pass session key instead of reading from env (https://github.com/ansible-collections/community.general/pull/7994).
|
||||
- bitwarden lookup plugin - add support to filter by organization ID (https://github.com/ansible-collections/community.general/pull/8188).
|
||||
- bitwarden lookup plugin - allows to fetch all records of a given collection ID, by allowing to pass an empty value for ``search_value`` when ``collection_id`` is provided (https://github.com/ansible-collections/community.general/pull/8013).
|
||||
- bitwarden lookup plugin - when looking for items using an item ID, the item is now accessed directly with ``bw get item`` instead of searching through all items. This doubles the lookup speed (https://github.com/ansible-collections/community.general/pull/7468).
|
||||
- btrfs_subvolume - refactor module to pass list of arguments to ``module.run_command()`` instead of relying on interpretation by a shell (https://github.com/ansible-collections/community.general/pull/8264).
|
||||
- cmd_runner module_utils - add validation for minimum and maximum length in the value passed to ``cmd_runner_fmt.as_list()`` (https://github.com/ansible-collections/community.general/pull/8288).
|
||||
- consul_auth_method, consul_binding_rule, consul_policy, consul_role, consul_session, consul_token - added action group ``community.general.consul`` (https://github.com/ansible-collections/community.general/pull/7897).
|
||||
- consul_policy - added support for diff and check mode (https://github.com/ansible-collections/community.general/pull/7878).
|
||||
- consul_policy, consul_role, consul_session - removed dependency on ``requests`` and factored out common parts (https://github.com/ansible-collections/community.general/pull/7826, https://github.com/ansible-collections/community.general/pull/7878).
|
||||
- consul_role - ``node_identities`` now expects a ``node_name`` option to match the Consul API, the old ``name`` is still supported as alias (https://github.com/ansible-collections/community.general/pull/7878).
|
||||
- consul_role - ``service_identities`` now expects a ``service_name`` option to match the Consul API, the old ``name`` is still supported as alias (https://github.com/ansible-collections/community.general/pull/7878).
|
||||
- consul_role - added support for diff mode (https://github.com/ansible-collections/community.general/pull/7878).
|
||||
- consul_role - added support for templated policies (https://github.com/ansible-collections/community.general/pull/7878).
|
||||
- elastic callback plugin - close elastic client to not leak resources (https://github.com/ansible-collections/community.general/pull/7517).
|
||||
- filesystem - add bcachefs support (https://github.com/ansible-collections/community.general/pull/8126).
|
||||
- gandi_livedns - adds support for personal access tokens (https://github.com/ansible-collections/community.general/issues/7639, https://github.com/ansible-collections/community.general/pull/8337).
|
||||
- gconftool2 - use ``ModuleHelper`` with ``VarDict`` (https://github.com/ansible-collections/community.general/pull/8226).
|
||||
- git_config - allow multiple git configs for the same name with the new ``add_mode`` option (https://github.com/ansible-collections/community.general/pull/7260).
|
||||
- git_config - the ``after`` and ``before`` fields in the ``diff`` of the return value can be a list instead of a string in case more configs with the same key are affected (https://github.com/ansible-collections/community.general/pull/7260).
|
||||
- git_config - when a value is unset, all configs with the same key are unset (https://github.com/ansible-collections/community.general/pull/7260).
|
||||
- gitlab modules - add ``ca_path`` option (https://github.com/ansible-collections/community.general/pull/7472).
|
||||
- gitlab modules - remove duplicate ``gitlab`` package check (https://github.com/ansible-collections/community.general/pull/7486).
|
||||
- gitlab_deploy_key, gitlab_group_members, gitlab_group_variable, gitlab_hook, gitlab_instance_variable, gitlab_project_badge, gitlab_project_variable, gitlab_user - improve API pagination and compatibility with different versions of ``python-gitlab`` (https://github.com/ansible-collections/community.general/pull/7790).
|
||||
- gitlab_hook - adds ``releases_events`` parameter for supporting Releases events triggers on GitLab hooks (https://github.com/ansible-collections/community.general/pull/7956).
|
||||
- gitlab_runner - add support for new runner creation workflow (https://github.com/ansible-collections/community.general/pull/7199).
|
||||
- homebrew - adds ``force_formula`` parameter to disambiguate a formula from a cask of the same name (https://github.com/ansible-collections/community.general/issues/8274).
|
||||
- homebrew, homebrew_cask - refactor common argument validation logic into a dedicated ``homebrew`` module utils (https://github.com/ansible-collections/community.general/issues/8323, https://github.com/ansible-collections/community.general/pull/8324).
|
||||
- icinga2 inventory plugin - add Jinja2 templating support to ``url``, ``user``, and ``password`` paramenters (https://github.com/ansible-collections/community.general/issues/7074, https://github.com/ansible-collections/community.general/pull/7996).
|
||||
- icinga2 inventory plugin - adds new parameter ``group_by_hostgroups`` in order to make grouping by Icinga2 hostgroups optional (https://github.com/ansible-collections/community.general/pull/7998).
|
||||
- ini_file - add an optional parameter ``section_has_values``. If the target ini file contains more than one ``section``, use ``section_has_values`` to specify which one should be updated (https://github.com/ansible-collections/community.general/pull/7505).
|
||||
- ini_file - support optional spaces between section names and their surrounding brackets (https://github.com/ansible-collections/community.general/pull/8075).
|
||||
- installp - refactor module to pass list of arguments to ``module.run_command()`` instead of relying on interpretation by a shell (https://github.com/ansible-collections/community.general/pull/8264).
|
||||
- ipa_config - adds ``passkey`` choice to ``ipauserauthtype`` parameter's choices (https://github.com/ansible-collections/community.general/pull/7588).
|
||||
- ipa_dnsrecord - adds ability to manage NS record types (https://github.com/ansible-collections/community.general/pull/7737).
|
||||
- ipa_pwpolicy - refactor module and exchange a sequence ``if`` statements with a ``for`` loop (https://github.com/ansible-collections/community.general/pull/7723).
|
||||
- ipa_pwpolicy - update module to support ``maxrepeat``, ``maxsequence``, ``dictcheck``, ``usercheck``, ``gracelimit`` parameters in FreeIPA password policies (https://github.com/ansible-collections/community.general/pull/7723).
|
||||
- ipa_sudorule - adds options to include denied commands or command groups (https://github.com/ansible-collections/community.general/pull/7415).
|
||||
- ipa_user - adds ``idp`` and ``passkey`` choice to ``ipauserauthtype`` parameter's choices (https://github.com/ansible-collections/community.general/pull/7589).
|
||||
- irc - add ``validate_certs`` option, and rename ``use_ssl`` to ``use_tls``, while keeping ``use_ssl`` as an alias. The default value for ``validate_certs`` is ``false`` for backwards compatibility. We recommend to every user of this module to explicitly set ``use_tls=true`` and `validate_certs=true`` whenever possible, especially when communicating to IRC servers over the internet (https://github.com/ansible-collections/community.general/pull/7550).
|
||||
- java_cert - add ``cert_content`` argument (https://github.com/ansible-collections/community.general/pull/8153).
|
||||
- java_cert - enable ``owner``, ``group``, ``mode``, and other generic file arguments (https://github.com/ansible-collections/community.general/pull/8116).
|
||||
- kernel_blacklist - use ``ModuleHelper`` with ``VarDict`` (https://github.com/ansible-collections/community.general/pull/8226).
|
||||
- keycloak module utils - expose error message from Keycloak server for HTTP errors in some specific situations (https://github.com/ansible-collections/community.general/pull/7645).
|
||||
- keycloak_client, keycloak_clientscope, keycloak_clienttemplate - added ``docker-v2`` protocol support, enhancing alignment with Keycloak's protocol options (https://github.com/ansible-collections/community.general/issues/8215, https://github.com/ansible-collections/community.general/pull/8216).
|
||||
- keycloak_realm_key - the ``config.algorithm`` option now supports 8 additional key algorithms (https://github.com/ansible-collections/community.general/pull/7698).
|
||||
- keycloak_realm_key - the ``config.certificate`` option value is no longer defined with ``no_log=True`` (https://github.com/ansible-collections/community.general/pull/7698).
|
||||
- keycloak_realm_key - the ``provider_id`` option now supports RSA encryption key usage (value ``rsa-enc``) (https://github.com/ansible-collections/community.general/pull/7698).
|
||||
- keycloak_user_federation - add option for ``krbPrincipalAttribute`` (https://github.com/ansible-collections/community.general/pull/7538).
|
||||
- keycloak_user_federation - allow custom user storage providers to be set through ``provider_id`` (https://github.com/ansible-collections/community.general/pull/7789).
|
||||
- ldap_attrs - module now supports diff mode, showing which attributes are changed within an operation (https://github.com/ansible-collections/community.general/pull/8073).
|
||||
- lvg - refactor module to pass list of arguments to ``module.run_command()`` instead of relying on interpretation by a shell (https://github.com/ansible-collections/community.general/pull/8264).
|
||||
- lvol - change ``pvs`` argument type to list of strings (https://github.com/ansible-collections/community.general/pull/7676, https://github.com/ansible-collections/community.general/issues/7504).
|
||||
- lvol - refactor module to pass list of arguments to ``module.run_command()`` instead of relying on interpretation by a shell (https://github.com/ansible-collections/community.general/pull/8264).
|
||||
- lxd connection plugin - tighten the detection logic for lxd ``Instance not found`` errors, to avoid false detection on unrelated errors such as ``/usr/bin/python3: not found`` (https://github.com/ansible-collections/community.general/pull/7521).
|
||||
- lxd_container - uses ``/1.0/instances`` API endpoint, if available. Falls back to ``/1.0/containers`` or ``/1.0/virtual-machines``. Fixes issue when using Incus or LXD 5.19 due to migrating to ``/1.0/instances`` endpoint (https://github.com/ansible-collections/community.general/pull/7980).
|
||||
- macports - refactor module to pass list of arguments to ``module.run_command()`` instead of relying on interpretation by a shell (https://github.com/ansible-collections/community.general/pull/8264).
|
||||
- mail - add ``Message-ID`` header; which is required by some mail servers (https://github.com/ansible-collections/community.general/pull/7740).
|
||||
- mail module, mail callback plugin - allow to configure the domain name of the Message-ID header with a new ``message_id_domain`` option (https://github.com/ansible-collections/community.general/pull/7765).
|
||||
- mssql_script - adds transactional (rollback/commit) support via optional boolean param ``transaction`` (https://github.com/ansible-collections/community.general/pull/7976).
|
||||
- netcup_dns - adds support for record types ``OPENPGPKEY``, ``SMIMEA``, and ``SSHFP`` (https://github.com/ansible-collections/community.general/pull/7489).
|
||||
- nmcli - add support for new connection type ``loopback`` (https://github.com/ansible-collections/community.general/issues/6572).
|
||||
- nmcli - adds OpenvSwitch support with new ``type`` values ``ovs-port``, ``ovs-interface``, and ``ovs-bridge``, and new ``slave_type`` value ``ovs-port`` (https://github.com/ansible-collections/community.general/pull/8154).
|
||||
- nmcli - allow for ``infiniband`` slaves of ``bond`` interface types (https://github.com/ansible-collections/community.general/pull/7569).
|
||||
- nmcli - allow for the setting of ``MTU`` for ``infiniband`` and ``bond`` interface types (https://github.com/ansible-collections/community.general/pull/7499).
|
||||
- nmcli - allow setting ``MTU`` for ``bond-slave`` interface types (https://github.com/ansible-collections/community.general/pull/8118).
|
||||
- onepassword lookup plugin - support 1Password Connect with the opv2 client by setting the connect_host and connect_token parameters (https://github.com/ansible-collections/community.general/pull/7116).
|
||||
- onepassword_raw lookup plugin - support 1Password Connect with the opv2 client by setting the connect_host and connect_token parameters (https://github.com/ansible-collections/community.general/pull/7116)
|
||||
- opentelemetry - add support for HTTP trace_exporter and configures the behavior via ``OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`` (https://github.com/ansible-collections/community.general/issues/7888, https://github.com/ansible-collections/community.general/pull/8321).
|
||||
- opentelemetry - add support for exporting spans in a file via ``ANSIBLE_OPENTELEMETRY_STORE_SPANS_IN_FILE`` (https://github.com/ansible-collections/community.general/issues/7888, https://github.com/ansible-collections/community.general/pull/8363).
|
||||
- opkg - use ``ModuleHelper`` with ``VarDict`` (https://github.com/ansible-collections/community.general/pull/8226).
|
||||
- osx_defaults - add option ``check_types`` to enable changing the type of existing defaults on the fly (https://github.com/ansible-collections/community.general/pull/8173).
|
||||
- parted - refactor module to pass list of arguments to ``module.run_command()`` instead of relying on interpretation by a shell (https://github.com/ansible-collections/community.general/pull/8264).
|
||||
- passwordstore - adds ``timestamp`` and ``preserve`` parameters to modify the stored password format (https://github.com/ansible-collections/community.general/pull/7426).
|
||||
- passwordstore lookup - add ``missing_subkey`` parameter defining the behavior of the lookup when a passwordstore subkey is missing (https://github.com/ansible-collections/community.general/pull/8166).
|
||||
- pipx - use ``ModuleHelper`` with ``VarDict`` (https://github.com/ansible-collections/community.general/pull/8226).
|
||||
- pkg5 - add support for non-silent execution (https://github.com/ansible-collections/community.general/issues/8379, https://github.com/ansible-collections/community.general/pull/8382).
|
||||
- pkgin - refactor module to pass list of arguments to ``module.run_command()`` instead of relying on interpretation by a shell (https://github.com/ansible-collections/community.general/pull/8264).
|
||||
- portage - adds the possibility to explicitely tell portage to write packages to world file (https://github.com/ansible-collections/community.general/issues/6226, https://github.com/ansible-collections/community.general/pull/8236).
|
||||
- portinstall - refactor module to pass list of arguments to ``module.run_command()`` instead of relying on interpretation by a shell (https://github.com/ansible-collections/community.general/pull/8264).
|
||||
- proxmox - adds ``startup`` parameters to configure startup order, startup delay and shutdown delay (https://github.com/ansible-collections/community.general/pull/8038).
|
||||
- proxmox - adds ``template`` value to the ``state`` parameter, allowing conversion of container to a template (https://github.com/ansible-collections/community.general/pull/7143).
|
||||
- proxmox - adds ``update`` parameter, allowing update of an already existing containers configuration (https://github.com/ansible-collections/community.general/pull/7540).
|
||||
- proxmox inventory plugin - adds an option to exclude nodes from the dynamic inventory generation. The new setting is optional, not using this option will behave as usual (https://github.com/ansible-collections/community.general/issues/6714, https://github.com/ansible-collections/community.general/pull/7461).
|
||||
- proxmox* modules - there is now a ``community.general.proxmox`` module defaults group that can be used to set default options for all Proxmox modules (https://github.com/ansible-collections/community.general/pull/8334).
|
||||
- proxmox_disk - add ability to manipulate CD-ROM drive (https://github.com/ansible-collections/community.general/pull/7495).
|
||||
- proxmox_kvm - add parameter ``update_unsafe`` to avoid limitations when updating dangerous values (https://github.com/ansible-collections/community.general/pull/7843).
|
||||
- proxmox_kvm - adds ``template`` value to the ``state`` parameter, allowing conversion of a VM to a template (https://github.com/ansible-collections/community.general/pull/7143).
|
||||
- proxmox_kvm - adds``usb`` parameter for setting USB devices on proxmox KVM VMs (https://github.com/ansible-collections/community.general/pull/8199).
|
||||
- proxmox_kvm - support the ``hookscript`` parameter (https://github.com/ansible-collections/community.general/issues/7600).
|
||||
- proxmox_ostype - it is now possible to specify the ``ostype`` when creating an LXC container (https://github.com/ansible-collections/community.general/pull/7462).
|
||||
- proxmox_vm_info - add ability to retrieve configuration info (https://github.com/ansible-collections/community.general/pull/7485).
|
||||
- puppet - new feature to set ``--waitforlock`` option (https://github.com/ansible-collections/community.general/pull/8282).
|
||||
- redfish_command - add command ``ResetToDefaults`` to reset manager to default state (https://github.com/ansible-collections/community.general/issues/8163).
|
||||
- redfish_config - add command ``SetServiceIdentification`` to set service identification (https://github.com/ansible-collections/community.general/issues/7916).
|
||||
- redfish_info - add boolean return value ``MultipartHttpPush`` to ``GetFirmwareUpdateCapabilities`` (https://github.com/ansible-collections/community.general/issues/8194, https://github.com/ansible-collections/community.general/pull/8195).
|
||||
- redfish_info - add command ``GetServiceIdentification`` to get service identification (https://github.com/ansible-collections/community.general/issues/7882).
|
||||
- redfish_info - adding the ``BootProgress`` property when getting ``Systems`` info (https://github.com/ansible-collections/community.general/pull/7626).
|
||||
- revbitspss lookup plugin - removed a redundant unicode prefix. The prefix was not necessary for Python 3 and has been cleaned up to streamline the code (https://github.com/ansible-collections/community.general/pull/8087).
|
||||
- rundeck module utils - allow to pass ``Content-Type`` to API requests (https://github.com/ansible-collections/community.general/pull/7684).
|
||||
- slackpkg - refactor module to pass list of arguments to ``module.run_command()`` instead of relying on interpretation by a shell (https://github.com/ansible-collections/community.general/pull/8264).
|
||||
- ssh_config - adds ``controlmaster``, ``controlpath`` and ``controlpersist`` parameters (https://github.com/ansible-collections/community.general/pull/7456).
|
||||
- ssh_config - allow ``accept-new`` as valid value for ``strict_host_key_checking`` (https://github.com/ansible-collections/community.general/pull/8257).
|
||||
- ssh_config - new feature to set ``AddKeysToAgent`` option to ``yes`` or ``no`` (https://github.com/ansible-collections/community.general/pull/7703).
|
||||
- ssh_config - new feature to set ``IdentitiesOnly`` option to ``yes`` or ``no`` (https://github.com/ansible-collections/community.general/pull/7704).
|
||||
- sudoers - add support for the ``NOEXEC`` tag in sudoers rules (https://github.com/ansible-collections/community.general/pull/7983).
|
||||
- svr4pkg - refactor module to pass list of arguments to ``module.run_command()`` instead of relying on interpretation by a shell (https://github.com/ansible-collections/community.general/pull/8264).
|
||||
- swdepot - refactor module to pass list of arguments to ``module.run_command()`` instead of relying on interpretation by a shell (https://github.com/ansible-collections/community.general/pull/8264).
|
||||
- terraform - add support for ``diff_mode`` for terraform resource_changes (https://github.com/ansible-collections/community.general/pull/7896).
|
||||
- terraform - fix ``diff_mode`` in state ``absent`` and when terraform ``resource_changes`` does not exist (https://github.com/ansible-collections/community.general/pull/7963).
|
||||
- xcc_redfish_command - added support for raw POSTs (``command=PostResource`` in ``category=Raw``) without a specific action info (https://github.com/ansible-collections/community.general/pull/7746).
|
||||
- xfconf - use ``ModuleHelper`` with ``VarDict`` (https://github.com/ansible-collections/community.general/pull/8226).
|
||||
- xfconf_info - use ``ModuleHelper`` with ``VarDict`` (https://github.com/ansible-collections/community.general/pull/8226).
|
||||
|
||||
Breaking Changes / Porting Guide
|
||||
--------------------------------
|
||||
|
||||
- cpanm - the default of the ``mode`` option changed from ``compatibility`` to ``new`` (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
- django_manage - the module now requires Django >= 4.1 (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
- django_manage - the module will now fail if ``virtualenv`` is specified but no virtual environment exists at that location (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
- redfish_command, redfish_config, redfish_info - change the default for ``timeout`` from 10 to 60 (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
|
||||
Deprecated Features
|
||||
-------------------
|
||||
|
||||
- MH DependencyCtxMgr module_utils - deprecate ``module_utils.mh.mixin.deps.DependencyCtxMgr`` in favour of ``module_utils.deps`` (https://github.com/ansible-collections/community.general/pull/8280).
|
||||
- ModuleHelper module_utils - deprecate ``plugins.module_utils.module_helper.AnsibleModule`` (https://github.com/ansible-collections/community.general/pull/8280).
|
||||
- ModuleHelper module_utils - deprecate ``plugins.module_utils.module_helper.DependencyCtxMgr`` (https://github.com/ansible-collections/community.general/pull/8280).
|
||||
- ModuleHelper module_utils - deprecate ``plugins.module_utils.module_helper.StateMixin`` (https://github.com/ansible-collections/community.general/pull/8280).
|
||||
- ModuleHelper module_utils - deprecate ``plugins.module_utils.module_helper.VarDict,`` (https://github.com/ansible-collections/community.general/pull/8280).
|
||||
- ModuleHelper module_utils - deprecate ``plugins.module_utils.module_helper.VarMeta`` (https://github.com/ansible-collections/community.general/pull/8280).
|
||||
- ModuleHelper module_utils - deprecate ``plugins.module_utils.module_helper.VarsMixin`` (https://github.com/ansible-collections/community.general/pull/8280).
|
||||
- ModuleHelper module_utils - deprecate use of ``VarsMixin`` in favor of using the ``VardDict`` module_utils (https://github.com/ansible-collections/community.general/pull/8226).
|
||||
- ModuleHelper vars module_utils - bump deprecation of ``VarMeta``, ``VarDict`` and ``VarsMixin`` to version 11.0.0 (https://github.com/ansible-collections/community.general/pull/8226).
|
||||
- apt_rpm - the behavior of ``state=present`` and ``state=installed`` is deprecated and will change in community.general 11.0.0. Right now the module will upgrade a package to the latest version if one of these two states is used. You should explicitly use ``state=latest`` if you want this behavior, and switch to ``state=present_not_latest`` if you do not want to upgrade the package if it is already installed. In community.general 11.0.0 the behavior of ``state=present`` and ``state=installed`` will change to that of ``state=present_not_latest`` (https://github.com/ansible-collections/community.general/issues/8217, https://github.com/ansible-collections/community.general/pull/8285).
|
||||
- consul_acl - the module has been deprecated and will be removed in community.general 10.0.0. ``consul_token`` and ``consul_policy`` can be used instead (https://github.com/ansible-collections/community.general/pull/7901).
|
||||
- django_manage - the ``ack_venv_creation_deprecation`` option has no more effect and will be removed from community.general 11.0.0 (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
- gitlab modules - the basic auth method on GitLab API have been deprecated and will be removed in community.general 10.0.0 (https://github.com/ansible-collections/community.general/pull/8383).
|
||||
- hipchat callback plugin - the hipchat service has been discontinued and the self-hosted variant has been End of Life since 2020. The callback plugin is therefore deprecated and will be removed from community.general 10.0.0 if nobody provides compelling reasons to still keep it (https://github.com/ansible-collections/community.general/issues/8184, https://github.com/ansible-collections/community.general/pull/8189).
|
||||
- irc - the defaults ``false`` for ``use_tls`` and ``validate_certs`` have been deprecated and will change to ``true`` in community.general 10.0.0 to improve security. You can already improve security now by explicitly setting them to ``true``. Specifying values now disables the deprecation warning (https://github.com/ansible-collections/community.general/pull/7578).
|
||||
|
||||
Removed Features (previously deprecated)
|
||||
----------------------------------------
|
||||
|
||||
- The deprecated redirects for internal module names have been removed. These internal redirects were extra-long FQCNs like ``community.general.packaging.os.apt_rpm`` that redirect to the short FQCN ``community.general.apt_rpm``. They were originally needed to implement flatmapping; as various tooling started to recommend users to use the long names flatmapping was removed from the collection and redirects were added for users who already followed these incorrect recommendations (https://github.com/ansible-collections/community.general/pull/7835).
|
||||
- ansible_galaxy_install - the ``ack_ansible29`` and ``ack_min_ansiblecore211`` options have been removed. They no longer had any effect (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
- cloudflare_dns - remove support for SPF records. These are no longer supported by CloudFlare (https://github.com/ansible-collections/community.general/pull/7782).
|
||||
- django_manage - support for the ``command`` values ``cleanup``, ``syncdb``, and ``validate`` were removed. Use ``clearsessions``, ``migrate``, and ``check`` instead, respectively (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
- flowdock - this module relied on HTTPS APIs that do not exist anymore and was thus removed (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
- mh.mixins.deps module utils - the ``DependencyMixin`` has been removed. Use the ``deps`` module utils instead (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
- proxmox - the ``proxmox_default_behavior`` option has been removed (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
- rax* modules, rax module utils, rax docs fragment - the Rackspace modules relied on the deprecated package ``pyrax`` and were thus removed (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
- redhat module utils - the classes ``Rhsm``, ``RhsmPool``, and ``RhsmPools`` have been removed (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
- redhat_subscription - the alias ``autosubscribe`` of the ``auto_attach`` option was removed (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
- stackdriver - this module relied on HTTPS APIs that do not exist anymore and was thus removed (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
- webfaction_* modules - these modules relied on HTTPS APIs that do not exist anymore and were thus removed (https://github.com/ansible-collections/community.general/pull/8198).
|
||||
|
||||
Security Fixes
|
||||
--------------
|
||||
|
||||
- cobbler, gitlab_runners, icinga2, linode, lxd, nmap, online, opennebula, proxmox, scaleway, stackpath_compute, virtualbox, and xen_orchestra inventory plugin - make sure all data received from the remote servers is marked as unsafe, so remote code execution by obtaining texts that can be evaluated as templates is not possible (https://www.die-welt.net/2024/03/remote-code-execution-in-ansible-dynamic-inventory-plugins/, https://github.com/ansible-collections/community.general/pull/8098).
|
||||
- keycloak_identity_provider - the client secret was not correctly sanitized by the module. The return values ``proposed``, ``existing``, and ``end_state``, as well as the diff, did contain the client secret unmasked (https://github.com/ansible-collections/community.general/pull/8355).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- aix_filesystem - fix ``_validate_vg`` not passing VG name to ``lsvg_cmd`` (https://github.com/ansible-collections/community.general/issues/8151).
|
||||
- aix_filesystem - fix issue with empty list items in crfs logic and option order (https://github.com/ansible-collections/community.general/pull/8052).
|
||||
- apt-rpm - the module did not upgrade packages if a newer version exists. Now the package will be reinstalled if the candidate is newer than the installed version (https://github.com/ansible-collections/community.general/issues/7414).
|
||||
- apt_rpm - when checking whether packages were installed after running ``apt-get -y install <packages>``, only the last package name was checked (https://github.com/ansible-collections/community.general/pull/8263).
|
||||
- bitwarden_secrets_manager lookup plugin - implements retry with exponential backoff to avoid lookup errors when Bitwardn's API rate limiting is encountered (https://github.com/ansible-collections/community.general/issues/8230, https://github.com/ansible-collections/community.general/pull/8238).
|
||||
- cargo - fix idempotency issues when using a custom installation path for packages (using the ``--path`` parameter). The initial installation runs fine, but subsequent runs use the ``get_installed()`` function which did not check the given installation location, before running ``cargo install``. This resulted in a false ``changed`` state. Also the removal of packeges using ``state: absent`` failed, as the installation check did not use the given parameter (https://github.com/ansible-collections/community.general/pull/7970).
|
||||
- cloudflare_dns - fix Cloudflare lookup of SHFP records (https://github.com/ansible-collections/community.general/issues/7652).
|
||||
- consul_token - fix token creation without ``accessor_id`` (https://github.com/ansible-collections/community.general/pull/8091).
|
||||
- from_ini filter plugin - disabling interpolation of ``ConfigParser`` to allow converting values with a ``%`` sign (https://github.com/ansible-collections/community.general/issues/8183, https://github.com/ansible-collections/community.general/pull/8185).
|
||||
- gitlab_group_members - fix gitlab constants call in ``gitlab_group_members`` module (https://github.com/ansible-collections/community.general/issues/7467).
|
||||
- gitlab_issue - fix behavior to search GitLab issue, using ``search`` keyword instead of ``title`` (https://github.com/ansible-collections/community.general/issues/7846).
|
||||
- gitlab_issue, gitlab_label, gitlab_milestone - avoid crash during version comparison when the python-gitlab Python module is not installed (https://github.com/ansible-collections/community.general/pull/8158).
|
||||
- gitlab_project_members - fix gitlab constants call in ``gitlab_project_members`` module (https://github.com/ansible-collections/community.general/issues/7467).
|
||||
- gitlab_protected_branches - fix gitlab constants call in ``gitlab_protected_branches`` module (https://github.com/ansible-collections/community.general/issues/7467).
|
||||
- gitlab_runner - fix pagination when checking for existing runners (https://github.com/ansible-collections/community.general/pull/7790).
|
||||
- gitlab_user - fix gitlab constants call in ``gitlab_user`` module (https://github.com/ansible-collections/community.general/issues/7467).
|
||||
- haproxy - fix an issue where HAProxy could get stuck in DRAIN mode when the backend was unreachable (https://github.com/ansible-collections/community.general/issues/8092).
|
||||
- homebrew - detect already installed formulae and casks using JSON output from ``brew info`` (https://github.com/ansible-collections/community.general/issues/864).
|
||||
- homebrew - error returned from brew command was ignored and tried to parse empty JSON. Fix now checks for an error and raises it to give accurate error message to users (https://github.com/ansible-collections/community.general/issues/8047).
|
||||
- incus connection plugin - treats ``inventory_hostname`` as a variable instead of a literal in remote connections (https://github.com/ansible-collections/community.general/issues/7874).
|
||||
- interface_files - also consider ``address_family`` when changing ``option=method`` (https://github.com/ansible-collections/community.general/issues/7610, https://github.com/ansible-collections/community.general/pull/7612).
|
||||
- inventory plugins - add unsafe wrapper to avoid marking strings that do not contain ``{`` or ``}`` as unsafe, to work around a bug in AWX ((https://github.com/ansible-collections/community.general/issues/8212, https://github.com/ansible-collections/community.general/pull/8225).
|
||||
- ipa - fix get version regex in IPA module_utils (https://github.com/ansible-collections/community.general/pull/8175).
|
||||
- ipa_hbacrule - the module uses a string for ``ipaenabledflag`` for new FreeIPA versions while the returned value is a boolean (https://github.com/ansible-collections/community.general/pull/7880).
|
||||
- ipa_otptoken - the module expect ``ipatokendisabled`` as string but the ``ipatokendisabled`` value is returned as a boolean (https://github.com/ansible-collections/community.general/pull/7795).
|
||||
- ipa_sudorule - the module uses a string for ``ipaenabledflag`` for new FreeIPA versions while the returned value is a boolean (https://github.com/ansible-collections/community.general/pull/7880).
|
||||
- iptables_state - fix idempotency issues when restoring incomplete iptables dumps (https://github.com/ansible-collections/community.general/issues/8029).
|
||||
- irc - replace ``ssl.wrap_socket`` that was removed from Python 3.12 with code for creating a proper SSL context (https://github.com/ansible-collections/community.general/pull/7542).
|
||||
- keycloak_* - fix Keycloak API client to quote ``/`` properly (https://github.com/ansible-collections/community.general/pull/7641).
|
||||
- keycloak_authz_permission - resource payload variable for scope-based permission was constructed as a string, when it needs to be a list, even for a single item (https://github.com/ansible-collections/community.general/issues/7151).
|
||||
- keycloak_client - add sorted ``defaultClientScopes`` and ``optionalClientScopes`` to normalizations (https://github.com/ansible-collections/community.general/pull/8223).
|
||||
- keycloak_client - fixes issue when metadata is provided in desired state when task is in check mode (https://github.com/ansible-collections/community.general/issues/1226, https://github.com/ansible-collections/community.general/pull/7881).
|
||||
- keycloak_identity_provider - ``mappers`` processing was not idempotent if the mappers configuration list had not been sorted by name (in ascending order). Fix resolves the issue by sorting mappers in the desired state using the same key which is used for obtaining existing state (https://github.com/ansible-collections/community.general/pull/7418).
|
||||
- keycloak_identity_provider - it was not possible to reconfigure (add, remove) ``mappers`` once they were created initially. Removal was ignored, adding new ones resulted in dropping the pre-existing unmodified mappers. Fix resolves the issue by supplying correct input to the internal update call (https://github.com/ansible-collections/community.general/pull/7418).
|
||||
- keycloak_realm - add normalizations for ``enabledEventTypes`` and ``supportedLocales`` (https://github.com/ansible-collections/community.general/pull/8224).
|
||||
- keycloak_user - when ``force`` is set, but user does not exist, do not try to delete it (https://github.com/ansible-collections/community.general/pull/7696).
|
||||
- keycloak_user_federation - fix diff of empty ``krbPrincipalAttribute`` (https://github.com/ansible-collections/community.general/pull/8320).
|
||||
- ldap - previously the order number (if present) was expected to follow an equals sign in the DN. This makes it so the order number string is identified correctly anywhere within the DN (https://github.com/ansible-collections/community.general/issues/7646).
|
||||
- linode inventory plugin - add descriptive error message for linode inventory plugin (https://github.com/ansible-collections/community.general/pull/8133).
|
||||
- log_entries callback plugin - replace ``ssl.wrap_socket`` that was removed from Python 3.12 with code for creating a proper SSL context (https://github.com/ansible-collections/community.general/pull/7542).
|
||||
- lvol - test for output messages in both ``stdout`` and ``stderr`` (https://github.com/ansible-collections/community.general/pull/7601, https://github.com/ansible-collections/community.general/issues/7182).
|
||||
- merge_variables lookup plugin - fixing cross host merge: providing access to foreign hosts variables to the perspective of the host that is performing the merge (https://github.com/ansible-collections/community.general/pull/8303).
|
||||
- modprobe - listing modules files or modprobe files could trigger a FileNotFoundError if ``/etc/modprobe.d`` or ``/etc/modules-load.d`` did not exist. Relevant functions now return empty lists if the directories do not exist to avoid crashing the module (https://github.com/ansible-collections/community.general/issues/7717).
|
||||
- mssql_script - make the module work with Python 2 (https://github.com/ansible-collections/community.general/issues/7818, https://github.com/ansible-collections/community.general/pull/7821).
|
||||
- nmcli - fix ``connection.slave-type`` wired to ``bond`` and not with parameter ``slave_type`` in case of connection type ``wifi`` (https://github.com/ansible-collections/community.general/issues/7389).
|
||||
- ocapi_utils, oci_utils, redfish_utils module utils - replace ``type()`` calls with ``isinstance()`` calls (https://github.com/ansible-collections/community.general/pull/7501).
|
||||
- onepassword lookup plugin - failed for fields that were in sections and had uppercase letters in the label/ID. Field lookups are now case insensitive in all cases (https://github.com/ansible-collections/community.general/pull/7919).
|
||||
- onepassword lookup plugin - field and section titles are now case insensitive when using op CLI version two or later. This matches the behavior of version one (https://github.com/ansible-collections/community.general/pull/7564).
|
||||
- opentelemetry callback plugin - close spans always (https://github.com/ansible-collections/community.general/pull/8367).
|
||||
- opentelemetry callback plugin - honour the ``disable_logs`` option to avoid storing task results since they are not used regardless (https://github.com/ansible-collections/community.general/pull/8373).
|
||||
- pacemaker_cluster - actually implement check mode, which the module claims to support. This means that until now the module also did changes in check mode (https://github.com/ansible-collections/community.general/pull/8081).
|
||||
- pam_limits - when the file does not exist, do not create it in check mode (https://github.com/ansible-collections/community.general/issues/8050, https://github.com/ansible-collections/community.general/pull/8057).
|
||||
- pipx module utils - change the CLI argument formatter for the ``pip_args`` parameter (https://github.com/ansible-collections/community.general/issues/7497, https://github.com/ansible-collections/community.general/pull/7506).
|
||||
- pkgin - pkgin (pkgsrc package manager used by SmartOS) raises erratic exceptions and spurious ``changed=true`` (https://github.com/ansible-collections/community.general/pull/7971).
|
||||
- proxmox - fix updating a container config if the setting does not already exist (https://github.com/ansible-collections/community.general/pull/7872).
|
||||
- proxmox_kvm - fixed status check getting from node-specific API endpoint (https://github.com/ansible-collections/community.general/issues/7817).
|
||||
- proxmox_kvm - running ``state=template`` will first check whether VM is already a template (https://github.com/ansible-collections/community.general/pull/7792).
|
||||
- proxmox_pool_member - absent state for type VM did not delete VMs from the pools (https://github.com/ansible-collections/community.general/pull/7464).
|
||||
- puppet - add option ``environment_lang`` to set the environment language encoding. Defaults to lang ``C``. It is recommended to set it to ``C.UTF-8`` or ``en_US.UTF-8`` depending on what is available on your system. (https://github.com/ansible-collections/community.general/issues/8000)
|
||||
- redfish_command - fix usage of message parsing in ``SimpleUpdate`` and ``MultipartHTTPPushUpdate`` commands to treat the lack of a ``MessageId`` as no message (https://github.com/ansible-collections/community.general/issues/7465, https://github.com/ansible-collections/community.general/pull/7471).
|
||||
- redfish_info - allow for a GET operation invoked by ``GetUpdateStatus`` to allow for an empty response body for cases where a service returns 204 No Content (https://github.com/ansible-collections/community.general/issues/8003).
|
||||
- redfish_info - correct uncaught exception when attempting to retrieve ``Chassis`` information (https://github.com/ansible-collections/community.general/pull/7952).
|
||||
- redhat_subscription - use the D-Bus registration on RHEL 7 only on 7.4 and
|
||||
greater; older versions of RHEL 7 do not have it
|
||||
(https://github.com/ansible-collections/community.general/issues/7622,
|
||||
https://github.com/ansible-collections/community.general/pull/7624).
|
||||
- riak - support ``riak admin`` sub-command in newer Riak KV versions beside the legacy ``riak-admin`` main command (https://github.com/ansible-collections/community.general/pull/8211).
|
||||
- statusio_maintenance - fix error caused by incorrectly formed API data payload. Was raising "Failed to create maintenance HTTP Error 400 Bad Request" caused by bad data type for date/time and deprecated dict keys (https://github.com/ansible-collections/community.general/pull/7754).
|
||||
- terraform - fix multiline string handling in complex variables (https://github.com/ansible-collections/community.general/pull/7535).
|
||||
- to_ini filter plugin - disabling interpolation of ``ConfigParser`` to allow converting values with a ``%`` sign (https://github.com/ansible-collections/community.general/issues/8183, https://github.com/ansible-collections/community.general/pull/8185).
|
||||
- xml - make module work with lxml 5.1.1, which removed some internals that the module was relying on (https://github.com/ansible-collections/community.general/pull/8169).
|
||||
|
||||
New Plugins
|
||||
-----------
|
||||
|
||||
Become
|
||||
~~~~~~
|
||||
|
||||
- community.general.run0 - Systemd's run0.
|
||||
|
||||
Callback
|
||||
~~~~~~~~
|
||||
|
||||
- community.general.default_without_diff - The default ansible callback without diff output.
|
||||
- community.general.timestamp - Adds simple timestamp for each header.
|
||||
|
||||
Connection
|
||||
~~~~~~~~~~
|
||||
|
||||
- community.general.incus - Run tasks in Incus instances via the Incus CLI.
|
||||
|
||||
Filter
|
||||
~~~~~~
|
||||
|
||||
- community.general.from_ini - Converts INI text input into a dictionary.
|
||||
- community.general.lists_difference - Difference of lists with a predictive order.
|
||||
- community.general.lists_intersect - Intersection of lists with a predictive order.
|
||||
- community.general.lists_symmetric_difference - Symmetric Difference of lists with a predictive order.
|
||||
- community.general.lists_union - Union of lists with a predictive order.
|
||||
- community.general.to_ini - Converts a dictionary to the INI file format.
|
||||
|
||||
Lookup
|
||||
~~~~~~
|
||||
|
||||
- community.general.github_app_access_token - Obtain short-lived Github App Access tokens.
|
||||
- community.general.onepassword_doc - Fetch documents stored in 1Password.
|
||||
|
||||
Test
|
||||
~~~~
|
||||
|
||||
- community.general.fqdn_valid - Validates fully-qualified domain names against RFC 1123.
|
||||
|
||||
New Modules
|
||||
-----------
|
||||
|
||||
- community.general.consul_acl_bootstrap - Bootstrap ACLs in Consul.
|
||||
- community.general.consul_auth_method - Manipulate Consul auth methods.
|
||||
- community.general.consul_binding_rule - Manipulate Consul binding rules.
|
||||
- community.general.consul_token - Manipulate Consul tokens.
|
||||
- community.general.django_command - Run Django admin commands.
|
||||
- community.general.dnf_config_manager - Enable or disable dnf repositories using config-manager.
|
||||
- community.general.git_config_info - Read git configuration.
|
||||
- community.general.gitlab_group_access_token - Manages GitLab group access tokens.
|
||||
- community.general.gitlab_issue - Create, update, or delete GitLab issues.
|
||||
- community.general.gitlab_label - Creates/updates/deletes GitLab Labels belonging to project or group.
|
||||
- community.general.gitlab_milestone - Creates/updates/deletes GitLab Milestones belonging to project or group.
|
||||
- community.general.gitlab_project_access_token - Manages GitLab project access tokens.
|
||||
- community.general.keycloak_client_rolescope - Allows administration of Keycloak client roles scope to restrict the usage of certain roles to a other specific client applications.
|
||||
- community.general.keycloak_component_info - Retrive component info in Keycloak.
|
||||
- community.general.keycloak_realm_rolemapping - Allows administration of Keycloak realm role mappings into groups with the Keycloak API.
|
||||
- community.general.nomad_token - Manage Nomad ACL tokens.
|
||||
- community.general.proxmox_node_info - Retrieve information about one or more Proxmox VE nodes.
|
||||
- community.general.proxmox_storage_contents_info - List content from a Proxmox VE storage.
|
||||
- community.general.usb_facts - Allows listing information about USB devices.
|
||||
|
|
16
README.md
16
README.md
|
@ -6,10 +6,10 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||
|
||||
# Community General Collection
|
||||
|
||||
[](https://docs.ansible.com/ansible/devel/collections/community/general/)
|
||||
[](https://dev.azure.com/ansible/community.general/_build?definitionId=31)
|
||||
[](https://github.com/ansible-collections/community.general/actions)
|
||||
[](https://github.com/ansible-collections/community.general/actions)
|
||||
[](https://docs.ansible.com/ansible/latest/collections/community/general/)
|
||||
[](https://dev.azure.com/ansible/community.general/_build?definitionId=31)
|
||||
[](https://github.com/ansible-collections/community.general/actions)
|
||||
[](https://github.com/ansible-collections/community.general/actions)
|
||||
[](https://codecov.io/gh/ansible-collections/community.general)
|
||||
[](https://api.reuse.software/info/github.com/ansible-collections/community.general)
|
||||
|
||||
|
@ -39,7 +39,7 @@ For more information about communication, see the [Ansible communication guide](
|
|||
|
||||
## Tested with Ansible
|
||||
|
||||
Tested with the current ansible-core 2.16, ansible-core 2.17, ansible-core 2.18, ansible-core 2.19 releases and the current development version of ansible-core. Ansible-core versions before 2.16.0 are not supported. This includes all ansible-base 2.10 and Ansible 2.9 releases.
|
||||
Tested with the current ansible-core 2.13, ansible-core 2.14, ansible-core 2.15, ansible-core 2.16, ansible-core 2.17, ansible-core 2.18, and ansible-core 2.19 releases. Ansible-core versions before 2.13.0 are not supported. This includes all ansible-base 2.10 and Ansible 2.9 releases.
|
||||
|
||||
## External requirements
|
||||
|
||||
|
@ -118,7 +118,7 @@ See the [Releasing guidelines](https://github.com/ansible/community-docs/blob/ma
|
|||
|
||||
## Release notes
|
||||
|
||||
See the [changelog](https://github.com/ansible-collections/community.general/blob/main/CHANGELOG.md).
|
||||
See the [changelog](https://github.com/ansible-collections/community.general/blob/stable-9/CHANGELOG.md).
|
||||
|
||||
## Roadmap
|
||||
|
||||
|
@ -137,8 +137,8 @@ See [this issue](https://github.com/ansible-collections/community.general/issues
|
|||
|
||||
This collection is primarily licensed and distributed as a whole under the GNU General Public License v3.0 or later.
|
||||
|
||||
See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.general/blob/main/COPYING) for the full text.
|
||||
See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.general/blob/stable-9/COPYING) for the full text.
|
||||
|
||||
Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/BSD-2-Clause.txt), the [MIT license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/MIT.txt), and the [PSF 2.0 license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/PSF-2.0.txt).
|
||||
Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.general/blob/stable-9/LICENSES/BSD-2-Clause.txt), the [MIT license](https://github.com/ansible-collections/community.general/blob/stable-9/LICENSES/MIT.txt), and the [PSF 2.0 license](https://github.com/ansible-collections/community.general/blob/stable-9/LICENSES/PSF-2.0.txt).
|
||||
|
||||
All files have a machine readable `SDPX-License-Identifier:` comment denoting its respective license(s) or an equivalent entry in an accompanying `.license` file. Only changelog fragments (which will not be part of a release) are covered by a blanket statement in `REUSE.toml`. This conforms to the [REUSE specification](https://reuse.software/spec/).
|
||||
|
|
|
@ -8,39 +8,24 @@
|
|||
"community.docker" = "git+https://github.com/ansible-collections/community.docker.git,main"
|
||||
"community.internal_test_tools" = "git+https://github.com/ansible-collections/community.internal_test_tools.git,main"
|
||||
|
||||
[collection_sources_per_ansible.'2.13']
|
||||
"community.crypto" = "git+https://github.com/ansible-collections/community.crypto.git,stable-2"
|
||||
|
||||
[collection_sources_per_ansible.'2.14']
|
||||
"community.crypto" = "git+https://github.com/ansible-collections/community.crypto.git,stable-2"
|
||||
|
||||
[collection_sources_per_ansible.'2.15']
|
||||
# community.crypto's main branch needs ansible-core >= 2.17
|
||||
"community.crypto" = "git+https://github.com/ansible-collections/community.crypto.git,stable-2"
|
||||
|
||||
[collection_sources_per_ansible.'2.16']
|
||||
# community.crypto's main branch needs ansible-core >= 2.17
|
||||
"community.crypto" = "git+https://github.com/ansible-collections/community.crypto.git,stable-2"
|
||||
|
||||
[sessions]
|
||||
|
||||
[sessions.lint]
|
||||
run_isort = false
|
||||
run_black = false
|
||||
run_flake8 = false
|
||||
run_pylint = false
|
||||
run_yamllint = true
|
||||
yamllint_config = ".yamllint"
|
||||
# yamllint_config_plugins = ".yamllint-docs"
|
||||
# yamllint_config_plugins_examples = ".yamllint-examples"
|
||||
run_mypy = false
|
||||
|
||||
[sessions.docs_check]
|
||||
validate_collection_refs="all"
|
||||
codeblocks_restrict_types = [
|
||||
"ansible-output",
|
||||
"console",
|
||||
"ini",
|
||||
"json",
|
||||
"python",
|
||||
"shell",
|
||||
"yaml",
|
||||
"yaml+jinja",
|
||||
"text",
|
||||
]
|
||||
codeblocks_restrict_type_exact_case = true
|
||||
codeblocks_allow_without_type = false
|
||||
codeblocks_allow_literal_blocks = false
|
||||
|
||||
[sessions.license_check]
|
||||
|
||||
|
@ -49,41 +34,30 @@ run_no_unwanted_files = true
|
|||
no_unwanted_files_module_extensions = [".py"]
|
||||
no_unwanted_files_yaml_extensions = [".yml"]
|
||||
run_action_groups = true
|
||||
run_no_trailing_whitespace = true
|
||||
no_trailing_whitespace_skip_paths = [
|
||||
"tests/integration/targets/iso_extract/files/test.iso",
|
||||
"tests/integration/targets/java_cert/files/testpkcs.p12",
|
||||
"tests/integration/targets/one_host/files/testhost/tmp/opennebula-fixtures.json.gz",
|
||||
"tests/integration/targets/one_template/files/testhost/tmp/opennebula-fixtures.json.gz",
|
||||
"tests/integration/targets/setup_flatpak_remote/files/repo.tar.xz",
|
||||
]
|
||||
no_trailing_whitespace_skip_directories = [
|
||||
"tests/unit/plugins/modules/interfaces_file/interfaces_file_fixtures/golden_output/",
|
||||
"tests/unit/plugins/modules/interfaces_file/interfaces_file_fixtures/input/",
|
||||
]
|
||||
|
||||
[[sessions.extra_checks.action_groups_config]]
|
||||
name = "consul"
|
||||
pattern = "^consul_.*$"
|
||||
exclusions = [
|
||||
"consul_acl",
|
||||
"consul_acl_bootstrap",
|
||||
"consul_kv",
|
||||
]
|
||||
doc_fragment = "community.general.consul.actiongroup_consul"
|
||||
|
||||
[[sessions.extra_checks.action_groups_config]]
|
||||
name = "keycloak"
|
||||
pattern = "^keycloak_.*$"
|
||||
exclusions = [
|
||||
"keycloak_realm_info",
|
||||
]
|
||||
doc_fragment = "community.general.keycloak.actiongroup_keycloak"
|
||||
name = "proxmox"
|
||||
pattern = "^proxmox(_.*)?$"
|
||||
exclusions = []
|
||||
doc_fragment = "community.general.proxmox.actiongroup_proxmox"
|
||||
|
||||
[sessions.build_import_check]
|
||||
run_galaxy_importer = true
|
||||
|
||||
[sessions.ansible_test_sanity]
|
||||
include_devel = true
|
||||
include_devel = false
|
||||
max_version = "2.19"
|
||||
|
||||
[sessions.ansible_test_units]
|
||||
include_devel = true
|
||||
include_devel = false
|
||||
max_version = "2.19"
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -7,9 +7,9 @@ changelog_filename_template: ../CHANGELOG.rst
|
|||
changelog_filename_version_depth: 0
|
||||
changes_file: changelog.yaml
|
||||
changes_format: combined
|
||||
ignore_other_fragment_extensions: true
|
||||
keep_fragments: false
|
||||
mention_ancestor: true
|
||||
flatmap: true
|
||||
new_plugins_after_name: removed_features
|
||||
notesdir: fragments
|
||||
output_formats:
|
||||
|
@ -40,4 +40,3 @@ use_fqcn: true
|
|||
add_plugin_period: true
|
||||
changelog_nice_yaml: true
|
||||
changelog_sort: version
|
||||
vcs: auto
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
deprecated_features:
|
||||
- pacemaker_cluster - the parameter ``state`` will become a required parameter in community.general 12.0.0 (https://github.com/ansible-collections/community.general/pull/10227).
|
||||
|
||||
minor_changes:
|
||||
- pacemaker_cluster - add ``state=maintenance`` for managing pacemaker maintenance mode (https://github.com/ansible-collections/community.general/issues/10200, https://github.com/ansible-collections/community.general/pull/10227).
|
||||
- pacemaker_cluster - rename ``node`` to ``name`` and add ``node`` alias (https://github.com/ansible-collections/community.general/pull/10227).
|
||||
- pacemaker_resource - enhance module by removing duplicative code (https://github.com/ansible-collections/community.general/pull/10227).
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- keycloak - add support for ``grant_type=client_credentials`` to all keycloak modules, so that specifying ``auth_client_id`` and ``auth_client_secret`` is sufficient for authentication (https://github.com/ansible-collections/community.general/pull/10231).
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- cloudflare_dns - adds support for PTR records (https://github.com/ansible-collections/community.general/pull/10267).
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- cloudflare_dns - simplify validations and refactor some code, no functional changes (https://github.com/ansible-collections/community.general/pull/10269).
|
|
@ -1,3 +0,0 @@
|
|||
bugfixes:
|
||||
- "icinga2 inventory plugin - avoid using deprecated option when templating options (https://github.com/ansible-collections/community.general/pull/10271)."
|
||||
- "linode inventory plugin - avoid using deprecated option when templating options (https://github.com/ansible-collections/community.general/pull/10271)."
|
|
@ -1,7 +0,0 @@
|
|||
minor_changes:
|
||||
- dense callback plugin - use f-strings instead of concatenation (https://github.com/ansible-collections/community.general/pull/10285).
|
||||
- mail callback plugin - use f-strings instead of concatenation (https://github.com/ansible-collections/community.general/pull/10285).
|
||||
- wsl connection plugin - use f-strings instead of concatenation (https://github.com/ansible-collections/community.general/pull/10285).
|
||||
- jc filter plugin - use f-strings instead of concatenation (https://github.com/ansible-collections/community.general/pull/10285).
|
||||
- iocage inventory plugin - use f-strings instead of concatenation (https://github.com/ansible-collections/community.general/pull/10285).
|
||||
- xen_orchestra inventory plugin - use f-strings instead of concatenation (https://github.com/ansible-collections/community.general/pull/10285).
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- xfconf - minor adjustments the the code (https://github.com/ansible-collections/community.general/pull/10311).
|
|
@ -1,2 +0,0 @@
|
|||
minor_changes:
|
||||
- nmcli - simplify validations and refactor some code, no functional changes (https://github.com/ansible-collections/community.general/pull/10323).
|
|
@ -1,32 +0,0 @@
|
|||
minor_changes:
|
||||
- logstash callback plugin - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- keycloak module utils - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- python_runner module utils - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- cloudflare_dns - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- crypttab - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- datadog_monitor - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- gitlab_deploy_key - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- gitlab_group_access_token - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- gitlab_hook - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- gitlab_project_access_token - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- gitlab_runner - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- ipa_group - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- jenkins_build - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- jenkins_build_info - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- nmcli - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- oneandone_firewall_policy - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- oneandone_load_balancer - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- oneandone_monitoring_policy - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- onepassword_info - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- osx_defaults - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- ovh_ip_loadbalancing_backend - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- packet_device - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- pagerduty - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- pingdom - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- rhevm - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- rocketchat - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- sensu_silence - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- sl_vm - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- urpmi - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- xattr - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
||||
- xml - remove redundant brackets in conditionals, no functional changes (https://github.com/ansible-collections/community.general/pull/10328).
|
|
@ -1,2 +0,0 @@
|
|||
deprecated_features:
|
||||
- catapult - module is deprecated and will be removed in community.general 13.0.0 (https://github.com/ansible-collections/community.general/issues/10318, https://github.com/ansible-collections/community.general/pull/10329).
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- github_release - support multiple types of GitHub tokens; no longer failing when ``ghs_`` token type is provided (https://github.com/ansible-collections/community.general/issues/10338, https://github.com/ansible-collections/community.general/pull/10339).
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- incus connection plugin - fix error handling to return more useful Ansible errors to the user (https://github.com/ansible-collections/community.general/issues/10344, https://github.com/ansible-collections/community.general/pull/10349).
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- "dependent lookup plugin - avoid deprecated ansible-core 2.19 functionality (https://github.com/ansible-collections/community.general/pull/10359)."
|
|
@ -1,4 +0,0 @@
|
|||
minor_changes:
|
||||
- sysrc - adjustments to the code (https://github.com/ansible-collections/community.general/pull/10417).
|
||||
bugfixes:
|
||||
- sysrc - fixes parsing with multi-line variables (https://github.com/ansible-collections/community.general/issues/10394, https://github.com/ansible-collections/community.general/pull/10417).
|
|
@ -1,3 +0,0 @@
|
|||
bugfixes:
|
||||
- apk - handle empty name strings properly
|
||||
(https://github.com/ansible-collections/community.general/issues/10441, https://github.com/ansible-collections/community.general/pull/10442).
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- "cronvar - handle empty strings on ``value`` properly (https://github.com/ansible-collections/community.general/issues/10439, https://github.com/ansible-collections/community.general/pull/10445)."
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- capabilities - using invalid path (symlink/directory/...) returned unrelated and incoherent error messages (https://github.com/ansible-collections/community.general/issues/5649, https://github.com/ansible-collections/community.general/pull/10455).
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- "listen_port_facts - avoid crash when required commands are missing (https://github.com/ansible-collections/community.general/issues/10457, https://github.com/ansible-collections/community.general/pull/10458)."
|
|
@ -1,6 +0,0 @@
|
|||
bugfixes:
|
||||
- "apache2_module - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459)."
|
||||
- "htpasswd - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459)."
|
||||
- "syspatch - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459)."
|
||||
- "sysupgrade - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459)."
|
||||
- "zypper_repository - avoid ansible-core 2.19 deprecation (https://github.com/ansible-collections/community.general/pull/10459)."
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- "cronvar - fix crash on missing ``cron_file`` parent directories (https://github.com/ansible-collections/community.general/issues/10460, https://github.com/ansible-collections/community.general/pull/10461)."
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- "irc - pass hostname to ``wrap_socket()`` if ``use_tls=true`` and ``validate_certs=true`` (https://github.com/ansible-collections/community.general/issues/10472, https://github.com/ansible-collections/community.general/pull/10491)."
|
|
@ -1,27 +0,0 @@
|
|||
minor_changes:
|
||||
- aerospike_migrations - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- airbrake_deployment - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- bigpanda - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- bootc_manage - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- bower - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- btrfs_subvolume - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- bundler - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- campfire - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- cargo - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- catapult - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- cisco_webex - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- consul_kv - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- consul_policy - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- copr - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- datadog_downtime - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- datadog_monitor - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- dconf - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- dimensiondata_network - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- dimensiondata_vlan - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- dnf_config_manager - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- dnsmadeeasy - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- dpkg_divert - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- easy_install - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- elasticsearch_plugin - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- facter - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
||||
- filesystem - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10494).
|
|
@ -1,39 +0,0 @@
|
|||
minor_changes:
|
||||
- gem - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- git_config_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- github_deploy_key - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- github_repo - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- github_webhook - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- github_webhook_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- gitlab_branch - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- gitlab_group_access_token - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- gitlab_group_variable - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- gitlab_hook - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- gitlab_instance_variable - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- gitlab_issue - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- gitlab_label - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- gitlab_merge_request - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- gitlab_milestone - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- gitlab_project - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- gitlab_project_access_token - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- gitlab_project_variable - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- grove - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- hg - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- homebrew - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- homebrew_cask - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- homebrew_tap - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- honeybadger_deployment - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- htpasswd - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- icinga2_host - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- influxdb_user - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- ini_file - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- ipa_dnsrecord - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- ipa_dnszone - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- ipa_service - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- ipbase_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- ipwcli_dns - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- irc - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- jabber - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- jenkins_credential - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- jenkins_job - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
||||
- jenkins_script - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10505).
|
|
@ -1,35 +0,0 @@
|
|||
minor_changes:
|
||||
- keycloak_authz_authorization_scope - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- keycloak_authz_permission - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- keycloak_role - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- keycloak_userprofile - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- keyring - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- kibana_plugin - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- layman - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- ldap_attrs - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- ldap_inc - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- librato_annotation - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- lldp - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- logentries - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- lxca_cmms - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- lxca_nodes - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- macports - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- mail - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- manageiq_alerts - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- manageiq_group - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- manageiq_policies - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- manageiq_policies_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- manageiq_tags - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- manageiq_tenant - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- matrix - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- mattermost - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- maven_artifact - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- memset_dns_reload - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- memset_zone - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- memset_zone_record - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- mqtt - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- mssql_db - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- mssql_script - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- netcup_dns - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- newrelic_deployment - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
||||
- nsupdate - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10507).
|
|
@ -1,42 +0,0 @@
|
|||
minor_changes:
|
||||
- oci_vcn - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- one_image_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- one_template - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- one_vnet - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- onepassword_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- oneview_fc_network_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- opendj_backendprop - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- ovh_monthly_billing - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pagerduty - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pagerduty_change - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pagerduty_user - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pam_limits - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pear - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pkgng - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pnpm - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- portage - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pritunl_org - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pritunl_org_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pritunl_user - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pritunl_user_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pubnub_blocks - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pushbullet - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- pushover - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- redis_data - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- redis_data_incr - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- riak - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- rocketchat - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- rollbar_deployment - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- say - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- scaleway_database_backup - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- sendgrid - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- sensu_silence - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- sorcery - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- ssh_config - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- statusio_maintenance - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- svr4pkg - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- swdepot - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- syslogger - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- sysrc - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- systemd_creds_decrypt - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
||||
- systemd_creds_encrypt - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10512).
|
|
@ -1,18 +0,0 @@
|
|||
minor_changes:
|
||||
- taiga_issue - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- twilio - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- utm_aaa_group - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- utm_ca_host_key_cert - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- utm_dns_host - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- utm_network_interface_address - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- utm_proxy_auth_profile - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- utm_proxy_exception - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- utm_proxy_frontend - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- utm_proxy_location - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- vertica_configuration - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- vertica_info - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- vertica_role - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- xbps - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- yarn - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- zypper - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
||||
- zypper_repository - remove redundant constructs from argument specs (https://github.com/ansible-collections/community.general/pull/10513).
|
|
@ -1,3 +0,0 @@
|
|||
bugfixes:
|
||||
- "wsl connection plugin - avoid deprecated ansible-core paramiko import helper, import paramiko directly instead
|
||||
(https://github.com/ansible-collections/community.general/issues/10515, https://github.com/ansible-collections/community.general/pull/10531)."
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- "apk - fix check for empty/whitespace-only package names (https://github.com/ansible-collections/community.general/pull/10532)."
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- "json_query filter plugin - make compatible with lazy evaluation list and dictionary types of ansible-core 2.19 (https://github.com/ansible-collections/community.general/pull/10539)."
|
|
@ -1,2 +0,0 @@
|
|||
bugfixes:
|
||||
- "merge_variables lookup plugin - avoid deprecated functionality from ansible-core 2.19 (https://github.com/ansible-collections/community.general/pull/10566)."
|
|
@ -1,2 +0,0 @@
|
|||
deprecated_features:
|
||||
- typetalk - module is deprecated and will be removed in community.general 13.0.0 (https://github.com/ansible-collections/community.general/pull/9499).
|
|
@ -1,3 +0,0 @@
|
|||
bugfixes:
|
||||
- "doas become plugin - disable pipelining on ansible-core 2.19+. The plugin does not work with pipelining, and since ansible-core 2.19 become plugins can indicate that they do not work with pipelining (https://github.com/ansible-collections/community.general/issues/9977, https://github.com/ansible-collections/community.general/pull/10537)."
|
||||
- "machinectl become plugin - disable pipelining on ansible-core 2.19+. The plugin does not work with pipelining, and since ansible-core 2.19 become plugins can indicate that they do not work with pipelining (https://github.com/ansible-collections/community.general/pull/10537)."
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
bugfixes:
|
||||
- logstash callback plugin - remove reference to Python 2 library (https://github.com/ansible-collections/community.general/pull/10345).
|
|
@ -8,10 +8,9 @@ sections:
|
|||
toctree:
|
||||
- filter_guide
|
||||
- test_guide
|
||||
- title: Technology Guides
|
||||
- title: Cloud Guides
|
||||
toctree:
|
||||
- guide_alicloud
|
||||
- guide_iocage
|
||||
- guide_online
|
||||
- guide_packet
|
||||
- guide_scaleway
|
||||
|
@ -21,4 +20,3 @@ sections:
|
|||
- guide_vardict
|
||||
- guide_cmdrunner
|
||||
- guide_modulehelper
|
||||
- guide_uthelper
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
community.general Filter Guide
|
||||
==============================
|
||||
|
||||
The :anscollection:`community.general collection <community.general#collection>` offers several useful filter plugins.
|
||||
The :ref:`community.general collection <plugins_in_community.general>` offers several useful filter plugins.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
|
|
@ -267,54 +267,24 @@ In these descriptions ``value`` refers to the single parameter passed to the for
|
|||
+------------+-------------------------+
|
||||
|
||||
- ``cmd_runner_fmt.as_fixed()``
|
||||
This method defines one or more fixed arguments that are returned by the generated function
|
||||
regardless whether ``value`` is passed to it or not.
|
||||
|
||||
This method accepts these arguments in one of three forms:
|
||||
|
||||
* one scalar parameter ``arg``, which will be returned as ``[arg]`` by the function, or
|
||||
* one sequence parameter, such as a list, ``arg``, which will be returned by the function as ``arg[0]``, or
|
||||
* multiple parameters ``args``, which will be returned as ``args`` directly by the function.
|
||||
|
||||
See the examples below for each one of those forms. And, stressing that the generated function expects no ``value`` - if one
|
||||
This method receives one parameter ``arg``, the function expects no ``value`` - if one
|
||||
is provided then it is ignored.
|
||||
The function returns ``arg`` as-is.
|
||||
|
||||
- Creation (one scalar argument):
|
||||
* ``cmd_runner_fmt.as_fixed("--version")``
|
||||
- Creation:
|
||||
``cmd_runner_fmt.as_fixed("--version")``
|
||||
- Examples:
|
||||
+---------+--------------------------------------+
|
||||
+---------+-----------------------+
|
||||
| Value | Outcome |
|
||||
+=========+======================================+
|
||||
| | * ``["--version"]`` |
|
||||
+---------+--------------------------------------+
|
||||
| 57 | * ``["--version"]`` |
|
||||
+---------+--------------------------------------+
|
||||
|
||||
- Creation (one sequence argument):
|
||||
* ``cmd_runner_fmt.as_fixed(["--list", "--json"])``
|
||||
- Examples:
|
||||
+---------+--------------------------------------+
|
||||
| Value | Outcome |
|
||||
+=========+======================================+
|
||||
| | * ``["--list", "--json"]`` |
|
||||
+---------+--------------------------------------+
|
||||
| True | * ``["--list", "--json"]`` |
|
||||
+---------+--------------------------------------+
|
||||
|
||||
- Creation (multiple arguments):
|
||||
* ``cmd_runner_fmt.as_fixed("--one", "--two", "--three")``
|
||||
- Examples:
|
||||
+---------+--------------------------------------+
|
||||
| Value | Outcome |
|
||||
+=========+======================================+
|
||||
| | * ``["--one", "--two", "--three"]`` |
|
||||
+---------+--------------------------------------+
|
||||
| False | * ``["--one", "--two", "--three"]`` |
|
||||
+---------+--------------------------------------+
|
||||
+=========+=======================+
|
||||
| | ``["--version"]`` |
|
||||
+---------+-----------------------+
|
||||
| 57 | ``["--version"]`` |
|
||||
+---------+-----------------------+
|
||||
|
||||
- Note:
|
||||
This is the only special case in which a value can be missing for the formatting function.
|
||||
The first example here comes from the code in `Quickstart`_.
|
||||
The example also comes from the code in `Quickstart`_.
|
||||
In that case, the module has code to determine the command's version so that it can assert compatibility.
|
||||
There is no *value* to be passed for that CLI argument.
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
..
|
||||
Copyright (c) Ansible Project
|
||||
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
.. _ansible_collections.community.general.docsite.guide_iocage:
|
||||
|
||||
************
|
||||
Iocage Guide
|
||||
************
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
guide_iocage_inventory
|
|
@ -1,31 +0,0 @@
|
|||
..
|
||||
Copyright (c) Ansible Project
|
||||
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
.. _ansible_collections.community.general.docsite.guide_iocage.guide_iocage_inventory:
|
||||
|
||||
community.general.iocage inventory plugin
|
||||
=========================================
|
||||
|
||||
The inventory plugin :ansplugin:`community.general.iocage#inventory` gets the inventory hosts from the iocage jail manager.
|
||||
|
||||
See:
|
||||
|
||||
* `iocage - A FreeBSD Jail Manager <https://iocage.readthedocs.io/en/latest>`_
|
||||
* `man iocage <https://man.freebsd.org/cgi/man.cgi?query=iocage>`_
|
||||
* `Jails and Containers <https://docs.freebsd.org/en/books/handbook/jails>`_
|
||||
|
||||
.. note::
|
||||
The output of the examples is YAML formatted. See the option :ansopt:`ansible.builtin.default#callback:result_format`.
|
||||
|
||||
.. toctree::
|
||||
:caption: Table of Contents
|
||||
:maxdepth: 1
|
||||
|
||||
guide_iocage_inventory_basics
|
||||
guide_iocage_inventory_dhcp
|
||||
guide_iocage_inventory_hooks
|
||||
guide_iocage_inventory_properties
|
||||
guide_iocage_inventory_tags
|
||||
guide_iocage_inventory_aliases
|
|
@ -1,200 +0,0 @@
|
|||
..
|
||||
Copyright (c) Ansible Project
|
||||
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
.. _ansible_collections.community.general.docsite.guide_iocage.guide_iocage_inventory.guide_iocage_inventory_aliases:
|
||||
|
||||
Aliases
|
||||
-------
|
||||
|
||||
Quoting :ref:`inventory_aliases`:
|
||||
|
||||
The ``inventory_hostname`` is the unique identifier for a host in Ansible, this can be an IP or a hostname, but also just an 'alias' or short name for the host.
|
||||
|
||||
As root at the iocage host, stop and destroy all jails:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> iocage stop ALL
|
||||
* Stopping srv_1
|
||||
+ Executing prestop OK
|
||||
+ Stopping services OK
|
||||
+ Tearing down VNET OK
|
||||
+ Removing devfs_ruleset: 1000 OK
|
||||
+ Removing jail process OK
|
||||
+ Executing poststop OK
|
||||
* Stopping srv_2
|
||||
+ Executing prestop OK
|
||||
+ Stopping services OK
|
||||
+ Tearing down VNET OK
|
||||
+ Removing devfs_ruleset: 1001 OK
|
||||
+ Removing jail process OK
|
||||
+ Executing poststop OK
|
||||
* Stopping srv_3
|
||||
+ Executing prestop OK
|
||||
+ Stopping services OK
|
||||
+ Tearing down VNET OK
|
||||
+ Removing devfs_ruleset: 1002 OK
|
||||
+ Removing jail process OK
|
||||
+ Executing poststop OK
|
||||
ansible_client is not running!
|
||||
|
||||
shell> iocage destroy -f srv_1 srv_2 srv_3
|
||||
Destroying srv_1
|
||||
Destroying srv_2
|
||||
Destroying srv_3
|
||||
|
||||
Create three VNET jails with a DHCP interface from the template *ansible_client*. Use the option ``--count``:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> iocage create --short --template ansible_client --count 3 bpf=1 dhcp=1 vnet=1
|
||||
1c11de2d successfully created!
|
||||
9d94cc9e successfully created!
|
||||
052b9557 successfully created!
|
||||
|
||||
The names are random. Start the jails:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> iocage start ALL
|
||||
No default gateway found for ipv6.
|
||||
* Starting 052b9557
|
||||
+ Started OK
|
||||
+ Using devfs_ruleset: 1000 (iocage generated default)
|
||||
+ Configuring VNET OK
|
||||
+ Using IP options: vnet
|
||||
+ Starting services OK
|
||||
+ Executing poststart OK
|
||||
+ DHCP Address: 10.1.0.137/24
|
||||
No default gateway found for ipv6.
|
||||
* Starting 1c11de2d
|
||||
+ Started OK
|
||||
+ Using devfs_ruleset: 1001 (iocage generated default)
|
||||
+ Configuring VNET OK
|
||||
+ Using IP options: vnet
|
||||
+ Starting services OK
|
||||
+ Executing poststart OK
|
||||
+ DHCP Address: 10.1.0.146/24
|
||||
No default gateway found for ipv6.
|
||||
* Starting 9d94cc9e
|
||||
+ Started OK
|
||||
+ Using devfs_ruleset: 1002 (iocage generated default)
|
||||
+ Configuring VNET OK
|
||||
+ Using IP options: vnet
|
||||
+ Starting services OK
|
||||
+ Executing poststart OK
|
||||
+ DHCP Address: 10.1.0.115/24
|
||||
Please convert back to a jail before trying to start ansible_client
|
||||
|
||||
List the jails:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> iocage list -l
|
||||
+-----+----------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
| JID | NAME | BOOT | STATE | TYPE | RELEASE | IP4 | IP6 | TEMPLATE | BASEJAIL |
|
||||
+=====+==========+======+=======+======+=================+====================+=====+================+==========+
|
||||
| 207 | 052b9557 | off | up | jail | 14.2-RELEASE-p3 | epair0b|10.1.0.137 | - | ansible_client | no |
|
||||
+-----+----------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
| 208 | 1c11de2d | off | up | jail | 14.2-RELEASE-p3 | epair0b|10.1.0.146 | - | ansible_client | no |
|
||||
+-----+----------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
| 209 | 9d94cc9e | off | up | jail | 14.2-RELEASE-p3 | epair0b|10.1.0.115 | - | ansible_client | no |
|
||||
+-----+----------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
|
||||
Set notes. The tag *alias* will be used to create inventory aliases:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> iocage set notes="vmm=iocage_02 project=foo alias=srv_1" 052b9557
|
||||
notes: none -> vmm=iocage_02 project=foo alias=srv_1
|
||||
shell> iocage set notes="vmm=iocage_02 project=foo alias=srv_2" 1c11de2d
|
||||
notes: none -> vmm=iocage_02 project=foo alias=srv_2
|
||||
shell> iocage set notes="vmm=iocage_02 project=bar alias=srv_3" 9d94cc9e
|
||||
notes: none -> vmm=iocage_02 project=bar alias=srv_3
|
||||
|
||||
Update the inventory configuration. Set the option
|
||||
:ansopt:`community.general.iocage#inventory:inventory_hostname_tag` to :ansval:`alias`. This tag keeps the
|
||||
value of the alias. The option :ansopt:`community.general.iocage#inventory:get_properties` must be
|
||||
enabled. For example, ``hosts/02_iocage.yml`` contains:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugin: community.general.iocage
|
||||
host: 10.1.0.73
|
||||
user: admin
|
||||
get_properties: true
|
||||
inventory_hostname_tag: alias
|
||||
hooks_results:
|
||||
- /var/db/dhclient-hook.address.epair0b
|
||||
compose:
|
||||
ansible_host: (iocage_hooks.0 == '-') | ternary(iocage_ip4, iocage_hooks.0)
|
||||
iocage_tags: dict(iocage_properties.notes | split | map('split', '='))
|
||||
keyed_groups:
|
||||
- prefix: vmm
|
||||
key: iocage_tags.vmm
|
||||
- prefix: project
|
||||
key: iocage_tags.project
|
||||
|
||||
Display tags and groups. Create a playbook ``pb-test-groups.yml`` with the following content:
|
||||
|
||||
.. code-block:: yaml+jinja
|
||||
|
||||
- hosts: all
|
||||
remote_user: admin
|
||||
|
||||
vars:
|
||||
|
||||
ansible_python_interpreter: auto_silent
|
||||
|
||||
tasks:
|
||||
|
||||
- debug:
|
||||
var: iocage_tags
|
||||
|
||||
- debug:
|
||||
msg: |
|
||||
{% for group in groups %}
|
||||
{{ group }}: {{ groups[group] }}
|
||||
{% endfor %}
|
||||
run_once: true
|
||||
|
||||
Run the playbook:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> ansible-playbook -i hosts/02_iocage.yml pb-test-groups.yml
|
||||
|
||||
PLAY [all] **********************************************************************************************************
|
||||
|
||||
TASK [debug] ********************************************************************************************************
|
||||
ok: [srv_1] =>
|
||||
iocage_tags:
|
||||
alias: srv_1
|
||||
project: foo
|
||||
vmm: iocage_02
|
||||
ok: [srv_2] =>
|
||||
iocage_tags:
|
||||
alias: srv_2
|
||||
project: foo
|
||||
vmm: iocage_02
|
||||
ok: [srv_3] =>
|
||||
iocage_tags:
|
||||
alias: srv_3
|
||||
project: bar
|
||||
vmm: iocage_02
|
||||
|
||||
TASK [debug] ********************************************************************************************************
|
||||
ok: [srv_1] =>
|
||||
msg: |-
|
||||
all: ['srv_1', 'srv_2', 'srv_3']
|
||||
ungrouped: []
|
||||
vmm_iocage_02: ['srv_1', 'srv_2', 'srv_3']
|
||||
project_foo: ['srv_1', 'srv_2']
|
||||
project_bar: ['srv_3']
|
||||
|
||||
PLAY RECAP **********************************************************************************************************
|
||||
srv_1 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
|
||||
srv_2 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
|
||||
srv_3 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
|
|
@ -1,128 +0,0 @@
|
|||
..
|
||||
Copyright (c) Ansible Project
|
||||
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
.. _ansible_collections.community.general.docsite.guide_iocage.guide_iocage_inventory.guide_iocage_inventory_basics:
|
||||
|
||||
Basics
|
||||
------
|
||||
|
||||
As root at the iocage host, create three VNET jails with a DHCP interface from the template
|
||||
*ansible_client*:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> iocage create --template ansible_client --name srv_1 bpf=1 dhcp=1 vnet=1
|
||||
srv_1 successfully created!
|
||||
shell> iocage create --template ansible_client --name srv_2 bpf=1 dhcp=1 vnet=1
|
||||
srv_2 successfully created!
|
||||
shell> iocage create --template ansible_client --name srv_3 bpf=1 dhcp=1 vnet=1
|
||||
srv_3 successfully created!
|
||||
|
||||
See: `Configuring a VNET Jail <https://iocage.readthedocs.io/en/latest/networking.html#configuring-a-vnet-jail>`_.
|
||||
|
||||
As admin at the controller, list the jails:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> ssh admin@10.1.0.73 iocage list -l
|
||||
+------+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
| JID | NAME | BOOT | STATE | TYPE | RELEASE | IP4 | IP6 | TEMPLATE | BASEJAIL |
|
||||
+======+=======+======+=======+======+=================+====================+=====+================+==========+
|
||||
| None | srv_1 | off | down | jail | 14.2-RELEASE-p3 | DHCP (not running) | - | ansible_client | no |
|
||||
+------+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
| None | srv_2 | off | down | jail | 14.2-RELEASE-p3 | DHCP (not running) | - | ansible_client | no |
|
||||
+------+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
| None | srv_3 | off | down | jail | 14.2-RELEASE-p3 | DHCP (not running) | - | ansible_client | no |
|
||||
+------+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
|
||||
Create the inventory file ``hosts/02_iocage.yml``
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugin: community.general.iocage
|
||||
host: 10.1.0.73
|
||||
user: admin
|
||||
|
||||
Display the inventory:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> ansible-inventory -i hosts/02_iocage.yml --list --yaml
|
||||
all:
|
||||
children:
|
||||
ungrouped:
|
||||
hosts:
|
||||
srv_1:
|
||||
iocage_basejail: 'no'
|
||||
iocage_boot: 'off'
|
||||
iocage_ip4: '-'
|
||||
iocage_ip4_dict:
|
||||
ip4: []
|
||||
msg: DHCP (not running)
|
||||
iocage_ip6: '-'
|
||||
iocage_jid: None
|
||||
iocage_release: 14.2-RELEASE-p3
|
||||
iocage_state: down
|
||||
iocage_template: ansible_client
|
||||
iocage_type: jail
|
||||
srv_2:
|
||||
iocage_basejail: 'no'
|
||||
iocage_boot: 'off'
|
||||
iocage_ip4: '-'
|
||||
iocage_ip4_dict:
|
||||
ip4: []
|
||||
msg: DHCP (not running)
|
||||
iocage_ip6: '-'
|
||||
iocage_jid: None
|
||||
iocage_release: 14.2-RELEASE-p3
|
||||
iocage_state: down
|
||||
iocage_template: ansible_client
|
||||
iocage_type: jail
|
||||
srv_3:
|
||||
iocage_basejail: 'no'
|
||||
iocage_boot: 'off'
|
||||
iocage_ip4: '-'
|
||||
iocage_ip4_dict:
|
||||
ip4: []
|
||||
msg: DHCP (not running)
|
||||
iocage_ip6: '-'
|
||||
iocage_jid: None
|
||||
iocage_release: 14.2-RELEASE-p3
|
||||
iocage_state: down
|
||||
iocage_template: ansible_client
|
||||
iocage_type: jail
|
||||
|
||||
Optionally, create shared IP jails:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> iocage create --template ansible_client --name srv_1 ip4_addr="em0|10.1.0.101/24"
|
||||
srv_1 successfully created!
|
||||
shell> iocage create --template ansible_client --name srv_2 ip4_addr="em0|10.1.0.102/24"
|
||||
srv_2 successfully created!
|
||||
shell> iocage create --template ansible_client --name srv_3 ip4_addr="em0|10.1.0.103/24"
|
||||
srv_3 successfully created!
|
||||
shell> iocage list -l
|
||||
+------+-------+------+-------+------+-----------------+-------------------+-----+----------------+----------+
|
||||
| JID | NAME | BOOT | STATE | TYPE | RELEASE | IP4 | IP6 | TEMPLATE | BASEJAIL |
|
||||
+======+=======+======+=======+======+=================+===================+=====+================+==========+
|
||||
| None | srv_1 | off | down | jail | 14.2-RELEASE-p3 | em0|10.1.0.101/24 | - | ansible_client | no |
|
||||
+------+-------+------+-------+------+-----------------+-------------------+-----+----------------+----------+
|
||||
| None | srv_2 | off | down | jail | 14.2-RELEASE-p3 | em0|10.1.0.102/24 | - | ansible_client | no |
|
||||
+------+-------+------+-------+------+-----------------+-------------------+-----+----------------+----------+
|
||||
| None | srv_3 | off | down | jail | 14.2-RELEASE-p3 | em0|10.1.0.103/24 | - | ansible_client | no |
|
||||
+------+-------+------+-------+------+-----------------+-------------------+-----+----------------+----------+
|
||||
|
||||
See: `Configuring a Shared IP Jail <https://iocage.readthedocs.io/en/latest/networking.html#configuring-a-shared-ip-jail>`_
|
||||
|
||||
If iocage needs environment variable(s), use the option :ansopt:`community.general.iocage#inventory:env`. For example,
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugin: community.general.iocage
|
||||
host: 10.1.0.73
|
||||
user: admin
|
||||
env:
|
||||
CRYPTOGRAPHY_OPENSSL_NO_LEGACY: 1
|
|
@ -1,175 +0,0 @@
|
|||
..
|
||||
Copyright (c) Ansible Project
|
||||
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
.. _ansible_collections.community.general.docsite.guide_iocage.guide_iocage_inventory.guide_iocage_inventory_dhcp:
|
||||
|
||||
DHCP
|
||||
----
|
||||
|
||||
As root at the iocage host, start the jails:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> iocage start ALL
|
||||
No default gateway found for ipv6.
|
||||
* Starting srv_1
|
||||
+ Started OK
|
||||
+ Using devfs_ruleset: 1000 (iocage generated default)
|
||||
+ Configuring VNET OK
|
||||
+ Using IP options: vnet
|
||||
+ Starting services OK
|
||||
+ Executing poststart OK
|
||||
+ DHCP Address: 10.1.0.183/24
|
||||
No default gateway found for ipv6.
|
||||
* Starting srv_2
|
||||
+ Started OK
|
||||
+ Using devfs_ruleset: 1001 (iocage generated default)
|
||||
+ Configuring VNET OK
|
||||
+ Using IP options: vnet
|
||||
+ Starting services OK
|
||||
+ Executing poststart OK
|
||||
+ DHCP Address: 10.1.0.204/24
|
||||
No default gateway found for ipv6.
|
||||
* Starting srv_3
|
||||
+ Started OK
|
||||
+ Using devfs_ruleset: 1002 (iocage generated default)
|
||||
+ Configuring VNET OK
|
||||
+ Using IP options: vnet
|
||||
+ Starting services OK
|
||||
+ Executing poststart OK
|
||||
+ DHCP Address: 10.1.0.169/24
|
||||
Please convert back to a jail before trying to start ansible_client
|
||||
|
||||
List the jails:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> iocage list -l
|
||||
+-----+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
| JID | NAME | BOOT | STATE | TYPE | RELEASE | IP4 | IP6 | TEMPLATE | BASEJAIL |
|
||||
+=====+=======+======+=======+======+=================+====================+=====+================+==========+
|
||||
| 204 | srv_1 | off | up | jail | 14.2-RELEASE-p3 | epair0b|10.1.0.183 | - | ansible_client | no |
|
||||
+-----+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
| 205 | srv_2 | off | up | jail | 14.2-RELEASE-p3 | epair0b|10.1.0.204 | - | ansible_client | no |
|
||||
+-----+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
| 206 | srv_3 | off | up | jail | 14.2-RELEASE-p3 | epair0b|10.1.0.169 | - | ansible_client | no |
|
||||
+-----+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
|
||||
As admin at the controller, list the jails. The IP4 tab says "... address requires root":
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> ssh admin@10.1.0.73 iocage list -l
|
||||
+-----+-------+------+-------+------+-----------------+-----------------------------------------+-----+----------------+----------+
|
||||
| JID | NAME | BOOT | STATE | TYPE | RELEASE | IP4 | IP6 | TEMPLATE | BASEJAIL |
|
||||
+=====+=======+======+=======+======+=================+=========================================+=====+================+==========+
|
||||
| 204 | srv_1 | off | up | jail | 14.2-RELEASE-p3 | DHCP (running -- address requires root) | - | ansible_client | no |
|
||||
+-----+-------+------+-------+------+-----------------+-----------------------------------------+-----+----------------+----------+
|
||||
| 205 | srv_2 | off | up | jail | 14.2-RELEASE-p3 | DHCP (running -- address requires root) | - | ansible_client | no |
|
||||
+-----+-------+------+-------+------+-----------------+-----------------------------------------+-----+----------------+----------+
|
||||
| 206 | srv_3 | off | up | jail | 14.2-RELEASE-p3 | DHCP (running -- address requires root) | - | ansible_client | no |
|
||||
+-----+-------+------+-------+------+-----------------+-----------------------------------------+-----+----------------+----------+
|
||||
|
||||
Use sudo if enabled:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> ssh admin@10.1.0.73 sudo iocage list -l
|
||||
+-----+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
| JID | NAME | BOOT | STATE | TYPE | RELEASE | IP4 | IP6 | TEMPLATE | BASEJAIL |
|
||||
+=====+=======+======+=======+======+=================+====================+=====+================+==========+
|
||||
| 204 | srv_1 | off | up | jail | 14.2-RELEASE-p3 | epair0b|10.1.0.183 | - | ansible_client | no |
|
||||
+-----+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
| 205 | srv_2 | off | up | jail | 14.2-RELEASE-p3 | epair0b|10.1.0.204 | - | ansible_client | no |
|
||||
+-----+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
| 206 | srv_3 | off | up | jail | 14.2-RELEASE-p3 | epair0b|10.1.0.169 | - | ansible_client | no |
|
||||
+-----+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
||||
|
||||
Create the inventory file ``hosts/02_iocage.yml``. Use the option
|
||||
:ansopt:`community.general.iocage#inventory:sudo`:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugin: community.general.iocage
|
||||
host: 10.1.0.73
|
||||
user: admin
|
||||
sudo: true
|
||||
|
||||
Display the inventory:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> ansible-inventory -i hosts/02_iocage.yml --list --yaml
|
||||
all:
|
||||
children:
|
||||
ungrouped:
|
||||
hosts:
|
||||
srv_1:
|
||||
iocage_basejail: 'no'
|
||||
iocage_boot: 'off'
|
||||
iocage_ip4: 10.1.0.183
|
||||
iocage_ip4_dict:
|
||||
ip4:
|
||||
- ifc: epair0b
|
||||
ip: 10.1.0.183
|
||||
mask: '-'
|
||||
msg: ''
|
||||
iocage_ip6: '-'
|
||||
iocage_jid: '204'
|
||||
iocage_release: 14.2-RELEASE-p3
|
||||
iocage_state: up
|
||||
iocage_template: ansible_client
|
||||
iocage_type: jail
|
||||
srv_2:
|
||||
iocage_basejail: 'no'
|
||||
iocage_boot: 'off'
|
||||
iocage_ip4: 10.1.0.204
|
||||
iocage_ip4_dict:
|
||||
ip4:
|
||||
- ifc: epair0b
|
||||
ip: 10.1.0.204
|
||||
mask: '-'
|
||||
msg: ''
|
||||
iocage_ip6: '-'
|
||||
iocage_jid: '205'
|
||||
iocage_release: 14.2-RELEASE-p3
|
||||
iocage_state: up
|
||||
iocage_template: ansible_client
|
||||
iocage_type: jail
|
||||
srv_3:
|
||||
iocage_basejail: 'no'
|
||||
iocage_boot: 'off'
|
||||
iocage_ip4: 10.1.0.169
|
||||
iocage_ip4_dict:
|
||||
ip4:
|
||||
- ifc: epair0b
|
||||
ip: 10.1.0.169
|
||||
mask: '-'
|
||||
msg: ''
|
||||
iocage_ip6: '-'
|
||||
iocage_jid: '206'
|
||||
iocage_release: 14.2-RELEASE-p3
|
||||
iocage_state: up
|
||||
iocage_template: ansible_client
|
||||
iocage_type: jail
|
||||
|
||||
Note: If the option :ansopt:`community.general.iocage#inventory:env` is used and :ansopt:`community.general.iocage#inventory:sudo` is enabled, enable also :ansopt:`community.general.iocage#inventory:sudo_preserve_env`. For example,
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugin: community.general.iocage
|
||||
host: 10.1.0.73
|
||||
user: admin
|
||||
env:
|
||||
CRYPTOGRAPHY_OPENSSL_NO_LEGACY: 1
|
||||
sudo: true
|
||||
sudo_preserve_env: true
|
||||
|
||||
In this case, make sure the sudo tag ``SETENV`` is used:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> ssh admin@10.1.0.73 sudo cat /usr/local/etc/sudoers | grep admin
|
||||
admin ALL=(ALL) NOPASSWD:SETENV: ALL
|
|
@ -1,187 +0,0 @@
|
|||
..
|
||||
Copyright (c) Ansible Project
|
||||
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
.. _ansible_collections.community.general.docsite.guide_iocage.guide_iocage_inventory.guide_iocage_inventory_hooks:
|
||||
|
||||
Hooks
|
||||
-----
|
||||
|
||||
The iocage utility internally opens a console to a jail to get the jail's DHCP address. This
|
||||
requires root. If you run the command ``iocage list -l`` as unprivileged user, you'll see the
|
||||
message ``DHCP (running -- address requires root)``. If you are not granted the root privilege, use
|
||||
``/etc/dhclient-exit-hooks``. For example, in the jail *srv_1*, create the file
|
||||
``/zroot/iocage/jails/srv_1/root/etc/dhclient-exit-hooks``
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
case "$reason" in
|
||||
"BOUND"|"REBIND"|"REBOOT"|"RENEW")
|
||||
echo $new_ip_address > /var/db/dhclient-hook.address.$interface
|
||||
;;
|
||||
esac
|
||||
|
||||
where ``/zroot/iocage`` is the activated pool.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> zfs list | grep /zroot/iocage
|
||||
zroot/iocage 4.69G 446G 5.08M /zroot/iocage
|
||||
zroot/iocage/download 927M 446G 384K /zroot/iocage/download
|
||||
zroot/iocage/download/14.1-RELEASE 465M 446G 465M /zroot/iocage/download/14.1-RELEASE
|
||||
zroot/iocage/download/14.2-RELEASE 462M 446G 462M /zroot/iocage/download/14.2-RELEASE
|
||||
zroot/iocage/images 384K 446G 384K /zroot/iocage/images
|
||||
zroot/iocage/jails 189M 446G 480K /zroot/iocage/jails
|
||||
zroot/iocage/jails/srv_1 62.9M 446G 464K /zroot/iocage/jails/srv_1
|
||||
zroot/iocage/jails/srv_1/root 62.4M 446G 3.53G /zroot/iocage/jails/srv_1/root
|
||||
zroot/iocage/jails/srv_2 62.8M 446G 464K /zroot/iocage/jails/srv_2
|
||||
zroot/iocage/jails/srv_2/root 62.3M 446G 3.53G /zroot/iocage/jails/srv_2/root
|
||||
zroot/iocage/jails/srv_3 62.8M 446G 464K /zroot/iocage/jails/srv_3
|
||||
zroot/iocage/jails/srv_3/root 62.3M 446G 3.53G /zroot/iocage/jails/srv_3/root
|
||||
zroot/iocage/log 688K 446G 688K /zroot/iocage/log
|
||||
zroot/iocage/releases 2.93G 446G 384K /zroot/iocage/releases
|
||||
zroot/iocage/releases/14.2-RELEASE 2.93G 446G 384K /zroot/iocage/releases/14.2-RELEASE
|
||||
zroot/iocage/releases/14.2-RELEASE/root 2.93G 446G 2.88G /zroot/iocage/releases/14.2-RELEASE/root
|
||||
zroot/iocage/templates 682M 446G 416K /zroot/iocage/templates
|
||||
zroot/iocage/templates/ansible_client 681M 446G 432K /zroot/iocage/templates/ansible_client
|
||||
zroot/iocage/templates/ansible_client/root 681M 446G 3.53G /zroot/iocage/templates/ansible_client/root
|
||||
|
||||
See: `man dhclient-script <https://man.freebsd.org/cgi/man.cgi?dhclient-script>`_
|
||||
|
||||
Create the inventory configuration. Use the option :ansopt:`community.general.iocage#inventory:hooks_results` instead of :ansopt:`community.general.iocage#inventory:sudo`:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> cat hosts/02_iocage.yml
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugin: community.general.iocage
|
||||
host: 10.1.0.73
|
||||
user: admin
|
||||
hooks_results:
|
||||
- /var/db/dhclient-hook.address.epair0b
|
||||
|
||||
.. note::
|
||||
|
||||
The option :ansopt:`community.general.iocage#inventory:hooks_results` expects the poolname to be mounted to ``/poolname``. For example, if you
|
||||
activate the pool iocage, this plugin expects to find the :ansopt:`community.general.iocage#inventory:hooks_results` items in the path
|
||||
/iocage/iocage/jails/<name>/root. If you mount the poolname to a different path, the easiest
|
||||
remedy is to create a symlink.
|
||||
|
||||
As admin at the controller, display the inventory:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> ansible-inventory -i hosts/02_iocage.yml --list --yaml
|
||||
all:
|
||||
children:
|
||||
ungrouped:
|
||||
hosts:
|
||||
srv_1:
|
||||
iocage_basejail: 'no'
|
||||
iocage_boot: 'off'
|
||||
iocage_hooks:
|
||||
- 10.1.0.183
|
||||
iocage_ip4: '-'
|
||||
iocage_ip4_dict:
|
||||
ip4: []
|
||||
msg: DHCP (running -- address requires root)
|
||||
iocage_ip6: '-'
|
||||
iocage_jid: '204'
|
||||
iocage_release: 14.2-RELEASE-p3
|
||||
iocage_state: up
|
||||
iocage_template: ansible_client
|
||||
iocage_type: jail
|
||||
srv_2:
|
||||
iocage_basejail: 'no'
|
||||
iocage_boot: 'off'
|
||||
iocage_hooks:
|
||||
- 10.1.0.204
|
||||
iocage_ip4: '-'
|
||||
iocage_ip4_dict:
|
||||
ip4: []
|
||||
msg: DHCP (running -- address requires root)
|
||||
iocage_ip6: '-'
|
||||
iocage_jid: '205'
|
||||
iocage_release: 14.2-RELEASE-p3
|
||||
iocage_state: up
|
||||
iocage_template: ansible_client
|
||||
iocage_type: jail
|
||||
srv_3:
|
||||
iocage_basejail: 'no'
|
||||
iocage_boot: 'off'
|
||||
iocage_hooks:
|
||||
- 10.1.0.169
|
||||
iocage_ip4: '-'
|
||||
iocage_ip4_dict:
|
||||
ip4: []
|
||||
msg: DHCP (running -- address requires root)
|
||||
iocage_ip6: '-'
|
||||
iocage_jid: '206'
|
||||
iocage_release: 14.2-RELEASE-p3
|
||||
iocage_state: up
|
||||
iocage_template: ansible_client
|
||||
iocage_type: jail
|
||||
|
||||
Compose the variable ``ansible_host``. For example, ``hosts/02_iocage.yml`` could look like:
|
||||
|
||||
.. code-block:: yaml+jinja
|
||||
|
||||
plugin: community.general.iocage
|
||||
host: 10.1.0.73
|
||||
user: admin
|
||||
hooks_results:
|
||||
- /var/db/dhclient-hook.address.epair0b
|
||||
compose:
|
||||
ansible_host: (iocage_hooks.0 == '-') | ternary(iocage_ip4, iocage_hooks.0)
|
||||
|
||||
Test the jails. Create a playbook ``pb-test-uname.yml``:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
- hosts: all
|
||||
remote_user: admin
|
||||
|
||||
vars:
|
||||
|
||||
ansible_python_interpreter: auto_silent
|
||||
|
||||
tasks:
|
||||
|
||||
- command: uname -a
|
||||
register: out
|
||||
|
||||
- debug:
|
||||
var: out.stdout
|
||||
|
||||
See: :ref:`working_with_bsd`
|
||||
|
||||
Run the playbook:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> ansible-playbook -i hosts/02_iocage.yml pb-test-uname.yml
|
||||
|
||||
PLAY [all] **********************************************************************************************************
|
||||
|
||||
TASK [command] ******************************************************************************************************
|
||||
changed: [srv_3]
|
||||
changed: [srv_1]
|
||||
changed: [srv_2]
|
||||
|
||||
TASK [debug] ********************************************************************************************************
|
||||
ok: [srv_1] =>
|
||||
out.stdout: FreeBSD srv-1 14.2-RELEASE-p1 FreeBSD 14.2-RELEASE-p1 GENERIC amd64
|
||||
ok: [srv_3] =>
|
||||
out.stdout: FreeBSD srv-3 14.2-RELEASE-p1 FreeBSD 14.2-RELEASE-p1 GENERIC amd64
|
||||
ok: [srv_2] =>
|
||||
out.stdout: FreeBSD srv-2 14.2-RELEASE-p1 FreeBSD 14.2-RELEASE-p1 GENERIC amd64
|
||||
|
||||
PLAY RECAP **********************************************************************************************************
|
||||
srv_1 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
|
||||
srv_2 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
|
||||
srv_3 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
|
||||
|
||||
Note: This playbook and the inventory configuration works also for the *Shared IP Jails*.
|
|
@ -1,201 +0,0 @@
|
|||
..
|
||||
Copyright (c) Ansible Project
|
||||
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
.. _ansible_collections.community.general.docsite.guide_iocage.guide_iocage_inventory.guide_iocage_inventory_properties:
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
Optionally, in the inventory file ``hosts/02_iocage.yml``, get the iocage properties. Enable
|
||||
:ansopt:`community.general.iocage#inventory:get_properties`:
|
||||
|
||||
.. code-block:: yaml+jinja
|
||||
|
||||
plugin: community.general.iocage
|
||||
host: 10.1.0.73
|
||||
user: admin
|
||||
get_properties: true
|
||||
hooks_results:
|
||||
- /var/db/dhclient-hook.address.epair0b
|
||||
compose:
|
||||
ansible_host: (iocage_hooks.0 == '-') | ternary(iocage_ip4, iocage_hooks.0)
|
||||
|
||||
Display the properties. Create the playbook ``pb-test-properties.yml``:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
- hosts: all
|
||||
remote_user: admin
|
||||
|
||||
vars:
|
||||
|
||||
ansible_python_interpreter: auto_silent
|
||||
|
||||
tasks:
|
||||
|
||||
- debug:
|
||||
var: iocage_properties
|
||||
|
||||
Run the playbook. Limit the inventory to *srv_3*:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> ansible-playbook -i hosts/02_iocage.yml -l srv_3 pb-test-properties.yml
|
||||
|
||||
PLAY [all] **********************************************************************************************************
|
||||
|
||||
TASK [debug] ********************************************************************************************************
|
||||
ok: [srv_3] =>
|
||||
iocage_properties:
|
||||
CONFIG_VERSION: '33'
|
||||
allow_chflags: '0'
|
||||
allow_mlock: '0'
|
||||
allow_mount: '1'
|
||||
allow_mount_devfs: '0'
|
||||
allow_mount_fdescfs: '0'
|
||||
allow_mount_fusefs: '0'
|
||||
allow_mount_linprocfs: '0'
|
||||
allow_mount_linsysfs: '0'
|
||||
allow_mount_nullfs: '0'
|
||||
allow_mount_procfs: '0'
|
||||
allow_mount_tmpfs: '0'
|
||||
allow_mount_zfs: '0'
|
||||
allow_nfsd: '0'
|
||||
allow_quotas: '0'
|
||||
allow_raw_sockets: '0'
|
||||
allow_set_hostname: '1'
|
||||
allow_socket_af: '0'
|
||||
allow_sysvipc: '0'
|
||||
allow_tun: '0'
|
||||
allow_vmm: '0'
|
||||
assign_localhost: '0'
|
||||
available: readonly
|
||||
basejail: '0'
|
||||
boot: '0'
|
||||
bpf: '1'
|
||||
children_max: '0'
|
||||
cloned_release: 14.2-RELEASE
|
||||
comment: none
|
||||
compression: 'on'
|
||||
compressratio: readonly
|
||||
coredumpsize: 'off'
|
||||
count: '1'
|
||||
cpuset: 'off'
|
||||
cputime: 'off'
|
||||
datasize: 'off'
|
||||
dedup: 'off'
|
||||
defaultrouter: auto
|
||||
defaultrouter6: auto
|
||||
depends: none
|
||||
devfs_ruleset: '4'
|
||||
dhcp: '1'
|
||||
enforce_statfs: '2'
|
||||
exec_clean: '1'
|
||||
exec_created: /usr/bin/true
|
||||
exec_fib: '0'
|
||||
exec_jail_user: root
|
||||
exec_poststart: /usr/bin/true
|
||||
exec_poststop: /usr/bin/true
|
||||
exec_prestart: /usr/bin/true
|
||||
exec_prestop: /usr/bin/true
|
||||
exec_start: /bin/sh /etc/rc
|
||||
exec_stop: /bin/sh /etc/rc.shutdown
|
||||
exec_system_jail_user: '0'
|
||||
exec_system_user: root
|
||||
exec_timeout: '60'
|
||||
host_domainname: none
|
||||
host_hostname: srv-3
|
||||
host_hostuuid: srv_3
|
||||
host_time: '1'
|
||||
hostid: ea2ba7d1-4fcd-f13f-82e4-8b32c0a03403
|
||||
hostid_strict_check: '0'
|
||||
interfaces: vnet0:bridge0
|
||||
ip4: new
|
||||
ip4_addr: none
|
||||
ip4_saddrsel: '1'
|
||||
ip6: new
|
||||
ip6_addr: none
|
||||
ip6_saddrsel: '1'
|
||||
ip_hostname: '0'
|
||||
jail_zfs: '0'
|
||||
jail_zfs_dataset: iocage/jails/srv_3/data
|
||||
jail_zfs_mountpoint: none
|
||||
last_started: '2025-06-11 04:29:23'
|
||||
localhost_ip: none
|
||||
login_flags: -f root
|
||||
mac_prefix: 02a098
|
||||
maxproc: 'off'
|
||||
memorylocked: 'off'
|
||||
memoryuse: 'off'
|
||||
min_dyn_devfs_ruleset: '1000'
|
||||
mount_devfs: '1'
|
||||
mount_fdescfs: '1'
|
||||
mount_linprocfs: '0'
|
||||
mount_procfs: '0'
|
||||
mountpoint: readonly
|
||||
msgqqueued: 'off'
|
||||
msgqsize: 'off'
|
||||
nat: '0'
|
||||
nat_backend: ipfw
|
||||
nat_forwards: none
|
||||
nat_interface: none
|
||||
nat_prefix: '172.16'
|
||||
nmsgq: 'off'
|
||||
notes: none
|
||||
nsem: 'off'
|
||||
nsemop: 'off'
|
||||
nshm: 'off'
|
||||
nthr: 'off'
|
||||
openfiles: 'off'
|
||||
origin: readonly
|
||||
owner: root
|
||||
pcpu: 'off'
|
||||
plugin_name: none
|
||||
plugin_repository: none
|
||||
priority: '99'
|
||||
pseudoterminals: 'off'
|
||||
quota: none
|
||||
readbps: 'off'
|
||||
readiops: 'off'
|
||||
release: 14.2-RELEASE-p3
|
||||
reservation: none
|
||||
resolver: /etc/resolv.conf
|
||||
rlimits: 'off'
|
||||
rtsold: '0'
|
||||
securelevel: '2'
|
||||
shmsize: 'off'
|
||||
source_template: ansible_client
|
||||
stacksize: 'off'
|
||||
state: up
|
||||
stop_timeout: '30'
|
||||
swapuse: 'off'
|
||||
sync_state: none
|
||||
sync_target: none
|
||||
sync_tgt_zpool: none
|
||||
sysvmsg: new
|
||||
sysvsem: new
|
||||
sysvshm: new
|
||||
template: '0'
|
||||
type: jail
|
||||
used: readonly
|
||||
vmemoryuse: 'off'
|
||||
vnet: '1'
|
||||
vnet0_mac: 02a0983da05d 02a0983da05e
|
||||
vnet0_mtu: auto
|
||||
vnet1_mac: none
|
||||
vnet1_mtu: auto
|
||||
vnet2_mac: none
|
||||
vnet2_mtu: auto
|
||||
vnet3_mac: none
|
||||
vnet3_mtu: auto
|
||||
vnet_default_interface: auto
|
||||
vnet_default_mtu: '1500'
|
||||
vnet_interfaces: none
|
||||
wallclock: 'off'
|
||||
writebps: 'off'
|
||||
writeiops: 'off'
|
||||
|
||||
PLAY RECAP **********************************************************************************************************
|
||||
srv_3 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
|
|
@ -1,117 +0,0 @@
|
|||
..
|
||||
Copyright (c) Ansible Project
|
||||
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
.. _ansible_collections.community.general.docsite.guide_iocage.guide_iocage_inventory.guide_iocage_inventory_tags:
|
||||
|
||||
Tags
|
||||
----
|
||||
|
||||
Quoting `man iocage <https://man.freebsd.org/cgi/man.cgi?query=iocage>`_
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
PROPERTIES
|
||||
...
|
||||
notes="any string"
|
||||
Custom notes for miscellaneous tagging.
|
||||
Default: none
|
||||
Source: local
|
||||
|
||||
We will use the format `notes="tag1=value1 tag2=value2 ..."`.
|
||||
|
||||
.. note::
|
||||
|
||||
The iocage tags have nothing to do with the :ref:`tags`.
|
||||
|
||||
As root at the iocage host, set notes. For example,
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> iocage set notes="vmm=iocage_02 project=foo" srv_1
|
||||
notes: none -> vmm=iocage_02 project=foo
|
||||
shell> iocage set notes="vmm=iocage_02 project=foo" srv_2
|
||||
notes: none -> vmm=iocage_02 project=foo
|
||||
shell> iocage set notes="vmm=iocage_02 project=bar" srv_3
|
||||
notes: none -> vmm=iocage_02 project=bar
|
||||
|
||||
Update the inventory configuration. Compose a dictionary *iocage_tags* and create groups. The option
|
||||
:ansopt:`community.general.iocage#inventory:get_properties` must be enabled.
|
||||
For example, ``hosts/02_iocage.yml`` could look like:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugin: community.general.iocage
|
||||
host: 10.1.0.73
|
||||
user: admin
|
||||
get_properties: true
|
||||
hooks_results:
|
||||
- /var/db/dhclient-hook.address.epair0b
|
||||
compose:
|
||||
ansible_host: (iocage_hooks.0 == '-') | ternary(iocage_ip4, iocage_hooks.0)
|
||||
iocage_tags: dict(iocage_properties.notes | split | map('split', '='))
|
||||
keyed_groups:
|
||||
- prefix: vmm
|
||||
key: iocage_tags.vmm
|
||||
- prefix: project
|
||||
key: iocage_tags.project
|
||||
|
||||
Display tags and groups. Create a playbook ``pb-test-groups.yml``:
|
||||
|
||||
.. code-block:: yaml+jinja
|
||||
|
||||
- hosts: all
|
||||
remote_user: admin
|
||||
|
||||
vars:
|
||||
|
||||
ansible_python_interpreter: auto_silent
|
||||
|
||||
tasks:
|
||||
|
||||
- debug:
|
||||
var: iocage_tags
|
||||
|
||||
- debug:
|
||||
msg: |
|
||||
{% for group in groups %}
|
||||
{{ group }}: {{ groups[group] }}
|
||||
{% endfor %}
|
||||
run_once: true
|
||||
|
||||
Run the playbook:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
shell> ansible-playbook -i hosts/02_iocage.yml pb-test-groups.yml
|
||||
|
||||
PLAY [all] **********************************************************************************************************
|
||||
|
||||
TASK [debug] ********************************************************************************************************
|
||||
ok: [srv_1] =>
|
||||
iocage_tags:
|
||||
project: foo
|
||||
vmm: iocage_02
|
||||
ok: [srv_2] =>
|
||||
iocage_tags:
|
||||
project: foo
|
||||
vmm: iocage_02
|
||||
ok: [srv_3] =>
|
||||
iocage_tags:
|
||||
project: bar
|
||||
vmm: iocage_02
|
||||
|
||||
TASK [debug] ********************************************************************************************************
|
||||
ok: [srv_1] =>
|
||||
msg: |-
|
||||
all: ['srv_1', 'srv_2', 'srv_3']
|
||||
ungrouped: []
|
||||
vmm_iocage_02: ['srv_1', 'srv_2', 'srv_3']
|
||||
project_foo: ['srv_1', 'srv_2']
|
||||
project_bar: ['srv_3']
|
||||
|
||||
PLAY RECAP **********************************************************************************************************
|
||||
srv_1 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
|
||||
srv_2 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
|
||||
srv_3 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
|
|
@ -38,6 +38,7 @@ But bear in mind that it does not showcase all of MH's features:
|
|||
),
|
||||
supports_check_mode=True,
|
||||
)
|
||||
use_old_vardict = False
|
||||
|
||||
def __run__(self):
|
||||
self.vars.original_message = ''
|
||||
|
@ -75,14 +76,13 @@ section above, but there are more elements that will take part in it.
|
|||
from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper
|
||||
|
||||
class MyTest(ModuleHelper):
|
||||
# behavior for module paramaters ONLY, see below for further information
|
||||
output_params = ()
|
||||
change_params = ()
|
||||
diff_params = ()
|
||||
facts_name = None
|
||||
facts_params = ()
|
||||
|
||||
facts_name = None # used if generating facts, from parameters or otherwise
|
||||
|
||||
use_old_vardict = True
|
||||
mute_vardict_deprecation = False
|
||||
module = dict(
|
||||
argument_spec=dict(...),
|
||||
# ...
|
||||
|
@ -202,14 +202,27 @@ By using ``self.vars``, you get a central mechanism to access the parameters but
|
|||
As described in :ref:`ansible_collections.community.general.docsite.guide_vardict`, variables in ``VarDict`` have metadata associated to them.
|
||||
One of the attributes in that metadata marks the variable for output, and MH makes use of that to generate the module's return values.
|
||||
|
||||
.. note::
|
||||
.. important::
|
||||
|
||||
The ``VarDict`` class was introduced in community.general 7.1.0, as part of ``ModuleHelper`` itself.
|
||||
However, it has been factored out to become an utility on its own, described in :ref:`ansible_collections.community.general.docsite.guide_vardict`,
|
||||
and the older implementation was removed in community.general 11.0.0.
|
||||
The ``VarDict`` feature described was introduced in community.general 7.1.0, but there was a first
|
||||
implementation of it embedded within ``ModuleHelper``.
|
||||
That older implementation is now deprecated and will be removed in community.general 11.0.0.
|
||||
After community.general 7.1.0, MH modules generate a deprecation message about *using the old VarDict*.
|
||||
There are two ways to prevent that from happening:
|
||||
|
||||
Some code might still refer to the class variables ``use_old_vardict`` and ``mute_vardict_deprecation``, used for the transtition to the new
|
||||
implementation but from community.general 11.0.0 onwards they are no longer used and can be safely removed from the code.
|
||||
#. Set ``mute_vardict_deprecation = True`` and the deprecation will be silenced. If the module still uses the old ``VarDict``,
|
||||
it will not be able to update to community.general 11.0.0 (Spring 2026) upon its release.
|
||||
#. Set ``use_old_vardict = False`` to make the MH module use the new ``VarDict`` immediatelly.
|
||||
The new ``VarDict`` and its use is documented and this is the recommended way to handle this.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class MyTest(ModuleHelper):
|
||||
use_old_vardict = False
|
||||
mute_vardict_deprecation = True
|
||||
...
|
||||
|
||||
These two settings are mutually exclusive, but that is not enforced and the behavior when setting both is not specified.
|
||||
|
||||
Contrary to new variables created in ``VarDict``, module parameters are not set for output by default.
|
||||
If you want to include some module parameters in the output, list them in the ``output_params`` class variable.
|
||||
|
@ -220,11 +233,6 @@ If you want to include some module parameters in the output, list them in the ``
|
|||
output_params = ('state', 'name')
|
||||
...
|
||||
|
||||
.. important::
|
||||
|
||||
The variable names listed in ``output_params`` **must be module parameters**, as in parameters listed in the module's ``argument_spec``.
|
||||
Names not found in ``argument_spec`` are silently ignored.
|
||||
|
||||
Another neat feature provided by MH by using ``VarDict`` is the automatic tracking of changes when setting the metadata ``change=True``.
|
||||
Again, to enable this feature for module parameters, you must list them in the ``change_params`` class variable.
|
||||
|
||||
|
@ -235,11 +243,6 @@ Again, to enable this feature for module parameters, you must list them in the `
|
|||
change_params = ('value', )
|
||||
...
|
||||
|
||||
.. important::
|
||||
|
||||
The variable names listed in ``change_params`` **must be module parameters**, as in parameters listed in the module's ``argument_spec``.
|
||||
Names not found in ``argument_spec`` are silently ignored.
|
||||
|
||||
.. seealso::
|
||||
|
||||
See more about this in
|
||||
|
@ -257,11 +260,6 @@ With that, MH will automatically generate the diff output for variables that hav
|
|||
# example from community.general.gio_mime
|
||||
self.vars.set_meta("handler", initial_value=gio_mime_get(self.runner, self.vars.mime_type), diff=True, change=True)
|
||||
|
||||
.. important::
|
||||
|
||||
The variable names listed in ``diff_params`` **must be module parameters**, as in parameters listed in the module's ``argument_spec``.
|
||||
Names not found in ``argument_spec`` are silently ignored.
|
||||
|
||||
Moreover, if a module is set to return *facts* instead of return values, then again use the metadata ``fact=True`` and ``fact_params`` for module parameters.
|
||||
Additionally, you must specify ``facts_name``, as in:
|
||||
|
||||
|
@ -285,11 +283,6 @@ That generates an Ansible fact like:
|
|||
debug:
|
||||
msg: Volume fact is {{ ansible_facts.volume_facts.volume }}
|
||||
|
||||
.. important::
|
||||
|
||||
The variable names listed in ``fact_params`` **must be module parameters**, as in parameters listed in the module's ``argument_spec``.
|
||||
Names not found in ``argument_spec`` are silently ignored.
|
||||
|
||||
.. important::
|
||||
|
||||
If ``facts_name`` is not set, the module does not generate any facts.
|
||||
|
@ -353,8 +346,6 @@ However, you can set output variables specifically for that exception, if you so
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelperException
|
||||
|
||||
def __init_module__(self):
|
||||
if not complex_validation():
|
||||
self.do_raise("Validation failed!")
|
||||
|
@ -363,16 +354,11 @@ However, you can set output variables specifically for that exception, if you so
|
|||
awesomeness = calculate_awesomeness()
|
||||
if awesomeness > 1000:
|
||||
self.do_raise("Over awesome, I cannot handle it!", update_output={"awesomeness": awesomeness})
|
||||
# which is just a convenience shortcut for
|
||||
raise ModuleHelperException("...", update_output={...})
|
||||
|
||||
All exceptions derived from ``Exception`` are captured and translated into a ``fail_json()`` call.
|
||||
However, if you do want to call ``self.module.fail_json()`` yourself it will work,
|
||||
just keep in mind that there will be no automatic handling of output variables in that case.
|
||||
|
||||
Behind the curtains, all ``do_raise()`` does is to raise a ``ModuleHelperException``.
|
||||
If you want to create specialized error handling for your code, the best way is to extend that clas and raise it when needed.
|
||||
|
||||
.. _ansible_collections.community.general.docsite.guide_modulehelper.statemh:
|
||||
|
||||
StateModuleHelper
|
||||
|
@ -391,6 +377,7 @@ By using ``StateModuleHelper`` you can make your code like the excerpt from the
|
|||
module = dict(
|
||||
...
|
||||
)
|
||||
use_old_vardict = False
|
||||
|
||||
def __init_module__(self):
|
||||
self.runner = gconftool2_runner(self.module, check_rc=True)
|
||||
|
@ -474,11 +461,6 @@ Additionally, MH will also delegate:
|
|||
- ``diff_mode`` to ``self.module._diff``
|
||||
- ``verbosity`` to ``self.module._verbosity``
|
||||
|
||||
Starting in community.general 10.3.0, MH will also delegate the method ``debug`` to ``self.module``.
|
||||
If any existing module already has a ``debug`` attribute defined, a warning message will be generated,
|
||||
requesting it to be renamed. Upon the release of community.general 12.0.0, the delegation will be
|
||||
preemptive and will override any existing method or property in the subclasses.
|
||||
|
||||
Decorators
|
||||
""""""""""
|
||||
|
||||
|
|
|
@ -1,394 +0,0 @@
|
|||
..
|
||||
Copyright (c) Ansible Project
|
||||
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
.. _ansible_collections.community.general.docsite.guide_uthelper:
|
||||
|
||||
UTHelper Guide
|
||||
==============
|
||||
|
||||
Introduction
|
||||
^^^^^^^^^^^^
|
||||
|
||||
``UTHelper`` was written to reduce the boilerplate code used in unit tests for modules.
|
||||
It was originally written to handle tests of modules that run external commands using ``AnsibleModule.run_command()``.
|
||||
At the time of writing (Feb 2025) that remains the only type of tests you can use
|
||||
``UTHelper`` for, but it aims to provide support for other types of interactions.
|
||||
|
||||
Until now, there are many different ways to implement unit tests that validate a module based on the execution of external commands. See some examples:
|
||||
|
||||
* `test_apk.py <https://github.com/ansible-collections/community.general/blob/10.3.0/tests/unit/plugins/modules/test_apk.py>`_ - A very simple one
|
||||
* `test_bootc_manage.py <https://github.com/ansible-collections/community.general/blob/10.3.0/tests/unit/plugins/modules/test_bootc_manage.py>`_ -
|
||||
This one has more test cases, but do notice how the code is repeated amongst them.
|
||||
* `test_modprobe.py <https://github.com/ansible-collections/community.general/blob/10.3.0/tests/unit/plugins/modules/test_modprobe.py>`_ -
|
||||
This one has 15 tests in it, but to achieve that it declares 8 classes repeating quite a lot of code.
|
||||
|
||||
As you can notice, there is no consistency in the way these tests are executed -
|
||||
they all do the same thing eventually, but each one is written in a very distinct way.
|
||||
|
||||
``UTHelper`` aims to:
|
||||
|
||||
* provide a consistent idiom to define unit tests
|
||||
* reduce the code to a bare minimal, and
|
||||
* define tests as data instead
|
||||
* allow the test cases definition to be expressed not only as a Python data structure but also as YAML content
|
||||
|
||||
Quickstart
|
||||
""""""""""
|
||||
|
||||
To use UTHelper, your test module will need only a bare minimal of code:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# tests/unit/plugin/modules/test_ansible_module.py
|
||||
from ansible_collections.community.general.plugins.modules import ansible_module
|
||||
from .uthelper import UTHelper, RunCommandMock
|
||||
|
||||
|
||||
UTHelper.from_module(ansible_module, __name__, mocks=[RunCommandMock])
|
||||
|
||||
Then, in the test specification file, you have:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# tests/unit/plugin/modules/test_ansible_module.yaml
|
||||
test_cases:
|
||||
- id: test_ansible_module
|
||||
flags:
|
||||
diff: true
|
||||
input:
|
||||
state: present
|
||||
name: Roger the Shrubber
|
||||
output:
|
||||
shrubbery:
|
||||
looks: nice
|
||||
price: not too expensive
|
||||
changed: true
|
||||
diff:
|
||||
before:
|
||||
shrubbery: null
|
||||
after:
|
||||
shrubbery:
|
||||
looks: nice
|
||||
price: not too expensive
|
||||
mocks:
|
||||
run_command:
|
||||
- command: [/testbin/shrubber, --version]
|
||||
rc: 0
|
||||
out: "2.80.0\n"
|
||||
err: ''
|
||||
- command: [/testbin/shrubber, --make-shrubbery]
|
||||
rc: 0
|
||||
out: 'Shrubbery created'
|
||||
err: ''
|
||||
|
||||
.. note::
|
||||
|
||||
If you prefer to pick a different YAML file for the test cases, or if you prefer to define them in plain Python,
|
||||
you can use the convenience methods ``UTHelper.from_file()`` and ``UTHelper.from_spec()``, respectively.
|
||||
See more details below.
|
||||
|
||||
|
||||
Using ``UTHelper``
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Test Module
|
||||
"""""""""""
|
||||
|
||||
``UTHelper`` is **strictly for unit tests**. To use it, you import the ``.uthelper.UTHelper`` class.
|
||||
As mentioned in different parts of this guide, there are three different mechanisms to load the test cases.
|
||||
|
||||
.. seealso::
|
||||
|
||||
See the UTHelper class reference below for API details on the three different mechanisms.
|
||||
|
||||
|
||||
The easies and most recommended way of using ``UTHelper`` is literally the example shown.
|
||||
See a real world example at
|
||||
`test_gconftool2.py <https://github.com/ansible-collections/community.general/blob/10.3.0/tests/unit/plugins/modules/test_gconftool2.py>`_.
|
||||
|
||||
The ``from_module()`` method will pick the filename of the test module up (in the example above, ``tests/unit/plugins/modules/test_gconftool2.py``)
|
||||
and it will search for ``tests/unit/plugins/modules/test_gconftool2.yaml`` (or ``.yml`` if that is not found).
|
||||
In that file it will expect to find the test specification expressed in YAML format, conforming to the structure described below LINK LINK LINK.
|
||||
|
||||
If you prefer to read the test specifications a different file path, use ``from_file()`` passing the file handle for the YAML file.
|
||||
|
||||
And, if for any reason you prefer or need to pass the data structure rather than dealing with YAML files, use the ``from_spec()`` method.
|
||||
A real world example for that can be found at
|
||||
`test_snap.py <https://github.com/ansible-collections/community.general/blob/main/tests/unit/plugins/modules/test_snap.py>`_.
|
||||
|
||||
|
||||
Test Specification
|
||||
""""""""""""""""""
|
||||
|
||||
The structure of the test specification data is described below.
|
||||
|
||||
Top level
|
||||
---------
|
||||
|
||||
At the top level there are two accepted keys:
|
||||
|
||||
- ``anchors: dict``
|
||||
Optional. Placeholder for you to define YAML anchors that can be repeated in the test cases.
|
||||
Its contents are never accessed directly by test Helper.
|
||||
- ``test_cases: list``
|
||||
Mandatory. List of test cases, see below for definition.
|
||||
|
||||
Test cases
|
||||
----------
|
||||
|
||||
You write the test cases with five elements:
|
||||
|
||||
- ``id: str``
|
||||
Mandatory. Used to identify the test case.
|
||||
|
||||
- ``flags: dict``
|
||||
Optional. Flags controling the behavior of the test case. All flags are optional. Accepted flags:
|
||||
|
||||
* ``check: bool``: set to ``true`` if the module is to be executed in **check mode**.
|
||||
* ``diff: bool``: set to ``true`` if the module is to be executed in **diff mode**.
|
||||
* ``skip: str``: set the test case to be skipped, providing the message for ``pytest.skip()``.
|
||||
* ``xfail: str``: set the test case to expect failure, providing the message for ``pytest.xfail()``.
|
||||
|
||||
- ``input: dict``
|
||||
Optional. Parameters for the Ansible module, it can be empty.
|
||||
|
||||
- ``output: dict``
|
||||
Optional. Expected return values from the Ansible module.
|
||||
All RV names are used here are expected to be found in the module output, but not all RVs in the output must be here.
|
||||
It can include special RVs such as ``changed`` and ``diff``.
|
||||
It can be empty.
|
||||
|
||||
- ``mocks: dict``
|
||||
Optional. Mocked interactions, ``run_command`` being the only one supported for now.
|
||||
Each key in this dictionary refers to one subclass of ``TestCaseMock`` and its
|
||||
structure is dictated by the ``TestCaseMock`` subclass implementation.
|
||||
All keys are expected to be named using snake case, as in ``run_command``.
|
||||
The ``TestCaseMock`` subclass is responsible for defining the name used in the test specification.
|
||||
The structure for that specification is dependent on the implementing class.
|
||||
See more details below for the implementation of ``RunCommandMock``
|
||||
|
||||
Example using YAML
|
||||
------------------
|
||||
|
||||
We recommend you use ``UTHelper`` reading the test specifications from a YAML file.
|
||||
See an example below of how one actually looks like (excerpt from ``test_opkg.yaml``):
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
---
|
||||
anchors:
|
||||
environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: false}
|
||||
test_cases:
|
||||
- id: install_zlibdev
|
||||
input:
|
||||
name: zlib-dev
|
||||
state: present
|
||||
output:
|
||||
msg: installed 1 package(s)
|
||||
mocks:
|
||||
run_command:
|
||||
- command: [/testbin/opkg, --version]
|
||||
environ: *env-def
|
||||
rc: 0
|
||||
out: ''
|
||||
err: ''
|
||||
- command: [/testbin/opkg, list-installed, zlib-dev]
|
||||
environ: *env-def
|
||||
rc: 0
|
||||
out: ''
|
||||
err: ''
|
||||
- command: [/testbin/opkg, install, zlib-dev]
|
||||
environ: *env-def
|
||||
rc: 0
|
||||
out: |
|
||||
Installing zlib-dev (1.2.11-6) to root...
|
||||
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib-dev_1.2.11-6_mips_24kc.ipk
|
||||
Installing zlib (1.2.11-6) to root...
|
||||
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib_1.2.11-6_mips_24kc.ipk
|
||||
Configuring zlib.
|
||||
Configuring zlib-dev.
|
||||
err: ''
|
||||
- command: [/testbin/opkg, list-installed, zlib-dev]
|
||||
environ: *env-def
|
||||
rc: 0
|
||||
out: |
|
||||
zlib-dev - 1.2.11-6
|
||||
err: ''
|
||||
- id: install_zlibdev_present
|
||||
input:
|
||||
name: zlib-dev
|
||||
state: present
|
||||
output:
|
||||
msg: package(s) already present
|
||||
mocks:
|
||||
run_command:
|
||||
- command: [/testbin/opkg, --version]
|
||||
environ: *env-def
|
||||
rc: 0
|
||||
out: ''
|
||||
err: ''
|
||||
- command: [/testbin/opkg, list-installed, zlib-dev]
|
||||
environ: *env-def
|
||||
rc: 0
|
||||
out: |
|
||||
zlib-dev - 1.2.11-6
|
||||
err: ''
|
||||
|
||||
TestCaseMocks Specifications
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The ``TestCaseMock`` subclass is free to define the expected data structure.
|
||||
|
||||
RunCommandMock Specification
|
||||
""""""""""""""""""""""""""""
|
||||
|
||||
``RunCommandMock`` mocks can be specified with the key ``run_command`` and it expects a ``list`` in which elements follow the structure:
|
||||
|
||||
- ``command: Union[list, str]``
|
||||
Mandatory. The command that is expected to be executed by the module. It corresponds to the parameter ``args`` of the ``AnsibleModule.run_command()`` call.
|
||||
It can be either a list or a string, though the list form is generally recommended.
|
||||
- ``environ: dict``
|
||||
Mandatory. All other parameters passed to the ``AnsibleModule.run_command()`` call.
|
||||
Most commonly used are ``environ_update`` and ``check_rc``.
|
||||
Must include all parameters the Ansible module uses in the ``AnsibleModule.run_command()`` call, otherwise the test will fail.
|
||||
- ``rc: int``
|
||||
Mandatory. The return code for the command execution.
|
||||
As per usual in bash scripting, a value of ``0`` means success, whereas any other number is an error code.
|
||||
- ``out: str``
|
||||
Mandatory. The *stdout* result of the command execution, as one single string containing zero or more lines.
|
||||
- ``err: str``
|
||||
Mandatory. The *stderr* result of the command execution, as one single string containing zero or more lines.
|
||||
|
||||
|
||||
``UTHelper`` Reference
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. py:module:: .uthelper
|
||||
|
||||
.. py:class:: UTHelper
|
||||
|
||||
A class to encapsulate unit tests.
|
||||
|
||||
.. py:staticmethod:: from_spec(ansible_module, test_module, test_spec, mocks=None)
|
||||
|
||||
Creates an ``UTHelper`` instance from a given test specification.
|
||||
|
||||
:param ansible_module: The Ansible module to be tested.
|
||||
:type ansible_module: module
|
||||
:param test_module: The test module.
|
||||
:type test_module: module
|
||||
:param test_spec: The test specification.
|
||||
:type test_spec: dict
|
||||
:param mocks: List of ``TestCaseMocks`` to be used during testing. Currently only ``RunCommandMock`` exists.
|
||||
:type mocks: list or None
|
||||
:return: An ``UTHelper`` instance.
|
||||
:rtype: UTHelper
|
||||
|
||||
Example usage of ``from_spec()``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import sys
|
||||
|
||||
from ansible_collections.community.general.plugins.modules import ansible_module
|
||||
from .uthelper import UTHelper, RunCommandMock
|
||||
|
||||
TEST_SPEC = dict(
|
||||
test_cases=[
|
||||
...
|
||||
]
|
||||
)
|
||||
|
||||
helper = UTHelper.from_spec(ansible_module, sys.modules[__name__], TEST_SPEC, mocks=[RunCommandMock])
|
||||
|
||||
.. py:staticmethod:: from_file(ansible_module, test_module, test_spec_filehandle, mocks=None)
|
||||
|
||||
Creates an ``UTHelper`` instance from a test specification file.
|
||||
|
||||
:param ansible_module: The Ansible module to be tested.
|
||||
:type ansible_module: module
|
||||
:param test_module: The test module.
|
||||
:type test_module: module
|
||||
:param test_spec_filehandle: A file handle to an file stream handle providing the test specification in YAML format.
|
||||
:type test_spec_filehandle: file
|
||||
:param mocks: List of ``TestCaseMocks`` to be used during testing. Currently only ``RunCommandMock`` exists.
|
||||
:type mocks: list or None
|
||||
:return: An ``UTHelper`` instance.
|
||||
:rtype: UTHelper
|
||||
|
||||
Example usage of ``from_file()``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import sys
|
||||
|
||||
from ansible_collections.community.general.plugins.modules import ansible_module
|
||||
from .uthelper import UTHelper, RunCommandMock
|
||||
|
||||
with open("test_spec.yaml", "r") as test_spec_filehandle:
|
||||
helper = UTHelper.from_file(ansible_module, sys.modules[__name__], test_spec_filehandle, mocks=[RunCommandMock])
|
||||
|
||||
.. py:staticmethod:: from_module(ansible_module, test_module_name, mocks=None)
|
||||
|
||||
Creates an ``UTHelper`` instance from a given Ansible module and test module.
|
||||
|
||||
:param ansible_module: The Ansible module to be tested.
|
||||
:type ansible_module: module
|
||||
:param test_module_name: The name of the test module. It works if passed ``__name__``.
|
||||
:type test_module_name: str
|
||||
:param mocks: List of ``TestCaseMocks`` to be used during testing. Currently only ``RunCommandMock`` exists.
|
||||
:type mocks: list or None
|
||||
:return: An ``UTHelper`` instance.
|
||||
:rtype: UTHelper
|
||||
|
||||
Example usage of ``from_module()``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from ansible_collections.community.general.plugins.modules import ansible_module
|
||||
from .uthelper import UTHelper, RunCommandMock
|
||||
|
||||
# Example usage
|
||||
helper = UTHelper.from_module(ansible_module, __name__, mocks=[RunCommandMock])
|
||||
|
||||
|
||||
Creating TestCaseMocks
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
To create a new ``TestCaseMock`` you must extend that class and implement the relevant parts:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class ShrubberyMock(TestCaseMock):
|
||||
# this name is mandatory, it is the name used in the test specification
|
||||
name = "shrubbery"
|
||||
|
||||
def setup(self, mocker):
|
||||
# perform setup, commonly using mocker to patch some other piece of code
|
||||
...
|
||||
|
||||
def check(self, test_case, results):
|
||||
# verify the tst execution met the expectations of the test case
|
||||
# for example the function was called as many times as it should
|
||||
...
|
||||
|
||||
def fixtures(self):
|
||||
# returns a dict mapping names to pytest fixtures that should be used for the test case
|
||||
# for example, in RunCommandMock it creates a fixture that patches AnsibleModule.get_bin_path
|
||||
...
|
||||
|
||||
Caveats
|
||||
^^^^^^^
|
||||
|
||||
Known issues/opportunities for improvement:
|
||||
|
||||
* Only one ``UTHelper`` per test module: UTHelper injects a test function with a fixed name into the module's namespace,
|
||||
so placing a second ``UTHelper`` instance is going to overwrite the function created by the first one.
|
||||
* Order of elements in module's namespace is not consistent across executions in Python 3.5, so if adding more tests to the test module
|
||||
might make Test Helper add its function before or after the other test functions.
|
||||
In the community.general collection the CI processes uses ``pytest-xdist`` to paralellize and distribute the tests,
|
||||
and it requires the order of the tests to be consistent.
|
||||
|
||||
.. versionadded:: 7.5.0
|
|
@ -51,7 +51,7 @@ And by the time the module is about to exit:
|
|||
|
||||
That makes the return value of the module:
|
||||
|
||||
.. code-block:: json
|
||||
.. code-block:: javascript
|
||||
|
||||
{
|
||||
"abc": 123,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
community.general Test (Plugin) Guide
|
||||
=====================================
|
||||
|
||||
The :anscollection:`community.general collection <community.general#collection>` offers currently one test plugin.
|
||||
The :ref:`community.general collection <plugins_in_community.general>` offers currently one test plugin.
|
||||
|
||||
.. contents:: Topics
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
namespace: community
|
||||
name: general
|
||||
version: 11.2.0
|
||||
version: 9.5.9
|
||||
readme: README.md
|
||||
authors:
|
||||
- Ansible (https://github.com/ansible)
|
||||
|
|
552
meta/runtime.yml
552
meta/runtime.yml
|
@ -3,7 +3,7 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
requires_ansible: '>=2.16.0'
|
||||
requires_ansible: '>=2.13.0'
|
||||
action_groups:
|
||||
consul:
|
||||
- consul_agent_check
|
||||
|
@ -15,37 +15,22 @@ action_groups:
|
|||
- consul_session
|
||||
- consul_token
|
||||
proxmox:
|
||||
- metadata:
|
||||
extend_group:
|
||||
- community.proxmox.proxmox
|
||||
keycloak:
|
||||
- keycloak_authentication
|
||||
- keycloak_authentication_required_actions
|
||||
- keycloak_authz_authorization_scope
|
||||
- keycloak_authz_custom_policy
|
||||
- keycloak_authz_permission
|
||||
- keycloak_authz_permission_info
|
||||
- keycloak_client
|
||||
- keycloak_client_rolemapping
|
||||
- keycloak_client_rolescope
|
||||
- keycloak_clientscope
|
||||
- keycloak_clientscope_type
|
||||
- keycloak_clientsecret_info
|
||||
- keycloak_clientsecret_regenerate
|
||||
- keycloak_clienttemplate
|
||||
- keycloak_component
|
||||
- keycloak_component_info
|
||||
- keycloak_group
|
||||
- keycloak_identity_provider
|
||||
- keycloak_realm
|
||||
- keycloak_realm_key
|
||||
- keycloak_realm_keys_metadata_info
|
||||
- keycloak_realm_rolemapping
|
||||
- keycloak_role
|
||||
- keycloak_user
|
||||
- keycloak_user_federation
|
||||
- keycloak_user_rolemapping
|
||||
- keycloak_userprofile
|
||||
- proxmox
|
||||
- proxmox_disk
|
||||
- proxmox_domain_info
|
||||
- proxmox_group_info
|
||||
- proxmox_kvm
|
||||
- proxmox_nic
|
||||
- proxmox_node_info
|
||||
- proxmox_pool
|
||||
- proxmox_pool_member
|
||||
- proxmox_snap
|
||||
- proxmox_storage_contents_info
|
||||
- proxmox_storage_info
|
||||
- proxmox_tasks_info
|
||||
- proxmox_template
|
||||
- proxmox_user_info
|
||||
- proxmox_vm_info
|
||||
plugin_routing:
|
||||
callback:
|
||||
actionable:
|
||||
|
@ -59,7 +44,7 @@ plugin_routing:
|
|||
warning_text: Use the 'default' callback plugin with 'display_skipped_hosts
|
||||
= no' option.
|
||||
hipchat:
|
||||
tombstone:
|
||||
deprecation:
|
||||
removal_version: 10.0.0
|
||||
warning_text: The hipchat service has been discontinued and the self-hosted variant has been End of Life since 2020.
|
||||
osx_say:
|
||||
|
@ -69,30 +54,16 @@ plugin_routing:
|
|||
removal_version: 2.0.0
|
||||
warning_text: Use the 'default' callback plugin with 'display_failed_stderr
|
||||
= yes' option.
|
||||
yaml:
|
||||
deprecation:
|
||||
removal_version: 12.0.0
|
||||
warning_text: >-
|
||||
The plugin has been superseded by the the option `result_format=yaml` in callback plugin ansible.builtin.default from ansible-core 2.13 onwards.
|
||||
connection:
|
||||
docker:
|
||||
redirect: community.docker.docker
|
||||
oc:
|
||||
redirect: community.okd.oc
|
||||
proxmox_pct_remote:
|
||||
redirect: community.proxmox.proxmox_pct_remote
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
lookup:
|
||||
gcp_storage_file:
|
||||
redirect: community.google.gcp_storage_file
|
||||
hashi_vault:
|
||||
redirect: community.hashi_vault.hashi_vault
|
||||
manifold:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: Company was acquired in 2021 and service was ceased afterwards.
|
||||
nios:
|
||||
redirect: infoblox.nios_modules.nios_lookup
|
||||
nios_next_ip:
|
||||
|
@ -100,68 +71,140 @@ plugin_routing:
|
|||
nios_next_network:
|
||||
redirect: infoblox.nios_modules.nios_next_network
|
||||
modules:
|
||||
consul_acl:
|
||||
deprecation:
|
||||
removal_version: 10.0.0
|
||||
warning_text: Use community.general.consul_token and/or community.general.consul_policy instead.
|
||||
hipchat:
|
||||
deprecation:
|
||||
removal_version: 11.0.0
|
||||
warning_text: The hipchat service has been discontinued and the self-hosted variant has been End of Life since 2020.
|
||||
rax_cbs_attachments:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_cbs:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_cdb_database:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_cdb_user:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_cdb:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_clb_nodes:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_clb_ssl:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_clb:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_dns_record:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_dns:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_facts:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_files_objects:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_files:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_identity:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_keypair:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_meta:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_mon_alarm:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_mon_check:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_mon_entity:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_mon_notification_plan:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_mon_notification:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_network:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_queue:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_scaling_group:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_scaling_policy:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rhn_channel:
|
||||
deprecation:
|
||||
removal_version: 10.0.0
|
||||
warning_text: RHN is EOL, please contact the community.general maintainers
|
||||
if still using this; see the module documentation for more details.
|
||||
rhn_register:
|
||||
deprecation:
|
||||
removal_version: 10.0.0
|
||||
warning_text: RHN is EOL, please contact the community.general maintainers
|
||||
if still using this; see the module documentation for more details.
|
||||
stackdriver:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on HTTPS APIs that do not exist anymore,
|
||||
and any new development in the direction of providing an alternative should
|
||||
happen in the context of the google.cloud collection.
|
||||
ali_instance_facts:
|
||||
tombstone:
|
||||
removal_version: 3.0.0
|
||||
warning_text: Use community.general.ali_instance_info instead.
|
||||
atomic_container:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: Project Atomic was sunset by the end of 2019.
|
||||
atomic_host:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: Project Atomic was sunset by the end of 2019.
|
||||
atomic_image:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: Project Atomic was sunset by the end of 2019.
|
||||
catapult:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: DNS fails to resolve the API endpoint used by the module since Oct 2024. See https://github.com/ansible-collections/community.general/issues/10318 for details.
|
||||
cisco_spark:
|
||||
redirect: community.general.cisco_webex
|
||||
clc_alert_policy:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: CenturyLink Cloud services went EOL in September 2023.
|
||||
clc_blueprint_package:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: CenturyLink Cloud services went EOL in September 2023.
|
||||
clc_firewall_policy:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: CenturyLink Cloud services went EOL in September 2023.
|
||||
clc_group:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: CenturyLink Cloud services went EOL in September 2023.
|
||||
clc_loadbalancer:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: CenturyLink Cloud services went EOL in September 2023.
|
||||
clc_modify_server:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: CenturyLink Cloud services went EOL in September 2023.
|
||||
clc_publicip:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: CenturyLink Cloud services went EOL in September 2023.
|
||||
clc_server:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: CenturyLink Cloud services went EOL in September 2023.
|
||||
clc_server_snapshot:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: CenturyLink Cloud services went EOL in September 2023.
|
||||
consul_acl:
|
||||
tombstone:
|
||||
removal_version: 10.0.0
|
||||
warning_text: Use community.general.consul_token and/or community.general.consul_policy instead.
|
||||
docker_compose:
|
||||
redirect: community.docker.docker_compose
|
||||
docker_config:
|
||||
|
@ -216,10 +259,6 @@ plugin_routing:
|
|||
redirect: community.docker.docker_volume
|
||||
docker_volume_info:
|
||||
redirect: community.docker.docker_volume_info
|
||||
facter:
|
||||
deprecation:
|
||||
removal_version: 12.0.0
|
||||
warning_text: Use community.general.facter_facts instead.
|
||||
flowdock:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
|
@ -313,10 +352,6 @@ plugin_routing:
|
|||
redirect: community.hrobot.firewall
|
||||
hetzner_firewall_info:
|
||||
redirect: community.hrobot.firewall_info
|
||||
hipchat:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: The hipchat service has been discontinued and the self-hosted variant has been End of Life since 2020.
|
||||
hpilo_facts:
|
||||
tombstone:
|
||||
removal_version: 3.0.0
|
||||
|
@ -638,116 +673,6 @@ plugin_routing:
|
|||
redirect: community.postgresql.postgresql_user
|
||||
postgresql_user_obj_stat_info:
|
||||
redirect: community.postgresql.postgresql_user_obj_stat_info
|
||||
profitbricks:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: Supporting library is unsupported since 2021.
|
||||
profitbricks_datacenter:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: Supporting library is unsupported since 2021.
|
||||
profitbricks_nic:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: Supporting library is unsupported since 2021.
|
||||
profitbricks_volume:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: Supporting library is unsupported since 2021.
|
||||
profitbricks_volume_attachments:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: Supporting library is unsupported since 2021.
|
||||
proxmox:
|
||||
redirect: community.proxmox.proxmox
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_backup:
|
||||
redirect: community.proxmox.proxmox_backup
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_backup_info:
|
||||
redirect: community.proxmox.proxmox_backup_info
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_disk:
|
||||
redirect: community.proxmox.proxmox_disk
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_domain_info:
|
||||
redirect: community.proxmox.proxmox_domain_info
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_group_info:
|
||||
redirect: community.proxmox.proxmox_group_info
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_kvm:
|
||||
redirect: community.proxmox.proxmox_kvm
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_nic:
|
||||
redirect: community.proxmox.proxmox_nic
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_node_info:
|
||||
redirect: community.proxmox.proxmox_node_info
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_pool:
|
||||
redirect: community.proxmox.proxmox_pool
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_pool_member:
|
||||
redirect: community.proxmox.proxmox_pool_member
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_snap:
|
||||
redirect: community.proxmox.proxmox_snap
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_storage_contents_info:
|
||||
redirect: community.proxmox.proxmox_storage_contents_info
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_storage_info:
|
||||
redirect: community.proxmox.proxmox_storage_info
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_tasks_info:
|
||||
redirect: community.proxmox.proxmox_tasks_info
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_template:
|
||||
redirect: community.proxmox.proxmox_template
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_user_info:
|
||||
redirect: community.proxmox.proxmox_user_info
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
proxmox_vm_info:
|
||||
redirect: community.proxmox.proxmox_vm_info
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
purefa_facts:
|
||||
tombstone:
|
||||
removal_version: 3.0.0
|
||||
|
@ -760,122 +685,10 @@ plugin_routing:
|
|||
tombstone:
|
||||
removal_version: 3.0.0
|
||||
warning_text: Use community.general.python_requirements_info instead.
|
||||
rax_cbs_attachments:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_cbs:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_cdb_database:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_cdb_user:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_cdb:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_clb_nodes:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_clb_ssl:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_clb:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_dns_record:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_dns:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_facts:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_files_objects:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_files:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_identity:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_keypair:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_meta:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_mon_alarm:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_mon_check:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_mon_entity:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_mon_notification_plan:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_mon_notification:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_network:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_queue:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_scaling_group:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
rax_scaling_policy:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on the deprecated package pyrax.
|
||||
redfish_facts:
|
||||
tombstone:
|
||||
removal_version: 3.0.0
|
||||
warning_text: Use community.general.redfish_info instead.
|
||||
rhn_channel:
|
||||
tombstone:
|
||||
removal_version: 10.0.0
|
||||
warning_text: RHN is EOL.
|
||||
rhn_register:
|
||||
tombstone:
|
||||
removal_version: 10.0.0
|
||||
warning_text: RHN is EOL.
|
||||
sapcar_extract:
|
||||
redirect: community.sap_libs.sapcar_extract
|
||||
sap_task_list_execute:
|
||||
|
@ -908,26 +721,6 @@ plugin_routing:
|
|||
tombstone:
|
||||
removal_version: 3.0.0
|
||||
warning_text: Use community.general.scaleway_volume_info instead.
|
||||
sensu_check:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: Sensu Core and Sensu Enterprise products have been End of Life since 2019/20.
|
||||
sensu_client:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: Sensu Core and Sensu Enterprise products have been End of Life since 2019/20.
|
||||
sensu_handler:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: Sensu Core and Sensu Enterprise products have been End of Life since 2019/20.
|
||||
sensu_silence:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: Sensu Core and Sensu Enterprise products have been End of Life since 2019/20.
|
||||
sensu_subscription:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: Sensu Core and Sensu Enterprise products have been End of Life since 2019/20.
|
||||
sf_account_manager:
|
||||
tombstone:
|
||||
removal_version: 2.0.0
|
||||
|
@ -952,16 +745,6 @@ plugin_routing:
|
|||
tombstone:
|
||||
removal_version: 3.0.0
|
||||
warning_text: Use community.general.smartos_image_info instead.
|
||||
stackdriver:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relied on HTTPS APIs that do not exist anymore,
|
||||
and any new development in the direction of providing an alternative should
|
||||
happen in the context of the google.cloud collection.
|
||||
typetalk:
|
||||
deprecation:
|
||||
removal_version: 13.0.0
|
||||
warning_text: The typetalk service will be discontinued on Dec 2025.
|
||||
vertica_facts:
|
||||
tombstone:
|
||||
removal_version: 3.0.0
|
||||
|
@ -996,6 +779,11 @@ plugin_routing:
|
|||
removal_version: 3.0.0
|
||||
warning_text: Use community.general.xenserver_guest_info instead.
|
||||
doc_fragments:
|
||||
rackspace:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This doc fragment was used by rax modules, that relied on the deprecated
|
||||
package pyrax.
|
||||
_gcp:
|
||||
redirect: community.google._gcp
|
||||
docker:
|
||||
|
@ -1010,21 +798,11 @@ plugin_routing:
|
|||
redirect: infoblox.nios_modules.nios
|
||||
postgresql:
|
||||
redirect: community.postgresql.postgresql
|
||||
proxmox:
|
||||
redirect: community.proxmox.proxmox
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
purestorage:
|
||||
deprecation:
|
||||
removal_version: 12.0.0
|
||||
warning_text: The modules for purestorage were removed in community.general 3.0.0, this document fragment was left behind.
|
||||
rackspace:
|
||||
module_utils:
|
||||
rax:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This doc fragment was used by rax modules, that relied on the deprecated
|
||||
package pyrax.
|
||||
module_utils:
|
||||
warning_text: This module util relied on the deprecated package pyrax.
|
||||
docker.common:
|
||||
redirect: community.docker.common
|
||||
docker.swarm:
|
||||
|
@ -1043,19 +821,6 @@ plugin_routing:
|
|||
redirect: infoblox.nios_modules.api
|
||||
postgresql:
|
||||
redirect: community.postgresql.postgresql
|
||||
proxmox:
|
||||
redirect: community.proxmox.proxmox
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
pure:
|
||||
deprecation:
|
||||
removal_version: 12.0.0
|
||||
warning_text: The modules for purestorage were removed in community.general 3.0.0, this module util was left behind.
|
||||
rax:
|
||||
tombstone:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module util relied on the deprecated package pyrax.
|
||||
remote_management.dellemc.dellemc_idrac:
|
||||
redirect: dellemc.openmanage.dellemc_idrac
|
||||
remote_management.dellemc.ome:
|
||||
|
@ -1065,17 +830,8 @@ plugin_routing:
|
|||
redirect: community.docker.docker_machine
|
||||
docker_swarm:
|
||||
redirect: community.docker.docker_swarm
|
||||
proxmox:
|
||||
redirect: community.proxmox.proxmox
|
||||
deprecation:
|
||||
removal_version: 15.0.0
|
||||
warning_text: The proxmox content has been moved to community.proxmox.
|
||||
kubevirt:
|
||||
redirect: community.kubevirt.kubevirt
|
||||
stackpath_compute:
|
||||
tombstone:
|
||||
removal_version: 11.0.0
|
||||
warning_text: The company and the service were sunset in June 2024.
|
||||
filter:
|
||||
path_join:
|
||||
# The ansible.builtin.path_join filter has been added in ansible-base 2.10.
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
import time
|
||||
|
||||
|
@ -21,33 +22,25 @@ class ActionModule(ActionBase):
|
|||
_VALID_ARGS = frozenset(('path', 'state', 'table', 'noflush', 'counters', 'modprobe', 'ip_version', 'wait'))
|
||||
DEFAULT_SUDOABLE = True
|
||||
|
||||
@staticmethod
|
||||
def msg_error__async_and_poll_not_zero(task_poll, task_async, max_timeout):
|
||||
return (
|
||||
MSG_ERROR__ASYNC_AND_POLL_NOT_ZERO = (
|
||||
"This module doesn't support async>0 and poll>0 when its 'state' param "
|
||||
"is set to 'restored'. To enable its rollback feature (that needs the "
|
||||
"module to run asynchronously on the remote), please set task attribute "
|
||||
f"'poll' (={task_poll}) to 0, and 'async' (={task_async}) to a value >2 and not greater than "
|
||||
f"'ansible_timeout' (={max_timeout}) (recommended).")
|
||||
|
||||
@staticmethod
|
||||
def msg_warning__no_async_is_no_rollback(task_poll, task_async, max_timeout):
|
||||
return (
|
||||
"'poll' (=%s) to 0, and 'async' (=%s) to a value >2 and not greater than "
|
||||
"'ansible_timeout' (=%s) (recommended).")
|
||||
MSG_WARNING__NO_ASYNC_IS_NO_ROLLBACK = (
|
||||
"Attempts to restore iptables state without rollback in case of mistake "
|
||||
"may lead the ansible controller to loose access to the hosts and never "
|
||||
"regain it before fixing firewall rules through a serial console, or any "
|
||||
f"other way except SSH. Please set task attribute 'poll' (={task_poll}) to 0, and "
|
||||
f"'async' (={task_async}) to a value >2 and not greater than 'ansible_timeout' (={max_timeout}) "
|
||||
"other way except SSH. Please set task attribute 'poll' (=%s) to 0, and "
|
||||
"'async' (=%s) to a value >2 and not greater than 'ansible_timeout' (=%s) "
|
||||
"(recommended).")
|
||||
|
||||
@staticmethod
|
||||
def msg_warning__async_greater_than_timeout(task_poll, task_async, max_timeout):
|
||||
return (
|
||||
MSG_WARNING__ASYNC_GREATER_THAN_TIMEOUT = (
|
||||
"You attempt to restore iptables state with rollback in case of mistake, "
|
||||
"but with settings that will lead this rollback to happen AFTER that the "
|
||||
"controller will reach its own timeout. Please set task attribute 'poll' "
|
||||
f"(={task_poll}) to 0, and 'async' (={task_async}) to a value >2 and not greater than "
|
||||
f"'ansible_timeout' (={max_timeout}) (recommended).")
|
||||
"(=%s) to 0, and 'async' (=%s) to a value >2 and not greater than "
|
||||
"'ansible_timeout' (=%s) (recommended).")
|
||||
|
||||
def _async_result(self, async_status_args, task_vars, timeout):
|
||||
'''
|
||||
|
@ -102,18 +95,18 @@ class ActionModule(ActionBase):
|
|||
if module_args.get('state', None) == 'restored':
|
||||
if not wrap_async:
|
||||
if not check_mode:
|
||||
display.warning(self.msg_error__async_and_poll_not_zero(
|
||||
display.warning(self.MSG_WARNING__NO_ASYNC_IS_NO_ROLLBACK % (
|
||||
task_poll,
|
||||
task_async,
|
||||
max_timeout))
|
||||
elif task_poll:
|
||||
raise AnsibleActionFail(self.msg_warning__no_async_is_no_rollback(
|
||||
raise AnsibleActionFail(self.MSG_ERROR__ASYNC_AND_POLL_NOT_ZERO % (
|
||||
task_poll,
|
||||
task_async,
|
||||
max_timeout))
|
||||
else:
|
||||
if task_async > max_timeout and not check_mode:
|
||||
display.warning(self.msg_warning__async_greater_than_timeout(
|
||||
display.warning(self.MSG_WARNING__ASYNC_GREATER_THAN_TIMEOUT % (
|
||||
task_poll,
|
||||
task_async,
|
||||
max_timeout))
|
||||
|
@ -126,10 +119,10 @@ class ActionModule(ActionBase):
|
|||
# remote and local sides (if not the same, make the loop
|
||||
# longer on the controller); and set a backup file path.
|
||||
module_args['_timeout'] = task_async
|
||||
module_args['_back'] = f'{async_dir}/iptables.state'
|
||||
module_args['_back'] = '%s/iptables.state' % async_dir
|
||||
async_status_args = dict(mode='status')
|
||||
confirm_cmd = f"rm -f {module_args['_back']}"
|
||||
starter_cmd = f"touch {module_args['_back']}.starter"
|
||||
confirm_cmd = 'rm -f %s' % module_args['_back']
|
||||
starter_cmd = 'touch %s.starter' % module_args['_back']
|
||||
remaining_time = max(task_async, max_timeout)
|
||||
|
||||
# do work!
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
from ansible.errors import AnsibleError, AnsibleConnectionFailure
|
||||
from ansible.module_utils.common.text.converters import to_native, to_text
|
||||
|
@ -17,10 +18,6 @@ from ansible.utils.display import Display
|
|||
display = Display()
|
||||
|
||||
|
||||
def fmt(mapping, key):
|
||||
return to_native(mapping[key]).strip()
|
||||
|
||||
|
||||
class TimedOutException(Exception):
|
||||
pass
|
||||
|
||||
|
@ -87,26 +84,31 @@ class ActionModule(ActionBase):
|
|||
def get_distribution(self, task_vars):
|
||||
# FIXME: only execute the module if we don't already have the facts we need
|
||||
distribution = {}
|
||||
display.debug(f'{self._task.action}: running setup module to get distribution')
|
||||
display.debug('{action}: running setup module to get distribution'.format(action=self._task.action))
|
||||
module_output = self._execute_module(
|
||||
task_vars=task_vars,
|
||||
module_name='ansible.legacy.setup',
|
||||
module_args={'gather_subset': 'min'})
|
||||
try:
|
||||
if module_output.get('failed', False):
|
||||
raise AnsibleError(f"Failed to determine system distribution. {fmt(module_output, 'module_stdout')}, {fmt(module_output, 'module_stderr')}")
|
||||
raise AnsibleError('Failed to determine system distribution. {0}, {1}'.format(
|
||||
to_native(module_output['module_stdout']).strip(),
|
||||
to_native(module_output['module_stderr']).strip()))
|
||||
distribution['name'] = module_output['ansible_facts']['ansible_distribution'].lower()
|
||||
distribution['version'] = to_text(
|
||||
module_output['ansible_facts']['ansible_distribution_version'].split('.')[0])
|
||||
distribution['family'] = to_text(module_output['ansible_facts']['ansible_os_family'].lower())
|
||||
display.debug(f"{self._task.action}: distribution: {distribution}")
|
||||
display.debug("{action}: distribution: {dist}".format(action=self._task.action, dist=distribution))
|
||||
return distribution
|
||||
except KeyError as ke:
|
||||
raise AnsibleError(f'Failed to get distribution information. Missing "{ke.args[0]}" in output.')
|
||||
raise AnsibleError('Failed to get distribution information. Missing "{0}" in output.'.format(ke.args[0]))
|
||||
|
||||
def get_shutdown_command(self, task_vars, distribution):
|
||||
def find_command(command, find_search_paths):
|
||||
display.debug(f'{self._task.action}: running find module looking in {find_search_paths} to get path for "{command}"')
|
||||
display.debug('{action}: running find module looking in {paths} to get path for "{command}"'.format(
|
||||
action=self._task.action,
|
||||
command=command,
|
||||
paths=find_search_paths))
|
||||
find_result = self._execute_module(
|
||||
task_vars=task_vars,
|
||||
# prevent collection search by calling with ansible.legacy (still allows library/ override of find)
|
||||
|
@ -128,37 +130,42 @@ class ActionModule(ActionBase):
|
|||
if is_string(search_paths):
|
||||
search_paths = [search_paths]
|
||||
|
||||
# Error if we didn't get a list
|
||||
err_msg = "'search_paths' must be a string or flat list of strings, got {0}"
|
||||
try:
|
||||
incorrect_type = any(not is_string(x) for x in search_paths)
|
||||
if not isinstance(search_paths, list) or incorrect_type:
|
||||
raise TypeError
|
||||
except TypeError:
|
||||
# Error if we didn't get a list
|
||||
err_msg = f"'search_paths' must be a string or flat list of strings, got {search_paths}"
|
||||
raise AnsibleError(err_msg)
|
||||
raise AnsibleError(err_msg.format(search_paths))
|
||||
|
||||
full_path = find_command(shutdown_bin, search_paths) # find the path to the shutdown command
|
||||
if not full_path: # if we could not find the shutdown command
|
||||
|
||||
# tell the user we will try with systemd
|
||||
display.vvv(f'Unable to find command "{shutdown_bin}" in search paths: {search_paths}, will attempt a shutdown using systemd directly.')
|
||||
display.vvv('Unable to find command "{0}" in search paths: {1}, will attempt a shutdown using systemd '
|
||||
'directly.'.format(shutdown_bin, search_paths)) # tell the user we will try with systemd
|
||||
systemctl_search_paths = ['/bin', '/usr/bin']
|
||||
full_path = find_command('systemctl', systemctl_search_paths) # find the path to the systemctl command
|
||||
if not full_path: # if we couldn't find systemctl
|
||||
raise AnsibleError(
|
||||
f'Could not find command "{shutdown_bin}" in search paths: {search_paths} or systemctl'
|
||||
f' command in search paths: {systemctl_search_paths}, unable to shutdown.') # we give up here
|
||||
'Could not find command "{0}" in search paths: {1} or systemctl command in search paths: {2}, unable to shutdown.'.
|
||||
format(shutdown_bin, search_paths, systemctl_search_paths)) # we give up here
|
||||
else:
|
||||
return f"{full_path[0]} poweroff" # done, since we cannot use args with systemd shutdown
|
||||
return "{0} poweroff".format(full_path[0]) # done, since we cannot use args with systemd shutdown
|
||||
|
||||
# systemd case taken care of, here we add args to the command
|
||||
args = self._get_value_from_facts('SHUTDOWN_COMMAND_ARGS', distribution, 'DEFAULT_SHUTDOWN_COMMAND_ARGS')
|
||||
# Convert seconds to minutes. If less that 60, set it to 0.
|
||||
delay_sec = self.delay
|
||||
shutdown_message = self._task.args.get('msg', self.DEFAULT_SHUTDOWN_MESSAGE)
|
||||
|
||||
af = args.format(delay_sec=delay_sec, delay_min=delay_sec // 60, message=shutdown_message)
|
||||
return f'{full_path[0]} {af}'
|
||||
return '{0} {1}'. \
|
||||
format(
|
||||
full_path[0],
|
||||
args.format(
|
||||
delay_sec=delay_sec,
|
||||
delay_min=delay_sec // 60,
|
||||
message=shutdown_message
|
||||
)
|
||||
)
|
||||
|
||||
def perform_shutdown(self, task_vars, distribution):
|
||||
result = {}
|
||||
|
@ -167,8 +174,9 @@ class ActionModule(ActionBase):
|
|||
|
||||
self.cleanup(force=True)
|
||||
try:
|
||||
display.vvv(f"{self._task.action}: shutting down server...")
|
||||
display.debug(f"{self._task.action}: shutting down server with command '{shutdown_command_exec}'")
|
||||
display.vvv("{action}: shutting down server...".format(action=self._task.action))
|
||||
display.debug("{action}: shutting down server with command '{command}'".
|
||||
format(action=self._task.action, command=shutdown_command_exec))
|
||||
if self._play_context.check_mode:
|
||||
shutdown_result['rc'] = 0
|
||||
else:
|
||||
|
@ -176,13 +184,16 @@ class ActionModule(ActionBase):
|
|||
except AnsibleConnectionFailure as e:
|
||||
# If the connection is closed too quickly due to the system being shutdown, carry on
|
||||
display.debug(
|
||||
f'{self._task.action}: AnsibleConnectionFailure caught and handled: {e}')
|
||||
'{action}: AnsibleConnectionFailure caught and handled: {error}'.format(action=self._task.action,
|
||||
error=to_text(e)))
|
||||
shutdown_result['rc'] = 0
|
||||
|
||||
if shutdown_result['rc'] != 0:
|
||||
result['failed'] = True
|
||||
result['shutdown'] = False
|
||||
result['msg'] = f"Shutdown command failed. Error was {fmt(shutdown_result, 'stdout')}, {fmt(shutdown_result, 'stderr')}"
|
||||
result['msg'] = "Shutdown command failed. Error was {stdout}, {stderr}".format(
|
||||
stdout=to_native(shutdown_result['stdout'].strip()),
|
||||
stderr=to_native(shutdown_result['stderr'].strip()))
|
||||
return result
|
||||
|
||||
result['failed'] = False
|
||||
|
@ -195,7 +206,7 @@ class ActionModule(ActionBase):
|
|||
|
||||
# If running with local connection, fail so we don't shutdown ourself
|
||||
if self._connection.transport == 'local' and (not self._play_context.check_mode):
|
||||
msg = f'Running {self._task.action} with local connection would shutdown the control node.'
|
||||
msg = 'Running {0} with local connection would shutdown the control node.'.format(self._task.action)
|
||||
return {'changed': False, 'elapsed': 0, 'shutdown': False, 'failed': True, 'msg': msg}
|
||||
|
||||
if task_vars is None:
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
# Copyright (c) 2018, Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
DOCUMENTATION = '''
|
||||
name: doas
|
||||
short_description: Do As user
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(doas) utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the doas utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_user:
|
||||
|
@ -26,7 +27,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_USER
|
||||
- name: ANSIBLE_DOAS_USER
|
||||
become_exe:
|
||||
description: C(doas) executable.
|
||||
description: Doas executable.
|
||||
type: string
|
||||
default: doas
|
||||
ini:
|
||||
|
@ -41,7 +42,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_DOAS_EXE
|
||||
become_flags:
|
||||
description: Options to pass to C(doas).
|
||||
description: Options to pass to doas.
|
||||
type: string
|
||||
default: ''
|
||||
ini:
|
||||
|
@ -56,7 +57,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_DOAS_FLAGS
|
||||
become_pass:
|
||||
description: Password for C(doas) prompt.
|
||||
description: Password for doas prompt.
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -72,7 +73,7 @@ options:
|
|||
prompt_l10n:
|
||||
description:
|
||||
- List of localized strings to match for prompt detection.
|
||||
- If empty the plugin uses the built-in one.
|
||||
- If empty we will use the built in one.
|
||||
type: list
|
||||
elements: string
|
||||
default: []
|
||||
|
@ -83,10 +84,7 @@ options:
|
|||
- name: ansible_doas_prompt_l10n
|
||||
env:
|
||||
- name: ANSIBLE_DOAS_PROMPT_L10N
|
||||
notes:
|
||||
- This become plugin does not work when connection pipelining is enabled. With ansible-core 2.19+, using it automatically
|
||||
disables pipelining. On ansible-core 2.18 and before, pipelining must explicitly be disabled by the user.
|
||||
"""
|
||||
'''
|
||||
|
||||
import re
|
||||
|
||||
|
@ -102,10 +100,6 @@ class BecomeModule(BecomeBase):
|
|||
fail = ('Permission denied',)
|
||||
missing = ('Authorization required',)
|
||||
|
||||
# See https://github.com/ansible-collections/community.general/issues/9977,
|
||||
# https://github.com/ansible/ansible/pull/78111
|
||||
pipelining = False
|
||||
|
||||
def check_password_prompt(self, b_output):
|
||||
''' checks if the expected password prompt exists in b_output '''
|
||||
|
||||
|
@ -131,9 +125,9 @@ class BecomeModule(BecomeBase):
|
|||
flags += ' -n'
|
||||
|
||||
become_user = self.get_option('become_user')
|
||||
user = f'-u {become_user}' if become_user else ''
|
||||
user = '-u %s' % (become_user) if become_user else ''
|
||||
|
||||
success_cmd = self._build_success_command(cmd, shell, noexe=True)
|
||||
executable = getattr(shell, 'executable', shell.SHELL_FAMILY)
|
||||
|
||||
return f'{become_exe} {flags} {user} {executable} -c {success_cmd}'
|
||||
return '%s %s %s %s -c %s' % (become_exe, flags, user, executable, success_cmd)
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
# Copyright (c) 2018, Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
DOCUMENTATION = '''
|
||||
name: dzdo
|
||||
short_description: Centrify's Direct Authorize
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(dzdo) utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the dzdo utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_user:
|
||||
|
@ -26,7 +27,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_USER
|
||||
- name: ANSIBLE_DZDO_USER
|
||||
become_exe:
|
||||
description: C(dzdo) executable.
|
||||
description: Dzdo executable.
|
||||
type: string
|
||||
default: dzdo
|
||||
ini:
|
||||
|
@ -41,7 +42,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_DZDO_EXE
|
||||
become_flags:
|
||||
description: Options to pass to C(dzdo).
|
||||
description: Options to pass to dzdo.
|
||||
type: string
|
||||
default: -H -S -n
|
||||
ini:
|
||||
|
@ -56,7 +57,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_DZDO_FLAGS
|
||||
become_pass:
|
||||
description: Options to pass to C(dzdo).
|
||||
description: Options to pass to dzdo.
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -69,7 +70,7 @@ options:
|
|||
ini:
|
||||
- section: dzdo_become_plugin
|
||||
key: password
|
||||
"""
|
||||
'''
|
||||
|
||||
from ansible.plugins.become import BecomeBase
|
||||
|
||||
|
@ -91,10 +92,10 @@ class BecomeModule(BecomeBase):
|
|||
|
||||
flags = self.get_option('become_flags')
|
||||
if self.get_option('become_pass'):
|
||||
self.prompt = f'[dzdo via ansible, key={self._id}] password:'
|
||||
flags = f"{flags.replace('-n', '')} -p \"{self.prompt}\""
|
||||
self.prompt = '[dzdo via ansible, key=%s] password:' % self._id
|
||||
flags = '%s -p "%s"' % (flags.replace('-n', ''), self.prompt)
|
||||
|
||||
become_user = self.get_option('become_user')
|
||||
user = f'-u {become_user}' if become_user else ''
|
||||
user = '-u %s' % (become_user) if become_user else ''
|
||||
|
||||
return f"{becomecmd} {flags} {user} {self._build_success_command(cmd, shell)}"
|
||||
return ' '.join([becomecmd, flags, user, self._build_success_command(cmd, shell)])
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
# Copyright (c) 2018, Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
DOCUMENTATION = '''
|
||||
name: ksu
|
||||
short_description: Kerberos substitute user
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(ksu) utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the ksu utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_user:
|
||||
|
@ -27,7 +28,7 @@ options:
|
|||
- name: ANSIBLE_KSU_USER
|
||||
required: true
|
||||
become_exe:
|
||||
description: C(ksu) executable.
|
||||
description: Su executable.
|
||||
type: string
|
||||
default: ksu
|
||||
ini:
|
||||
|
@ -42,7 +43,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_KSU_EXE
|
||||
become_flags:
|
||||
description: Options to pass to C(ksu).
|
||||
description: Options to pass to ksu.
|
||||
type: string
|
||||
default: ''
|
||||
ini:
|
||||
|
@ -57,7 +58,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_KSU_FLAGS
|
||||
become_pass:
|
||||
description: C(ksu) password.
|
||||
description: Ksu password.
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -73,7 +74,7 @@ options:
|
|||
prompt_l10n:
|
||||
description:
|
||||
- List of localized strings to match for prompt detection.
|
||||
- If empty the plugin uses the built-in one.
|
||||
- If empty we will use the built in one.
|
||||
type: list
|
||||
elements: string
|
||||
default: []
|
||||
|
@ -84,7 +85,7 @@ options:
|
|||
- name: ansible_ksu_prompt_l10n
|
||||
env:
|
||||
- name: ANSIBLE_KSU_PROMPT_L10N
|
||||
"""
|
||||
'''
|
||||
|
||||
import re
|
||||
|
||||
|
@ -123,4 +124,4 @@ class BecomeModule(BecomeBase):
|
|||
|
||||
flags = self.get_option('become_flags')
|
||||
user = self.get_option('become_user')
|
||||
return f'{exe} {user} {flags} -e {self._build_success_command(cmd, shell)} '
|
||||
return '%s %s %s -e %s ' % (exe, user, flags, self._build_success_command(cmd, shell))
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
# Copyright (c) 2018, Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
DOCUMENTATION = '''
|
||||
name: machinectl
|
||||
short_description: Systemd's machinectl privilege escalation
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(machinectl) utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the machinectl utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_user:
|
||||
|
@ -27,7 +28,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_USER
|
||||
- name: ANSIBLE_MACHINECTL_USER
|
||||
become_exe:
|
||||
description: C(machinectl) executable.
|
||||
description: Machinectl executable.
|
||||
type: string
|
||||
default: machinectl
|
||||
ini:
|
||||
|
@ -42,7 +43,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_MACHINECTL_EXE
|
||||
become_flags:
|
||||
description: Options to pass to C(machinectl).
|
||||
description: Options to pass to machinectl.
|
||||
type: string
|
||||
default: ''
|
||||
ini:
|
||||
|
@ -57,7 +58,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_MACHINECTL_FLAGS
|
||||
become_pass:
|
||||
description: Password for C(machinectl).
|
||||
description: Password for machinectl.
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -71,25 +72,24 @@ options:
|
|||
- section: machinectl_become_plugin
|
||||
key: password
|
||||
notes:
|
||||
- When not using this plugin with user V(root), it only works correctly with a polkit rule which alters the behaviour
|
||||
of C(machinectl). This rule must alter the prompt behaviour to ask directly for the user credentials, if the user is allowed
|
||||
to perform the action (take a look at the examples section). If such a rule is not present the plugin only works if it
|
||||
is used in context with the root user, because then no further prompt is shown by C(machinectl).
|
||||
- This become plugin does not work when connection pipelining is enabled. With ansible-core 2.19+, using it automatically
|
||||
disables pipelining. On ansible-core 2.18 and before, pipelining must explicitly be disabled by the user.
|
||||
"""
|
||||
- When not using this plugin with user V(root), it only works correctly with a polkit rule which will alter
|
||||
the behaviour of machinectl. This rule must alter the prompt behaviour to ask directly for the user credentials,
|
||||
if the user is allowed to perform the action (take a look at the examples section).
|
||||
If such a rule is not present the plugin only work if it is used in context with the root user,
|
||||
because then no further prompt will be shown by machinectl.
|
||||
'''
|
||||
|
||||
EXAMPLES = r"""
|
||||
EXAMPLES = r'''
|
||||
# A polkit rule needed to use the module with a non-root user.
|
||||
# See the Notes section for details.
|
||||
/etc/polkit-1/rules.d/60-machinectl-fast-user-auth.rules: |-
|
||||
/etc/polkit-1/rules.d/60-machinectl-fast-user-auth.rules: |
|
||||
polkit.addRule(function(action, subject) {
|
||||
if(action.id == "org.freedesktop.machine1.host-shell" &&
|
||||
subject.isInGroup("wheel")) {
|
||||
return polkit.Result.AUTH_SELF_KEEP;
|
||||
}
|
||||
});
|
||||
"""
|
||||
'''
|
||||
|
||||
from re import compile as re_compile
|
||||
|
||||
|
@ -109,10 +109,6 @@ class BecomeModule(BecomeBase):
|
|||
success = ('==== AUTHENTICATION COMPLETE ====',)
|
||||
require_tty = True # see https://github.com/ansible-collections/community.general/issues/6932
|
||||
|
||||
# See https://github.com/ansible/ansible/issues/81254,
|
||||
# https://github.com/ansible/ansible/pull/78111
|
||||
pipelining = False
|
||||
|
||||
@staticmethod
|
||||
def remove_ansi_codes(line):
|
||||
return ansi_color_codes.sub(b"", line)
|
||||
|
@ -127,7 +123,7 @@ class BecomeModule(BecomeBase):
|
|||
|
||||
flags = self.get_option('become_flags')
|
||||
user = self.get_option('become_user')
|
||||
return f'{become} -q shell {flags} {user}@ {self._build_success_command(cmd, shell)}'
|
||||
return '%s -q shell %s %s@ %s' % (become, flags, user, self._build_success_command(cmd, shell))
|
||||
|
||||
def check_success(self, b_output):
|
||||
b_output = self.remove_ansi_codes(b_output)
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
# Copyright (c) 2018, Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
DOCUMENTATION = '''
|
||||
name: pbrun
|
||||
short_description: PowerBroker run
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(pbrun) utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the pbrun utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_user:
|
||||
|
@ -27,7 +28,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_USER
|
||||
- name: ANSIBLE_PBRUN_USER
|
||||
become_exe:
|
||||
description: C(pbrun) executable.
|
||||
description: Sudo executable.
|
||||
type: string
|
||||
default: pbrun
|
||||
ini:
|
||||
|
@ -42,7 +43,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_PBRUN_EXE
|
||||
become_flags:
|
||||
description: Options to pass to C(pbrun).
|
||||
description: Options to pass to pbrun.
|
||||
type: string
|
||||
default: ''
|
||||
ini:
|
||||
|
@ -57,7 +58,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_PBRUN_FLAGS
|
||||
become_pass:
|
||||
description: Password for C(pbrun).
|
||||
description: Password for pbrun.
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -71,7 +72,7 @@ options:
|
|||
- section: pbrun_become_plugin
|
||||
key: password
|
||||
wrap_exe:
|
||||
description: Toggle to wrap the command C(pbrun) calls in C(shell -c) or not.
|
||||
description: Toggle to wrap the command pbrun calls in C(shell -c) or not.
|
||||
default: false
|
||||
type: bool
|
||||
ini:
|
||||
|
@ -81,7 +82,7 @@ options:
|
|||
- name: ansible_pbrun_wrap_execution
|
||||
env:
|
||||
- name: ANSIBLE_PBRUN_WRAP_EXECUTION
|
||||
"""
|
||||
'''
|
||||
|
||||
from ansible.plugins.become import BecomeBase
|
||||
|
||||
|
@ -102,7 +103,7 @@ class BecomeModule(BecomeBase):
|
|||
|
||||
flags = self.get_option('become_flags')
|
||||
become_user = self.get_option('become_user')
|
||||
user = f'-u {become_user}' if become_user else ''
|
||||
user = '-u %s' % (become_user) if become_user else ''
|
||||
noexe = not self.get_option('wrap_exe')
|
||||
|
||||
return f"{become_exe} {flags} {user} {self._build_success_command(cmd, shell, noexe=noexe)}"
|
||||
return ' '.join([become_exe, flags, user, self._build_success_command(cmd, shell, noexe=noexe)])
|
||||
|
|
|
@ -2,20 +2,21 @@
|
|||
# Copyright (c) 2018, Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
DOCUMENTATION = '''
|
||||
name: pfexec
|
||||
short_description: Profile based execution
|
||||
short_description: profile based execution
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(pfexec) utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the pfexec utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_user:
|
||||
description:
|
||||
- User you 'become' to execute the task.
|
||||
- This plugin ignores this setting as pfexec uses its own C(exec_attr) to figure this out, but it is supplied here for
|
||||
Ansible to make decisions needed for the task execution, like file permissions.
|
||||
- This plugin ignores this setting as pfexec uses it's own C(exec_attr) to figure this out,
|
||||
but it is supplied here for Ansible to make decisions needed for the task execution, like file permissions.
|
||||
type: string
|
||||
default: root
|
||||
ini:
|
||||
|
@ -30,7 +31,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_USER
|
||||
- name: ANSIBLE_PFEXEC_USER
|
||||
become_exe:
|
||||
description: C(pfexec) executable.
|
||||
description: Sudo executable.
|
||||
type: string
|
||||
default: pfexec
|
||||
ini:
|
||||
|
@ -45,7 +46,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_PFEXEC_EXE
|
||||
become_flags:
|
||||
description: Options to pass to C(pfexec).
|
||||
description: Options to pass to pfexec.
|
||||
type: string
|
||||
default: -H -S -n
|
||||
ini:
|
||||
|
@ -60,7 +61,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_PFEXEC_FLAGS
|
||||
become_pass:
|
||||
description: C(pfexec) password.
|
||||
description: pfexec password.
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -74,7 +75,7 @@ options:
|
|||
- section: pfexec_become_plugin
|
||||
key: password
|
||||
wrap_exe:
|
||||
description: Toggle to wrap the command C(pfexec) calls in C(shell -c) or not.
|
||||
description: Toggle to wrap the command pfexec calls in C(shell -c) or not.
|
||||
default: false
|
||||
type: bool
|
||||
ini:
|
||||
|
@ -86,7 +87,7 @@ options:
|
|||
- name: ANSIBLE_PFEXEC_WRAP_EXECUTION
|
||||
notes:
|
||||
- This plugin ignores O(become_user) as pfexec uses its own C(exec_attr) to figure this out.
|
||||
"""
|
||||
'''
|
||||
|
||||
from ansible.plugins.become import BecomeBase
|
||||
|
||||
|
@ -105,4 +106,4 @@ class BecomeModule(BecomeBase):
|
|||
|
||||
flags = self.get_option('become_flags')
|
||||
noexe = not self.get_option('wrap_exe')
|
||||
return f'{exe} {flags} {self._build_success_command(cmd, shell, noexe=noexe)}'
|
||||
return '%s %s %s' % (exe, flags, self._build_success_command(cmd, shell, noexe=noexe))
|
||||
|
|
|
@ -2,17 +2,18 @@
|
|||
# Copyright (c) 2018, Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
DOCUMENTATION = '''
|
||||
name: pmrun
|
||||
short_description: Privilege Manager run
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(pmrun) utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the pmrun utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_exe:
|
||||
description: C(pmrun) executable.
|
||||
description: Sudo executable
|
||||
type: string
|
||||
default: pmrun
|
||||
ini:
|
||||
|
@ -27,7 +28,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_PMRUN_EXE
|
||||
become_flags:
|
||||
description: Options to pass to C(pmrun).
|
||||
description: Options to pass to pmrun.
|
||||
type: string
|
||||
default: ''
|
||||
ini:
|
||||
|
@ -42,7 +43,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_PMRUN_FLAGS
|
||||
become_pass:
|
||||
description: C(pmrun) password.
|
||||
description: pmrun password.
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -56,8 +57,8 @@ options:
|
|||
- section: pmrun_become_plugin
|
||||
key: password
|
||||
notes:
|
||||
- This plugin ignores the C(become_user) supplied and uses C(pmrun)'s own configuration to select the user.
|
||||
"""
|
||||
- This plugin ignores the become_user supplied and uses pmrun's own configuration to select the user.
|
||||
'''
|
||||
|
||||
from ansible.plugins.become import BecomeBase
|
||||
from ansible.module_utils.six.moves import shlex_quote
|
||||
|
@ -77,4 +78,4 @@ class BecomeModule(BecomeBase):
|
|||
become = self.get_option('become_exe')
|
||||
|
||||
flags = self.get_option('become_flags')
|
||||
return f'{become} {flags} {shlex_quote(self._build_success_command(cmd, shell))}'
|
||||
return '%s %s %s' % (become, flags, shlex_quote(self._build_success_command(cmd, shell)))
|
||||
|
|
|
@ -3,14 +3,15 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
DOCUMENTATION = """
|
||||
name: run0
|
||||
short_description: Systemd's run0
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(run0) utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the C(run0) utility.
|
||||
author:
|
||||
- Thomas Sjögren (@konstruktoid)
|
||||
version_added: '9.0.0'
|
||||
|
@ -31,7 +32,7 @@ options:
|
|||
- name: ANSIBLE_RUN0_USER
|
||||
type: string
|
||||
become_exe:
|
||||
description: C(run0) executable.
|
||||
description: The C(run0) executable.
|
||||
default: run0
|
||||
ini:
|
||||
- section: privilege_escalation
|
||||
|
@ -46,7 +47,7 @@ options:
|
|||
- name: ANSIBLE_RUN0_EXE
|
||||
type: string
|
||||
become_flags:
|
||||
description: Options to pass to C(run0).
|
||||
description: Options to pass to run0.
|
||||
default: ''
|
||||
ini:
|
||||
- section: privilege_escalation
|
||||
|
@ -61,13 +62,13 @@ options:
|
|||
- name: ANSIBLE_RUN0_FLAGS
|
||||
type: string
|
||||
notes:
|
||||
- This plugin only works when a C(polkit) rule is in place.
|
||||
- This plugin will only work when a polkit rule is in place.
|
||||
"""
|
||||
|
||||
EXAMPLES = r"""
|
||||
# An example polkit rule that allows the user 'ansible' in the 'wheel' group
|
||||
# to execute commands using run0 without authentication.
|
||||
/etc/polkit-1/rules.d/60-run0-fast-user-auth.rules: |-
|
||||
/etc/polkit-1/rules.d/60-run0-fast-user-auth.rules: |
|
||||
polkit.addRule(function(action, subject) {
|
||||
if(action.id == "org.freedesktop.systemd1.manage-units" &&
|
||||
subject.isInGroup("wheel") &&
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
# Copyright (c) 2018, Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
DOCUMENTATION = '''
|
||||
name: sesu
|
||||
short_description: CA Privileged Access Manager
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(sesu) utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the sesu utility.
|
||||
author: ansible (@nekonyuu)
|
||||
options:
|
||||
become_user:
|
||||
|
@ -27,7 +28,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_USER
|
||||
- name: ANSIBLE_SESU_USER
|
||||
become_exe:
|
||||
description: C(sesu) executable.
|
||||
description: sesu executable.
|
||||
type: string
|
||||
default: sesu
|
||||
ini:
|
||||
|
@ -42,7 +43,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_SESU_EXE
|
||||
become_flags:
|
||||
description: Options to pass to C(sesu).
|
||||
description: Options to pass to sesu.
|
||||
type: string
|
||||
default: -H -S -n
|
||||
ini:
|
||||
|
@ -57,7 +58,7 @@ options:
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_SESU_FLAGS
|
||||
become_pass:
|
||||
description: Password to pass to C(sesu).
|
||||
description: Password to pass to sesu.
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -70,7 +71,7 @@ options:
|
|||
ini:
|
||||
- section: sesu_become_plugin
|
||||
key: password
|
||||
"""
|
||||
'''
|
||||
|
||||
from ansible.plugins.become import BecomeBase
|
||||
|
||||
|
@ -92,4 +93,4 @@ class BecomeModule(BecomeBase):
|
|||
|
||||
flags = self.get_option('become_flags')
|
||||
user = self.get_option('become_user')
|
||||
return f'{become} {flags} {user} -c {self._build_success_command(cmd, shell)}'
|
||||
return '%s %s %s -c %s' % (become, flags, user, self._build_success_command(cmd, shell))
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
# Copyright (c) 2021, Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
DOCUMENTATION = """
|
||||
name: sudosu
|
||||
short_description: Run tasks using sudo su -
|
||||
description:
|
||||
- This become plugin allows your remote/login user to execute commands as another user using the C(sudo) and C(su) utilities
|
||||
combined.
|
||||
- This become plugin allows your remote/login user to execute commands as another user via the C(sudo) and C(su) utilities combined.
|
||||
author:
|
||||
- Dag Wieers (@dagwieers)
|
||||
version_added: 2.4.0
|
||||
|
@ -60,8 +60,8 @@ options:
|
|||
key: password
|
||||
alt_method:
|
||||
description:
|
||||
- Whether to use an alternative method to call C(su). Instead of running C(su -l user /path/to/shell -c command), it
|
||||
runs C(su -l user -c command).
|
||||
- Whether to use an alternative method to call C(su). Instead of running C(su -l user /path/to/shell -c command),
|
||||
it runs C(su -l user -c command).
|
||||
- Use this when the default one is not working on your system.
|
||||
required: false
|
||||
type: boolean
|
||||
|
@ -98,16 +98,16 @@ class BecomeModule(BecomeBase):
|
|||
flags = self.get_option('become_flags') or ''
|
||||
prompt = ''
|
||||
if self.get_option('become_pass'):
|
||||
self.prompt = f'[sudo via ansible, key={self._id}] password:'
|
||||
self.prompt = '[sudo via ansible, key=%s] password:' % self._id
|
||||
if flags: # this could be simplified, but kept as is for now for backwards string matching
|
||||
flags = flags.replace('-n', '')
|
||||
prompt = f'-p "{self.prompt}"'
|
||||
prompt = '-p "%s"' % (self.prompt)
|
||||
|
||||
user = self.get_option('become_user') or ''
|
||||
if user:
|
||||
user = f'{user}'
|
||||
user = '%s' % (user)
|
||||
|
||||
if self.get_option('alt_method'):
|
||||
return f"{becomecmd} {flags} {prompt} su -l {user} -c {self._build_success_command(cmd, shell, True)}"
|
||||
return ' '.join([becomecmd, flags, prompt, "su -l", user, "-c", self._build_success_command(cmd, shell, True)])
|
||||
else:
|
||||
return f"{becomecmd} {flags} {prompt} su -l {user} {self._build_success_command(cmd, shell)}"
|
||||
return ' '.join([becomecmd, flags, prompt, 'su -l', user, self._build_success_command(cmd, shell)])
|
||||
|
|
5
plugins/cache/memcached.py
vendored
5
plugins/cache/memcached.py
vendored
|
@ -4,7 +4,8 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Unknown (!UNKNOWN)
|
||||
|
@ -190,7 +191,7 @@ class CacheModule(BaseCacheModule):
|
|||
self._keys = CacheModuleKeys(self._db, self._db.get(CacheModuleKeys.PREFIX) or [])
|
||||
|
||||
def _make_key(self, key):
|
||||
return f"{self._prefix}{key}"
|
||||
return "{0}{1}".format(self._prefix, key)
|
||||
|
||||
def _expire_keys(self):
|
||||
if self._timeout > 0:
|
||||
|
|
5
plugins/cache/pickle.py
vendored
5
plugins/cache/pickle.py
vendored
|
@ -5,7 +5,8 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
name: pickle
|
||||
|
@ -17,7 +18,7 @@ options:
|
|||
_uri:
|
||||
required: true
|
||||
description:
|
||||
- Path in which the cache plugin saves the files.
|
||||
- Path in which the cache plugin will save the files.
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_CONNECTION
|
||||
ini:
|
||||
|
|
10
plugins/cache/redis.py
vendored
10
plugins/cache/redis.py
vendored
|
@ -3,7 +3,8 @@
|
|||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Unknown (!UNKNOWN)
|
||||
|
@ -72,6 +73,7 @@ import time
|
|||
import json
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
from ansible.parsing.ajson import AnsibleJSONEncoder, AnsibleJSONDecoder
|
||||
from ansible.plugins.cache import BaseCacheModule
|
||||
from ansible.utils.display import Display
|
||||
|
@ -129,7 +131,7 @@ class CacheModule(BaseCacheModule):
|
|||
connection = self._parse_connection(self.re_url_conn, uri)
|
||||
self._db = StrictRedis(*connection, **kw)
|
||||
|
||||
display.vv(f'Redis connection: {self._db}')
|
||||
display.vv('Redis connection: %s' % self._db)
|
||||
|
||||
@staticmethod
|
||||
def _parse_connection(re_patt, uri):
|
||||
|
@ -162,12 +164,12 @@ class CacheModule(BaseCacheModule):
|
|||
pass # password is optional
|
||||
|
||||
sentinels = [self._parse_connection(self.re_sent_conn, shost) for shost in connections]
|
||||
display.vv(f'\nUsing redis sentinels: {sentinels}')
|
||||
display.vv('\nUsing redis sentinels: %s' % sentinels)
|
||||
scon = Sentinel(sentinels, **kw)
|
||||
try:
|
||||
return scon.master_for(self._sentinel_service_name, socket_timeout=0.2)
|
||||
except Exception as exc:
|
||||
raise AnsibleError(f'Could not connect to redis sentinel: {exc}')
|
||||
raise AnsibleError('Could not connect to redis sentinel: %s' % to_native(exc))
|
||||
|
||||
def _make_key(self, key):
|
||||
return self._prefix + key
|
||||
|
|
5
plugins/cache/yaml.py
vendored
5
plugins/cache/yaml.py
vendored
|
@ -5,7 +5,8 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
name: yaml
|
||||
|
@ -17,7 +18,7 @@ options:
|
|||
_uri:
|
||||
required: true
|
||||
description:
|
||||
- Path in which the cache plugin saves the files.
|
||||
- Path in which the cache plugin will save the files.
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_CONNECTION
|
||||
ini:
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Unknown (!UNKNOWN)
|
||||
|
@ -114,7 +115,7 @@ class CallbackModule(CallbackBase):
|
|||
max_results = int(f.read().strip()) / 1024 / 1024
|
||||
|
||||
self._display.banner('CGROUP MEMORY RECAP')
|
||||
self._display.display(f'Execution Maximum: {max_results:0.2f}MB\n\n')
|
||||
self._display.display('Execution Maximum: %0.2fMB\n\n' % max_results)
|
||||
|
||||
for task, memory in self.task_results:
|
||||
self._display.display(f'{task.get_name()} ({task._uuid}): {memory:0.2f}MB')
|
||||
self._display.display('%s (%s): %0.2fMB' % (task.get_name(), task._uuid, memory))
|
||||
|
|
|
@ -4,13 +4,14 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Unknown (!UNKNOWN)
|
||||
name: context_demo
|
||||
type: aggregate
|
||||
short_description: Demo callback that adds play/task context
|
||||
short_description: demo callback that adds play/task context
|
||||
description:
|
||||
- Displays some play and task context along with normal output.
|
||||
- This is mostly for demo purposes.
|
||||
|
@ -37,15 +38,15 @@ class CallbackModule(CallbackBase):
|
|||
self.play = None
|
||||
|
||||
def v2_on_any(self, *args, **kwargs):
|
||||
self._display.display(f"--- play: {getattr(self.play, 'name', None)} task: {self.task} ---")
|
||||
self._display.display("--- play: {0} task: {1} ---".format(getattr(self.play, 'name', None), self.task))
|
||||
|
||||
self._display.display(" --- ARGS ")
|
||||
for i, a in enumerate(args):
|
||||
self._display.display(f' {i}: {a}')
|
||||
self._display.display(' %s: %s' % (i, a))
|
||||
|
||||
self._display.display(" --- KWARGS ")
|
||||
for k in kwargs:
|
||||
self._display.display(f' {k}: {kwargs[k]}')
|
||||
self._display.display(' %s: %s' % (k, kwargs[k]))
|
||||
|
||||
def v2_playbook_on_play_start(self, play):
|
||||
self.play = play
|
||||
|
|
|
@ -6,17 +6,18 @@
|
|||
Counter enabled Ansible callback plugin (See DOCUMENTATION for more information)
|
||||
'''
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Unknown (!UNKNOWN)
|
||||
name: counter_enabled
|
||||
type: stdout
|
||||
short_description: Adds counters to the output items (tasks and hosts/task)
|
||||
short_description: adds counters to the output items (tasks and hosts/task)
|
||||
description:
|
||||
- Use this callback when you need a kind of progress bar on a large environments.
|
||||
- You can see how many tasks has the playbook to run, and which one is actually running.
|
||||
- You can see how many hosts may run a task, and which of them is actually running.
|
||||
- You will know how many tasks has the playbook to run, and which one is actually running.
|
||||
- You will know how many hosts may run a task, and which of them is actually running.
|
||||
extends_documentation_fragment:
|
||||
- default_callback
|
||||
requirements:
|
||||
|
@ -70,7 +71,7 @@ class CallbackModule(CallbackBase):
|
|||
if not name:
|
||||
msg = u"play"
|
||||
else:
|
||||
msg = f"PLAY [{name}]"
|
||||
msg = u"PLAY [%s]" % name
|
||||
|
||||
self._play = play
|
||||
|
||||
|
@ -90,17 +91,25 @@ class CallbackModule(CallbackBase):
|
|||
for host in hosts:
|
||||
stat = stats.summarize(host)
|
||||
|
||||
self._display.display(
|
||||
f"{hostcolor(host, stat)} : {colorize('ok', stat['ok'], C.COLOR_OK)} {colorize('changed', stat['changed'], C.COLOR_CHANGED)} "
|
||||
f"{colorize('unreachable', stat['unreachable'], C.COLOR_UNREACHABLE)} {colorize('failed', stat['failures'], C.COLOR_ERROR)} "
|
||||
f"{colorize('rescued', stat['rescued'], C.COLOR_OK)} {colorize('ignored', stat['ignored'], C.COLOR_WARN)}",
|
||||
self._display.display(u"%s : %s %s %s %s %s %s" % (
|
||||
hostcolor(host, stat),
|
||||
colorize(u'ok', stat['ok'], C.COLOR_OK),
|
||||
colorize(u'changed', stat['changed'], C.COLOR_CHANGED),
|
||||
colorize(u'unreachable', stat['unreachable'], C.COLOR_UNREACHABLE),
|
||||
colorize(u'failed', stat['failures'], C.COLOR_ERROR),
|
||||
colorize(u'rescued', stat['rescued'], C.COLOR_OK),
|
||||
colorize(u'ignored', stat['ignored'], C.COLOR_WARN)),
|
||||
screen_only=True
|
||||
)
|
||||
|
||||
self._display.display(
|
||||
f"{hostcolor(host, stat, False)} : {colorize('ok', stat['ok'], None)} {colorize('changed', stat['changed'], None)} "
|
||||
f"{colorize('unreachable', stat['unreachable'], None)} {colorize('failed', stat['failures'], None)} "
|
||||
f"{colorize('rescued', stat['rescued'], None)} {colorize('ignored', stat['ignored'], None)}",
|
||||
self._display.display(u"%s : %s %s %s %s %s %s" % (
|
||||
hostcolor(host, stat, False),
|
||||
colorize(u'ok', stat['ok'], None),
|
||||
colorize(u'changed', stat['changed'], None),
|
||||
colorize(u'unreachable', stat['unreachable'], None),
|
||||
colorize(u'failed', stat['failures'], None),
|
||||
colorize(u'rescued', stat['rescued'], None),
|
||||
colorize(u'ignored', stat['ignored'], None)),
|
||||
log_only=True
|
||||
)
|
||||
|
||||
|
@ -115,14 +124,12 @@ class CallbackModule(CallbackBase):
|
|||
for k in sorted(stats.custom.keys()):
|
||||
if k == '_run':
|
||||
continue
|
||||
_custom_stats = self._dump_results(stats.custom[k], indent=1).replace('\n', '')
|
||||
self._display.display(f'\t{k}: {_custom_stats}')
|
||||
self._display.display('\t%s: %s' % (k, self._dump_results(stats.custom[k], indent=1).replace('\n', '')))
|
||||
|
||||
# print per run custom stats
|
||||
if '_run' in stats.custom:
|
||||
self._display.display("", screen_only=True)
|
||||
_custom_stats_run = self._dump_results(stats.custom['_run'], indent=1).replace('\n', '')
|
||||
self._display.display(f'\tRUN: {_custom_stats_run}')
|
||||
self._display.display('\tRUN: %s' % self._dump_results(stats.custom['_run'], indent=1).replace('\n', ''))
|
||||
self._display.display("", screen_only=True)
|
||||
|
||||
def v2_playbook_on_task_start(self, task, is_conditional):
|
||||
|
@ -136,13 +143,13 @@ class CallbackModule(CallbackBase):
|
|||
# that they can secure this if they feel that their stdout is insecure
|
||||
# (shoulder surfing, logging stdout straight to a file, etc).
|
||||
if not task.no_log and C.DISPLAY_ARGS_TO_STDOUT:
|
||||
args = ', '.join(('{k}={v}' for k, v in task.args.items()))
|
||||
args = f' {args}'
|
||||
self._display.banner(f"TASK {self._task_counter}/{self._task_total} [{task.get_name().strip()}{args}]")
|
||||
args = ', '.join(('%s=%s' % a for a in task.args.items()))
|
||||
args = ' %s' % args
|
||||
self._display.banner("TASK %d/%d [%s%s]" % (self._task_counter, self._task_total, task.get_name().strip(), args))
|
||||
if self._display.verbosity >= 2:
|
||||
path = task.get_path()
|
||||
if path:
|
||||
self._display.display(f"task path: {path}", color=C.COLOR_DEBUG)
|
||||
self._display.display("task path: %s" % path, color=C.COLOR_DEBUG)
|
||||
self._host_counter = self._previous_batch_total
|
||||
self._task_counter += 1
|
||||
|
||||
|
@ -159,15 +166,15 @@ class CallbackModule(CallbackBase):
|
|||
return
|
||||
elif result._result.get('changed', False):
|
||||
if delegated_vars:
|
||||
msg = f"changed: {self._host_counter}/{self._host_total} [{result._host.get_name()} -> {delegated_vars['ansible_host']}]"
|
||||
msg = "changed: %d/%d [%s -> %s]" % (self._host_counter, self._host_total, result._host.get_name(), delegated_vars['ansible_host'])
|
||||
else:
|
||||
msg = f"changed: {self._host_counter}/{self._host_total} [{result._host.get_name()}]"
|
||||
msg = "changed: %d/%d [%s]" % (self._host_counter, self._host_total, result._host.get_name())
|
||||
color = C.COLOR_CHANGED
|
||||
else:
|
||||
if delegated_vars:
|
||||
msg = f"ok: {self._host_counter}/{self._host_total} [{result._host.get_name()} -> {delegated_vars['ansible_host']}]"
|
||||
msg = "ok: %d/%d [%s -> %s]" % (self._host_counter, self._host_total, result._host.get_name(), delegated_vars['ansible_host'])
|
||||
else:
|
||||
msg = f"ok: {self._host_counter}/{self._host_total} [{result._host.get_name()}]"
|
||||
msg = "ok: %d/%d [%s]" % (self._host_counter, self._host_total, result._host.get_name())
|
||||
color = C.COLOR_OK
|
||||
|
||||
self._handle_warnings(result._result)
|
||||
|
@ -178,7 +185,7 @@ class CallbackModule(CallbackBase):
|
|||
self._clean_results(result._result, result._task.action)
|
||||
|
||||
if self._run_is_verbose(result):
|
||||
msg += f" => {self._dump_results(result._result)}"
|
||||
msg += " => %s" % (self._dump_results(result._result),)
|
||||
self._display.display(msg, color=color)
|
||||
|
||||
def v2_runner_on_failed(self, result, ignore_errors=False):
|
||||
|
@ -199,16 +206,14 @@ class CallbackModule(CallbackBase):
|
|||
|
||||
else:
|
||||
if delegated_vars:
|
||||
self._display.display(
|
||||
f"fatal: {self._host_counter}/{self._host_total} [{result._host.get_name()} -> "
|
||||
f"{delegated_vars['ansible_host']}]: FAILED! => {self._dump_results(result._result)}",
|
||||
color=C.COLOR_ERROR
|
||||
)
|
||||
self._display.display("fatal: %d/%d [%s -> %s]: FAILED! => %s" % (self._host_counter, self._host_total,
|
||||
result._host.get_name(), delegated_vars['ansible_host'],
|
||||
self._dump_results(result._result)),
|
||||
color=C.COLOR_ERROR)
|
||||
else:
|
||||
self._display.display(
|
||||
f"fatal: {self._host_counter}/{self._host_total} [{result._host.get_name()}]: FAILED! => {self._dump_results(result._result)}",
|
||||
color=C.COLOR_ERROR
|
||||
)
|
||||
self._display.display("fatal: %d/%d [%s]: FAILED! => %s" % (self._host_counter, self._host_total,
|
||||
result._host.get_name(), self._dump_results(result._result)),
|
||||
color=C.COLOR_ERROR)
|
||||
|
||||
if ignore_errors:
|
||||
self._display.display("...ignoring", color=C.COLOR_SKIP)
|
||||
|
@ -226,9 +231,9 @@ class CallbackModule(CallbackBase):
|
|||
if result._task.loop and 'results' in result._result:
|
||||
self._process_items(result)
|
||||
else:
|
||||
msg = f"skipping: {self._host_counter}/{self._host_total} [{result._host.get_name()}]"
|
||||
msg = "skipping: %d/%d [%s]" % (self._host_counter, self._host_total, result._host.get_name())
|
||||
if self._run_is_verbose(result):
|
||||
msg += f" => {self._dump_results(result._result)}"
|
||||
msg += " => %s" % self._dump_results(result._result)
|
||||
self._display.display(msg, color=C.COLOR_SKIP)
|
||||
|
||||
def v2_runner_on_unreachable(self, result):
|
||||
|
@ -239,13 +244,11 @@ class CallbackModule(CallbackBase):
|
|||
|
||||
delegated_vars = result._result.get('_ansible_delegated_vars', None)
|
||||
if delegated_vars:
|
||||
self._display.display(
|
||||
f"fatal: {self._host_counter}/{self._host_total} [{result._host.get_name()} -> "
|
||||
f"{delegated_vars['ansible_host']}]: UNREACHABLE! => {self._dump_results(result._result)}",
|
||||
color=C.COLOR_UNREACHABLE
|
||||
)
|
||||
self._display.display("fatal: %d/%d [%s -> %s]: UNREACHABLE! => %s" % (self._host_counter, self._host_total,
|
||||
result._host.get_name(), delegated_vars['ansible_host'],
|
||||
self._dump_results(result._result)),
|
||||
color=C.COLOR_UNREACHABLE)
|
||||
else:
|
||||
self._display.display(
|
||||
f"fatal: {self._host_counter}/{self._host_total} [{result._host.get_name()}]: UNREACHABLE! => {self._dump_results(result._result)}",
|
||||
color=C.COLOR_UNREACHABLE
|
||||
)
|
||||
self._display.display("fatal: %d/%d [%s]: UNREACHABLE! => %s" % (self._host_counter, self._host_total,
|
||||
result._host.get_name(), self._dump_results(result._result)),
|
||||
color=C.COLOR_UNREACHABLE)
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
name: default_without_diff
|
||||
|
@ -28,7 +29,7 @@ ansible_config: |
|
|||
stdout_callback = community.general.default_without_diff
|
||||
|
||||
# Enable callback with environment variables:
|
||||
environment_variable: |-
|
||||
environment_variable: |
|
||||
ANSIBLE_STDOUT_CALLBACK=community.general.default_without_diff
|
||||
"""
|
||||
|
||||
|
|
|
@ -4,16 +4,17 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
name: dense
|
||||
type: stdout
|
||||
short_description: Minimal stdout output
|
||||
short_description: minimal stdout output
|
||||
extends_documentation_fragment:
|
||||
- default_callback
|
||||
description:
|
||||
- When in verbose mode it acts the same as the default callback.
|
||||
- When in verbose mode it will act the same as the default callback.
|
||||
author:
|
||||
- Dag Wieers (@dagwieers)
|
||||
requirements:
|
||||
|
@ -194,7 +195,7 @@ class CallbackModule(CallbackModule_default):
|
|||
self.disabled = True
|
||||
|
||||
def __del__(self):
|
||||
sys.stdout.write(f"{vt100.restore}{vt100.reset}\n{vt100.save}{vt100.clearline}")
|
||||
sys.stdout.write(vt100.restore + vt100.reset + '\n' + vt100.save + vt100.clearline)
|
||||
|
||||
def _add_host(self, result, status):
|
||||
name = result._host.get_name()
|
||||
|
@ -242,7 +243,7 @@ class CallbackModule(CallbackModule_default):
|
|||
|
||||
def _handle_exceptions(self, result):
|
||||
if 'exception' in result:
|
||||
# Remove the exception from the result so it is not shown every time
|
||||
# Remove the exception from the result so it's not shown every time
|
||||
del result['exception']
|
||||
|
||||
if self._display.verbosity == 1:
|
||||
|
@ -251,7 +252,7 @@ class CallbackModule(CallbackModule_default):
|
|||
def _display_progress(self, result=None):
|
||||
# Always rewrite the complete line
|
||||
sys.stdout.write(vt100.restore + vt100.reset + vt100.clearline + vt100.nolinewrap + vt100.underline)
|
||||
sys.stdout.write(f'{self.type} {self.count[self.type]}:')
|
||||
sys.stdout.write('%s %d:' % (self.type, self.count[self.type]))
|
||||
sys.stdout.write(vt100.reset)
|
||||
sys.stdout.flush()
|
||||
|
||||
|
@ -259,18 +260,22 @@ class CallbackModule(CallbackModule_default):
|
|||
for name in self.hosts:
|
||||
sys.stdout.write(' ')
|
||||
if self.hosts[name].get('delegate', None):
|
||||
sys.stdout.write(f"{self.hosts[name]['delegate']}>")
|
||||
sys.stdout.write(self.hosts[name]['delegate'] + '>')
|
||||
sys.stdout.write(colors[self.hosts[name]['state']] + name + vt100.reset)
|
||||
sys.stdout.flush()
|
||||
|
||||
# if result._result.get('diff', False):
|
||||
# sys.stdout.write('\n' + vt100.linewrap)
|
||||
sys.stdout.write(vt100.linewrap)
|
||||
|
||||
# self.keep = True
|
||||
|
||||
def _display_task_banner(self):
|
||||
if not self.shown_title:
|
||||
self.shown_title = True
|
||||
sys.stdout.write(vt100.restore + vt100.reset + vt100.clearline + vt100.underline)
|
||||
sys.stdout.write(f'{self.type} {self.count[self.type]}: {self.task.get_name().strip()}')
|
||||
sys.stdout.write(f"{vt100.restore}{vt100.reset}\n{vt100.save}{vt100.clearline}")
|
||||
sys.stdout.write('%s %d: %s' % (self.type, self.count[self.type], self.task.get_name().strip()))
|
||||
sys.stdout.write(vt100.restore + vt100.reset + '\n' + vt100.save + vt100.clearline)
|
||||
sys.stdout.flush()
|
||||
else:
|
||||
sys.stdout.write(vt100.restore + vt100.reset + vt100.clearline)
|
||||
|
@ -279,7 +284,7 @@ class CallbackModule(CallbackModule_default):
|
|||
def _display_results(self, result, status):
|
||||
# Leave the previous task on screen (as it has changes/errors)
|
||||
if self._display.verbosity == 0 and self.keep:
|
||||
sys.stdout.write(f"{vt100.restore}{vt100.reset}\n{vt100.save}{vt100.clearline}")
|
||||
sys.stdout.write(vt100.restore + vt100.reset + '\n' + vt100.save + vt100.clearline)
|
||||
else:
|
||||
sys.stdout.write(vt100.restore + vt100.reset + vt100.clearline)
|
||||
self.keep = False
|
||||
|
@ -304,16 +309,16 @@ class CallbackModule(CallbackModule_default):
|
|||
if result._task.loop and 'results' in result._result:
|
||||
self._process_items(result)
|
||||
else:
|
||||
sys.stdout.write(f"{colors[status] + status}: ")
|
||||
sys.stdout.write(colors[status] + status + ': ')
|
||||
|
||||
delegated_vars = result._result.get('_ansible_delegated_vars', None)
|
||||
if delegated_vars:
|
||||
sys.stdout.write(f"{vt100.reset}{result._host.get_name()}>{colors[status]}{delegated_vars['ansible_host']}")
|
||||
sys.stdout.write(vt100.reset + result._host.get_name() + '>' + colors[status] + delegated_vars['ansible_host'])
|
||||
else:
|
||||
sys.stdout.write(result._host.get_name())
|
||||
|
||||
sys.stdout.write(f": {dump}\n")
|
||||
sys.stdout.write(f"{vt100.reset}{vt100.save}{vt100.clearline}")
|
||||
sys.stdout.write(': ' + dump + '\n')
|
||||
sys.stdout.write(vt100.reset + vt100.save + vt100.clearline)
|
||||
sys.stdout.flush()
|
||||
|
||||
if status == 'changed':
|
||||
|
@ -322,7 +327,7 @@ class CallbackModule(CallbackModule_default):
|
|||
def v2_playbook_on_play_start(self, play):
|
||||
# Leave the previous task on screen (as it has changes/errors)
|
||||
if self._display.verbosity == 0 and self.keep:
|
||||
sys.stdout.write(f"{vt100.restore}{vt100.reset}\n{vt100.save}{vt100.clearline}{vt100.bold}")
|
||||
sys.stdout.write(vt100.restore + vt100.reset + '\n' + vt100.save + vt100.clearline + vt100.bold)
|
||||
else:
|
||||
sys.stdout.write(vt100.restore + vt100.reset + vt100.clearline + vt100.bold)
|
||||
|
||||
|
@ -336,14 +341,14 @@ class CallbackModule(CallbackModule_default):
|
|||
name = play.get_name().strip()
|
||||
if not name:
|
||||
name = 'unnamed'
|
||||
sys.stdout.write(f"PLAY {self.count['play']}: {name.upper()}")
|
||||
sys.stdout.write(f"{vt100.restore}{vt100.reset}\n{vt100.save}{vt100.clearline}")
|
||||
sys.stdout.write('PLAY %d: %s' % (self.count['play'], name.upper()))
|
||||
sys.stdout.write(vt100.restore + vt100.reset + '\n' + vt100.save + vt100.clearline)
|
||||
sys.stdout.flush()
|
||||
|
||||
def v2_playbook_on_task_start(self, task, is_conditional):
|
||||
# Leave the previous task on screen (as it has changes/errors)
|
||||
if self._display.verbosity == 0 and self.keep:
|
||||
sys.stdout.write(f"{vt100.restore}{vt100.reset}\n{vt100.save}{vt100.clearline}{vt100.underline}")
|
||||
sys.stdout.write(vt100.restore + vt100.reset + '\n' + vt100.save + vt100.clearline + vt100.underline)
|
||||
else:
|
||||
# Do not clear line, since we want to retain the previous output
|
||||
sys.stdout.write(vt100.restore + vt100.reset + vt100.underline)
|
||||
|
@ -360,14 +365,14 @@ class CallbackModule(CallbackModule_default):
|
|||
self.count['task'] += 1
|
||||
|
||||
# Write the next task on screen (behind the prompt is the previous output)
|
||||
sys.stdout.write(f'{self.type} {self.count[self.type]}.')
|
||||
sys.stdout.write('%s %d.' % (self.type, self.count[self.type]))
|
||||
sys.stdout.write(vt100.reset)
|
||||
sys.stdout.flush()
|
||||
|
||||
def v2_playbook_on_handler_task_start(self, task):
|
||||
# Leave the previous task on screen (as it has changes/errors)
|
||||
if self._display.verbosity == 0 and self.keep:
|
||||
sys.stdout.write(f"{vt100.restore}{vt100.reset}\n{vt100.save}{vt100.clearline}{vt100.underline}")
|
||||
sys.stdout.write(vt100.restore + vt100.reset + '\n' + vt100.save + vt100.clearline + vt100.underline)
|
||||
else:
|
||||
sys.stdout.write(vt100.restore + vt100.reset + vt100.clearline + vt100.underline)
|
||||
|
||||
|
@ -383,7 +388,7 @@ class CallbackModule(CallbackModule_default):
|
|||
self.count[self.type] += 1
|
||||
|
||||
# Write the next task on screen (behind the prompt is the previous output)
|
||||
sys.stdout.write(f'{self.type} {self.count[self.type]}.')
|
||||
sys.stdout.write('%s %d.' % (self.type, self.count[self.type]))
|
||||
sys.stdout.write(vt100.reset)
|
||||
sys.stdout.flush()
|
||||
|
||||
|
@ -446,13 +451,13 @@ class CallbackModule(CallbackModule_default):
|
|||
|
||||
def v2_playbook_on_no_hosts_remaining(self):
|
||||
if self._display.verbosity == 0 and self.keep:
|
||||
sys.stdout.write(f"{vt100.restore}{vt100.reset}\n{vt100.save}{vt100.clearline}")
|
||||
sys.stdout.write(vt100.restore + vt100.reset + '\n' + vt100.save + vt100.clearline)
|
||||
else:
|
||||
sys.stdout.write(vt100.restore + vt100.reset + vt100.clearline)
|
||||
self.keep = False
|
||||
|
||||
sys.stdout.write(f"{vt100.white + vt100.redbg}NO MORE HOSTS LEFT")
|
||||
sys.stdout.write(f"{vt100.restore}{vt100.reset}\n{vt100.save}{vt100.clearline}")
|
||||
sys.stdout.write(vt100.white + vt100.redbg + 'NO MORE HOSTS LEFT')
|
||||
sys.stdout.write(vt100.restore + vt100.reset + '\n' + vt100.save + vt100.clearline)
|
||||
sys.stdout.flush()
|
||||
|
||||
def v2_playbook_on_include(self, included_file):
|
||||
|
@ -460,7 +465,7 @@ class CallbackModule(CallbackModule_default):
|
|||
|
||||
def v2_playbook_on_stats(self, stats):
|
||||
if self._display.verbosity == 0 and self.keep:
|
||||
sys.stdout.write(f"{vt100.restore}{vt100.reset}\n{vt100.save}{vt100.clearline}")
|
||||
sys.stdout.write(vt100.restore + vt100.reset + '\n' + vt100.save + vt100.clearline)
|
||||
else:
|
||||
sys.stdout.write(vt100.restore + vt100.reset + vt100.clearline)
|
||||
|
||||
|
@ -471,16 +476,22 @@ class CallbackModule(CallbackModule_default):
|
|||
sys.stdout.write(vt100.bold + vt100.underline)
|
||||
sys.stdout.write('SUMMARY')
|
||||
|
||||
sys.stdout.write(f"{vt100.restore}{vt100.reset}\n{vt100.save}{vt100.clearline}")
|
||||
sys.stdout.write(vt100.restore + vt100.reset + '\n' + vt100.save + vt100.clearline)
|
||||
sys.stdout.flush()
|
||||
|
||||
hosts = sorted(stats.processed.keys())
|
||||
for h in hosts:
|
||||
t = stats.summarize(h)
|
||||
self._display.display(
|
||||
f"{hostcolor(h, t)} : {colorize('ok', t['ok'], C.COLOR_OK)} {colorize('changed', t['changed'], C.COLOR_CHANGED)} "
|
||||
f"{colorize('unreachable', t['unreachable'], C.COLOR_UNREACHABLE)} {colorize('failed', t['failures'], C.COLOR_ERROR)} "
|
||||
f"{colorize('rescued', t['rescued'], C.COLOR_OK)} {colorize('ignored', t['ignored'], C.COLOR_WARN)}",
|
||||
u"%s : %s %s %s %s %s %s" % (
|
||||
hostcolor(h, t),
|
||||
colorize(u'ok', t['ok'], C.COLOR_OK),
|
||||
colorize(u'changed', t['changed'], C.COLOR_CHANGED),
|
||||
colorize(u'unreachable', t['unreachable'], C.COLOR_UNREACHABLE),
|
||||
colorize(u'failed', t['failures'], C.COLOR_ERROR),
|
||||
colorize(u'rescued', t['rescued'], C.COLOR_OK),
|
||||
colorize(u'ignored', t['ignored'], C.COLOR_WARN),
|
||||
),
|
||||
screen_only=True
|
||||
)
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
name: diy
|
||||
|
@ -23,15 +24,15 @@ notes:
|
|||
that is available using the other various execution contexts, such as playbook, play, task, and so on so forth.
|
||||
- Options being set by their respective variable input can only be set using the variable if the variable was set in a context
|
||||
that is available to the respective callback. Use the C(ansible_callback_diy) dictionary to see what is available to a
|
||||
callback. Additionally, C(ansible_callback_diy.top_level_var_names) outputs the top level variable names available
|
||||
callback. Additionally, C(ansible_callback_diy.top_level_var_names) will output the top level variable names available
|
||||
to the callback.
|
||||
- Each option value is rendered as a template before being evaluated. This allows for the dynamic usage of an option. For
|
||||
example, V("{{ 'yellow' if ansible_callback_diy.result.is_changed else 'bright green' }}").
|
||||
- 'B(Condition) for all C(msg) options: if value V(is None or omit), then the option is not being used. B(Effect): use of
|
||||
the C(default) callback plugin for output.'
|
||||
- 'B(Condition) for all C(msg) options: if value V(is not None and not omit and length is not greater than 0), then the
|
||||
example, C("{{ 'yellow' if ansible_callback_diy.result.is_changed else 'bright green' }}").
|
||||
- 'B(Condition) for all C(msg) options: if value C(is None or omit), then the option is not being used. B(Effect): use
|
||||
of the C(default) callback plugin for output.'
|
||||
- 'B(Condition) for all C(msg) options: if value C(is not None and not omit and length is not greater than 0), then the
|
||||
option is being used without output. B(Effect): suppress output.'
|
||||
- 'B(Condition) for all C(msg) options: if value V(is not None and not omit and length is greater than 0), then the option
|
||||
- 'B(Condition) for all C(msg) options: if value C(is not None and not omit and length is greater than 0), then the option
|
||||
is being used with output. B(Effect): render value as template and output.'
|
||||
- 'Valid color values: V(black), V(bright gray), V(blue), V(white), V(green), V(bright blue), V(cyan), V(bright green),
|
||||
V(red), V(bright cyan), V(purple), V(bright red), V(yellow), V(bright purple), V(dark gray), V(bright yellow), V(magenta),
|
||||
|
@ -828,9 +829,9 @@ class CallbackModule(Default):
|
|||
_callback_options = ['msg', 'msg_color']
|
||||
|
||||
for option in _callback_options:
|
||||
_option_name = f'{_callback_type}_{option}'
|
||||
_option_name = '%s_%s' % (_callback_type, option)
|
||||
_option_template = variables.get(
|
||||
f"{self.DIY_NS}_{_option_name}",
|
||||
self.DIY_NS + "_" + _option_name,
|
||||
self.get_option(_option_name)
|
||||
)
|
||||
_ret.update({option: self._template(
|
||||
|
@ -870,7 +871,7 @@ class CallbackModule(Default):
|
|||
handler=None, result=None, stats=None, remove_attr_ref_loop=True):
|
||||
def _get_value(obj, attr=None, method=None):
|
||||
if attr:
|
||||
return getattr(obj, attr, getattr(obj, f"_{attr}", None))
|
||||
return getattr(obj, attr, getattr(obj, "_" + attr, None))
|
||||
|
||||
if method:
|
||||
_method = getattr(obj, method)
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Victor Martinez (@v1v) <VictorMartinezRubio@gmail.com>
|
||||
|
@ -87,7 +88,6 @@ from contextlib import closing
|
|||
from os.path import basename
|
||||
|
||||
from ansible.errors import AnsibleError, AnsibleRuntimeError
|
||||
from ansible.module_utils.ansible_release import __version__ as ansible_version
|
||||
from ansible.module_utils.six import raise_from
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
|
||||
|
@ -118,7 +118,7 @@ class TaskData:
|
|||
if host.uuid in self.host_data:
|
||||
if host.status == 'included':
|
||||
# concatenate task include output from multiple items
|
||||
host.result = f'{self.host_data[host.uuid].result}\n{host.result}'
|
||||
host.result = '%s\n%s' % (self.host_data[host.uuid].result, host.result)
|
||||
else:
|
||||
return
|
||||
|
||||
|
@ -141,6 +141,7 @@ class HostData:
|
|||
class ElasticSource(object):
|
||||
def __init__(self, display):
|
||||
self.ansible_playbook = ""
|
||||
self.ansible_version = None
|
||||
self.session = str(uuid.uuid4())
|
||||
self.host = socket.gethostname()
|
||||
try:
|
||||
|
@ -165,7 +166,7 @@ class ElasticSource(object):
|
|||
args = None
|
||||
|
||||
if not task.no_log and not hide_task_arguments:
|
||||
args = ', '.join((f'{k}={v}' for k, v in task.args.items()))
|
||||
args = ', '.join(('%s=%s' % a for a in task.args.items()))
|
||||
|
||||
tasks_data[uuid] = TaskData(uuid, name, path, play_name, action, args)
|
||||
|
||||
|
@ -183,6 +184,9 @@ class ElasticSource(object):
|
|||
|
||||
task = tasks_data[task_uuid]
|
||||
|
||||
if self.ansible_version is None and result._task_fields['args'].get('_ansible_version'):
|
||||
self.ansible_version = result._task_fields['args'].get('_ansible_version')
|
||||
|
||||
task.add_host(HostData(host_uuid, host_name, status, result))
|
||||
|
||||
def generate_distributed_traces(self, tasks_data, status, end_time, traceparent, apm_service_name,
|
||||
|
@ -206,7 +210,8 @@ class ElasticSource(object):
|
|||
else:
|
||||
apm_cli.begin_transaction("Session", start=parent_start_time)
|
||||
# Populate trace metadata attributes
|
||||
label(ansible_version=ansible_version)
|
||||
if self.ansible_version is not None:
|
||||
label(ansible_version=self.ansible_version)
|
||||
label(ansible_session=self.session, ansible_host_name=self.host, ansible_host_user=self.user)
|
||||
if self.ip_address is not None:
|
||||
label(ansible_host_ip=self.ip_address)
|
||||
|
@ -220,7 +225,7 @@ class ElasticSource(object):
|
|||
def create_span_data(self, apm_cli, task_data, host_data):
|
||||
""" create the span with the given TaskData and HostData """
|
||||
|
||||
name = f'[{host_data.name}] {task_data.play}: {task_data.name}'
|
||||
name = '[%s] %s: %s' % (host_data.name, task_data.play, task_data.name)
|
||||
|
||||
message = "success"
|
||||
status = "success"
|
||||
|
@ -254,7 +259,7 @@ class ElasticSource(object):
|
|||
"ansible.task.host.status": host_data.status}) as span:
|
||||
span.outcome = status
|
||||
if 'failure' in status:
|
||||
exception = AnsibleRuntimeError(message=f"{task_data.action}: {name} failed with error message {enriched_error_message}")
|
||||
exception = AnsibleRuntimeError(message="{0}: {1} failed with error message {2}".format(task_data.action, name, enriched_error_message))
|
||||
apm_cli.capture_exception(exc_info=(type(exception), exception, exception.__traceback__), handled=True)
|
||||
|
||||
def init_apm_client(self, apm_server_url, apm_service_name, apm_verify_server_cert, apm_secret_token, apm_api_key):
|
||||
|
@ -283,7 +288,7 @@ class ElasticSource(object):
|
|||
message = result.get('msg', 'failed')
|
||||
exception = result.get('exception')
|
||||
stderr = result.get('stderr')
|
||||
return f"message: \"{message}\"\nexception: \"{exception}\"\nstderr: \"{stderr}\""
|
||||
return ('message: "{0}"\nexception: "{1}"\nstderr: "{2}"').format(message, exception, stderr)
|
||||
|
||||
|
||||
class CallbackModule(CallbackBase):
|
||||
|
|
240
plugins/callback/hipchat.py
Normal file
240
plugins/callback/hipchat.py
Normal file
|
@ -0,0 +1,240 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2014, Matt Martz <matt@sivel.net>
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = '''
|
||||
author: Unknown (!UNKNOWN)
|
||||
name: hipchat
|
||||
type: notification
|
||||
requirements:
|
||||
- whitelist in configuration.
|
||||
- prettytable (python lib)
|
||||
short_description: post task events to hipchat
|
||||
description:
|
||||
- This callback plugin sends status updates to a HipChat channel during playbook execution.
|
||||
- Before 2.4 only environment variables were available for configuring this plugin.
|
||||
deprecated:
|
||||
removed_in: 10.0.0
|
||||
why: The hipchat service has been discontinued and the self-hosted variant has been End of Life since 2020.
|
||||
alternative: There is none.
|
||||
options:
|
||||
token:
|
||||
description: HipChat API token for v1 or v2 API.
|
||||
type: str
|
||||
required: true
|
||||
env:
|
||||
- name: HIPCHAT_TOKEN
|
||||
ini:
|
||||
- section: callback_hipchat
|
||||
key: token
|
||||
api_version:
|
||||
description: HipChat API version, v1 or v2.
|
||||
type: str
|
||||
choices:
|
||||
- v1
|
||||
- v2
|
||||
required: false
|
||||
default: v1
|
||||
env:
|
||||
- name: HIPCHAT_API_VERSION
|
||||
ini:
|
||||
- section: callback_hipchat
|
||||
key: api_version
|
||||
room:
|
||||
description: HipChat room to post in.
|
||||
type: str
|
||||
default: ansible
|
||||
env:
|
||||
- name: HIPCHAT_ROOM
|
||||
ini:
|
||||
- section: callback_hipchat
|
||||
key: room
|
||||
from:
|
||||
description: Name to post as
|
||||
type: str
|
||||
default: ansible
|
||||
env:
|
||||
- name: HIPCHAT_FROM
|
||||
ini:
|
||||
- section: callback_hipchat
|
||||
key: from
|
||||
notify:
|
||||
description: Add notify flag to important messages
|
||||
type: bool
|
||||
default: true
|
||||
env:
|
||||
- name: HIPCHAT_NOTIFY
|
||||
ini:
|
||||
- section: callback_hipchat
|
||||
key: notify
|
||||
|
||||
'''
|
||||
|
||||
import os
|
||||
import json
|
||||
|
||||
try:
|
||||
import prettytable
|
||||
HAS_PRETTYTABLE = True
|
||||
except ImportError:
|
||||
HAS_PRETTYTABLE = False
|
||||
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
from ansible.module_utils.six.moves.urllib.parse import urlencode
|
||||
from ansible.module_utils.urls import open_url
|
||||
|
||||
|
||||
class CallbackModule(CallbackBase):
|
||||
"""This is an example ansible callback plugin that sends status
|
||||
updates to a HipChat channel during playbook execution.
|
||||
"""
|
||||
|
||||
CALLBACK_VERSION = 2.0
|
||||
CALLBACK_TYPE = 'notification'
|
||||
CALLBACK_NAME = 'community.general.hipchat'
|
||||
CALLBACK_NEEDS_WHITELIST = True
|
||||
|
||||
API_V1_URL = 'https://api.hipchat.com/v1/rooms/message'
|
||||
API_V2_URL = 'https://api.hipchat.com/v2/'
|
||||
|
||||
def __init__(self):
|
||||
|
||||
super(CallbackModule, self).__init__()
|
||||
|
||||
if not HAS_PRETTYTABLE:
|
||||
self.disabled = True
|
||||
self._display.warning('The `prettytable` python module is not installed. '
|
||||
'Disabling the HipChat callback plugin.')
|
||||
self.printed_playbook = False
|
||||
self.playbook_name = None
|
||||
self.play = None
|
||||
|
||||
def set_options(self, task_keys=None, var_options=None, direct=None):
|
||||
super(CallbackModule, self).set_options(task_keys=task_keys, var_options=var_options, direct=direct)
|
||||
|
||||
self.token = self.get_option('token')
|
||||
self.api_version = self.get_option('api_version')
|
||||
self.from_name = self.get_option('from')
|
||||
self.allow_notify = self.get_option('notify')
|
||||
self.room = self.get_option('room')
|
||||
|
||||
if self.token is None:
|
||||
self.disabled = True
|
||||
self._display.warning('HipChat token could not be loaded. The HipChat '
|
||||
'token can be provided using the `HIPCHAT_TOKEN` '
|
||||
'environment variable.')
|
||||
|
||||
# Pick the request handler.
|
||||
if self.api_version == 'v2':
|
||||
self.send_msg = self.send_msg_v2
|
||||
else:
|
||||
self.send_msg = self.send_msg_v1
|
||||
|
||||
def send_msg_v2(self, msg, msg_format='text', color='yellow', notify=False):
|
||||
"""Method for sending a message to HipChat"""
|
||||
|
||||
headers = {'Authorization': 'Bearer %s' % self.token, 'Content-Type': 'application/json'}
|
||||
|
||||
body = {}
|
||||
body['room_id'] = self.room
|
||||
body['from'] = self.from_name[:15] # max length is 15
|
||||
body['message'] = msg
|
||||
body['message_format'] = msg_format
|
||||
body['color'] = color
|
||||
body['notify'] = self.allow_notify and notify
|
||||
|
||||
data = json.dumps(body)
|
||||
url = self.API_V2_URL + "room/{room_id}/notification".format(room_id=self.room)
|
||||
try:
|
||||
response = open_url(url, data=data, headers=headers, method='POST')
|
||||
return response.read()
|
||||
except Exception as ex:
|
||||
self._display.warning('Could not submit message to hipchat: {0}'.format(ex))
|
||||
|
||||
def send_msg_v1(self, msg, msg_format='text', color='yellow', notify=False):
|
||||
"""Method for sending a message to HipChat"""
|
||||
|
||||
params = {}
|
||||
params['room_id'] = self.room
|
||||
params['from'] = self.from_name[:15] # max length is 15
|
||||
params['message'] = msg
|
||||
params['message_format'] = msg_format
|
||||
params['color'] = color
|
||||
params['notify'] = int(self.allow_notify and notify)
|
||||
|
||||
url = ('%s?auth_token=%s' % (self.API_V1_URL, self.token))
|
||||
try:
|
||||
response = open_url(url, data=urlencode(params))
|
||||
return response.read()
|
||||
except Exception as ex:
|
||||
self._display.warning('Could not submit message to hipchat: {0}'.format(ex))
|
||||
|
||||
def v2_playbook_on_play_start(self, play):
|
||||
"""Display Playbook and play start messages"""
|
||||
|
||||
self.play = play
|
||||
name = play.name
|
||||
# This block sends information about a playbook when it starts
|
||||
# The playbook object is not immediately available at
|
||||
# playbook_on_start so we grab it via the play
|
||||
#
|
||||
# Displays info about playbook being started by a person on an
|
||||
# inventory, as well as Tags, Skip Tags and Limits
|
||||
if not self.printed_playbook:
|
||||
self.playbook_name, dummy = os.path.splitext(os.path.basename(self.play.playbook.filename))
|
||||
host_list = self.play.playbook.inventory.host_list
|
||||
inventory = os.path.basename(os.path.realpath(host_list))
|
||||
self.send_msg("%s: Playbook initiated by %s against %s" %
|
||||
(self.playbook_name,
|
||||
self.play.playbook.remote_user,
|
||||
inventory), notify=True)
|
||||
self.printed_playbook = True
|
||||
subset = self.play.playbook.inventory._subset
|
||||
skip_tags = self.play.playbook.skip_tags
|
||||
self.send_msg("%s:\nTags: %s\nSkip Tags: %s\nLimit: %s" %
|
||||
(self.playbook_name,
|
||||
', '.join(self.play.playbook.only_tags),
|
||||
', '.join(skip_tags) if skip_tags else None,
|
||||
', '.join(subset) if subset else subset))
|
||||
|
||||
# This is where we actually say we are starting a play
|
||||
self.send_msg("%s: Starting play: %s" %
|
||||
(self.playbook_name, name))
|
||||
|
||||
def playbook_on_stats(self, stats):
|
||||
"""Display info about playbook statistics"""
|
||||
hosts = sorted(stats.processed.keys())
|
||||
|
||||
t = prettytable.PrettyTable(['Host', 'Ok', 'Changed', 'Unreachable',
|
||||
'Failures'])
|
||||
|
||||
failures = False
|
||||
unreachable = False
|
||||
|
||||
for h in hosts:
|
||||
s = stats.summarize(h)
|
||||
|
||||
if s['failures'] > 0:
|
||||
failures = True
|
||||
if s['unreachable'] > 0:
|
||||
unreachable = True
|
||||
|
||||
t.add_row([h] + [s[k] for k in ['ok', 'changed', 'unreachable',
|
||||
'failures']])
|
||||
|
||||
self.send_msg("%s: Playbook complete" % self.playbook_name,
|
||||
notify=True)
|
||||
|
||||
if failures or unreachable:
|
||||
color = 'red'
|
||||
self.send_msg("%s: Failures detected" % self.playbook_name,
|
||||
color=color, notify=True)
|
||||
else:
|
||||
color = 'green'
|
||||
|
||||
self.send_msg("/code %s:\n%s" % (self.playbook_name, t), color=color)
|
|
@ -4,13 +4,14 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Unknown (!UNKNOWN)
|
||||
name: jabber
|
||||
type: notification
|
||||
short_description: Post task events to a Jabber server
|
||||
short_description: post task events to a Jabber server
|
||||
description:
|
||||
- The chatty part of ChatOps with a Hipchat server as a target.
|
||||
- This callback plugin sends status updates to a HipChat channel during playbook execution.
|
||||
|
@ -36,7 +37,7 @@ options:
|
|||
env:
|
||||
- name: JABBER_PASS
|
||||
to:
|
||||
description: Chat identifier that receives the message.
|
||||
description: Chat identifier that will receive the message.
|
||||
type: str
|
||||
required: true
|
||||
env:
|
||||
|
@ -101,7 +102,7 @@ class CallbackModule(CallbackBase):
|
|||
"""Display Playbook and play start messages"""
|
||||
self.play = play
|
||||
name = play.name
|
||||
self.send_msg(f"Ansible starting play: {name}")
|
||||
self.send_msg("Ansible starting play: %s" % (name))
|
||||
|
||||
def playbook_on_stats(self, stats):
|
||||
name = self.play
|
||||
|
@ -117,7 +118,7 @@ class CallbackModule(CallbackBase):
|
|||
|
||||
if failures or unreachable:
|
||||
out = self.debug
|
||||
self.send_msg(f"{name}: Failures detected \n{self.task} \nHost: {h}\n Failed at:\n{out}")
|
||||
self.send_msg("%s: Failures detected \n%s \nHost: %s\n Failed at:\n%s" % (name, self.task, h, out))
|
||||
else:
|
||||
out = self.debug
|
||||
self.send_msg(f"Great! \n Playbook {name} completed:\n{s} \n Last task debug:\n {out}")
|
||||
self.send_msg("Great! \n Playbook %s completed:\n%s \n Last task debug:\n %s" % (name, s, out))
|
||||
|
|
|
@ -4,13 +4,14 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Unknown (!UNKNOWN)
|
||||
name: log_plays
|
||||
type: notification
|
||||
short_description: Write playbook output to log file
|
||||
short_description: write playbook output to log file
|
||||
description:
|
||||
- This callback writes playbook output to a file per host in the C(/var/log/ansible/hosts) directory.
|
||||
requirements:
|
||||
|
@ -19,7 +20,7 @@ requirements:
|
|||
options:
|
||||
log_folder:
|
||||
default: /var/log/ansible/hosts
|
||||
description: The folder where log files are created.
|
||||
description: The folder where log files will be created.
|
||||
type: str
|
||||
env:
|
||||
- name: ANSIBLE_LOG_FOLDER
|
||||
|
@ -56,10 +57,7 @@ class CallbackModule(CallbackBase):
|
|||
CALLBACK_NEEDS_WHITELIST = True
|
||||
|
||||
TIME_FORMAT = "%b %d %Y %H:%M:%S"
|
||||
|
||||
@staticmethod
|
||||
def _make_msg(now, playbook, task_name, task_action, category, data):
|
||||
return f"{now} - {playbook} - {task_name} - {task_action} - {category} - {data}\n\n"
|
||||
MSG_FORMAT = "%(now)s - %(playbook)s - %(task_name)s - %(task_action)s - %(category)s - %(data)s\n\n"
|
||||
|
||||
def __init__(self):
|
||||
|
||||
|
@ -84,12 +82,22 @@ class CallbackModule(CallbackBase):
|
|||
invocation = data.pop('invocation', None)
|
||||
data = json.dumps(data, cls=AnsibleJSONEncoder)
|
||||
if invocation is not None:
|
||||
data = f"{json.dumps(invocation)} => {data} "
|
||||
data = json.dumps(invocation) + " => %s " % data
|
||||
|
||||
path = os.path.join(self.log_folder, result._host.get_name())
|
||||
now = time.strftime(self.TIME_FORMAT, time.localtime())
|
||||
|
||||
msg = to_bytes(self._make_msg(now, self.playbook, result._task.name, result._task.action, category, data))
|
||||
msg = to_bytes(
|
||||
self.MSG_FORMAT
|
||||
% dict(
|
||||
now=now,
|
||||
playbook=self.playbook,
|
||||
task_name=result._task.name,
|
||||
task_action=result._task.action,
|
||||
category=category,
|
||||
data=data,
|
||||
)
|
||||
)
|
||||
with open(path, "ab") as fd:
|
||||
fd.write(msg)
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
name: loganalytics
|
||||
|
@ -11,7 +12,7 @@ type: notification
|
|||
short_description: Posts task results to Azure Log Analytics
|
||||
author: "Cyrus Li (@zhcli) <cyrus1006@gmail.com>"
|
||||
description:
|
||||
- This callback plugin posts task results in JSON formatted to an Azure Log Analytics workspace.
|
||||
- This callback plugin will post task results in JSON formatted to an Azure Log Analytics workspace.
|
||||
- Credits to authors of splunk callback plugin.
|
||||
version_added: "2.4.0"
|
||||
requirements:
|
||||
|
@ -62,7 +63,6 @@ import getpass
|
|||
|
||||
from os.path import basename
|
||||
|
||||
from ansible.module_utils.ansible_release import __version__ as ansible_version
|
||||
from ansible.module_utils.urls import open_url
|
||||
from ansible.parsing.ajson import AnsibleJSONEncoder
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
|
@ -76,6 +76,7 @@ class AzureLogAnalyticsSource(object):
|
|||
def __init__(self):
|
||||
self.ansible_check_mode = False
|
||||
self.ansible_playbook = ""
|
||||
self.ansible_version = ""
|
||||
self.session = str(uuid.uuid4())
|
||||
self.host = socket.gethostname()
|
||||
self.user = getpass.getuser()
|
||||
|
@ -83,17 +84,18 @@ class AzureLogAnalyticsSource(object):
|
|||
|
||||
def __build_signature(self, date, workspace_id, shared_key, content_length):
|
||||
# Build authorisation signature for Azure log analytics API call
|
||||
sigs = f"POST\n{content_length}\napplication/json\nx-ms-date:{date}\n/api/logs"
|
||||
sigs = "POST\n{0}\napplication/json\nx-ms-date:{1}\n/api/logs".format(
|
||||
str(content_length), date)
|
||||
utf8_sigs = sigs.encode('utf-8')
|
||||
decoded_shared_key = base64.b64decode(shared_key)
|
||||
hmac_sha256_sigs = hmac.new(
|
||||
decoded_shared_key, utf8_sigs, digestmod=hashlib.sha256).digest()
|
||||
encoded_hash = base64.b64encode(hmac_sha256_sigs).decode('utf-8')
|
||||
signature = f"SharedKey {workspace_id}:{encoded_hash}"
|
||||
signature = "SharedKey {0}:{1}".format(workspace_id, encoded_hash)
|
||||
return signature
|
||||
|
||||
def __build_workspace_url(self, workspace_id):
|
||||
return f"https://{workspace_id}.ods.opinsights.azure.com/api/logs?api-version=2016-04-01"
|
||||
return "https://{0}.ods.opinsights.azure.com/api/logs?api-version=2016-04-01".format(workspace_id)
|
||||
|
||||
def __rfc1123date(self):
|
||||
return now().strftime('%a, %d %b %Y %H:%M:%S GMT')
|
||||
|
@ -102,6 +104,10 @@ class AzureLogAnalyticsSource(object):
|
|||
if result._task_fields['args'].get('_ansible_check_mode') is True:
|
||||
self.ansible_check_mode = True
|
||||
|
||||
if result._task_fields['args'].get('_ansible_version'):
|
||||
self.ansible_version = \
|
||||
result._task_fields['args'].get('_ansible_version')
|
||||
|
||||
if result._task._role:
|
||||
ansible_role = str(result._task._role)
|
||||
else:
|
||||
|
@ -115,7 +121,7 @@ class AzureLogAnalyticsSource(object):
|
|||
data['host'] = self.host
|
||||
data['user'] = self.user
|
||||
data['runtime'] = runtime
|
||||
data['ansible_version'] = ansible_version
|
||||
data['ansible_version'] = self.ansible_version
|
||||
data['ansible_check_mode'] = self.ansible_check_mode
|
||||
data['ansible_host'] = result._host.name
|
||||
data['ansible_playbook'] = self.ansible_playbook
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Unknown (!UNKNOWN)
|
||||
|
@ -11,7 +12,7 @@ name: logdna
|
|||
type: notification
|
||||
short_description: Sends playbook logs to LogDNA
|
||||
description:
|
||||
- This callback reports logs from playbook actions, tasks, and events to LogDNA (U(https://app.logdna.com)).
|
||||
- This callback will report logs from playbook actions, tasks, and events to LogDNA (U(https://app.logdna.com)).
|
||||
requirements:
|
||||
- LogDNA Python Library (U(https://github.com/logdna/python))
|
||||
- whitelisting in configuration
|
||||
|
@ -72,7 +73,7 @@ except ImportError:
|
|||
|
||||
# Getting MAC Address of system:
|
||||
def get_mac():
|
||||
mac = f"{getnode():012x}"
|
||||
mac = "%012x" % getnode()
|
||||
return ":".join(map(lambda index: mac[index:index + 2], range(int(len(mac) / 2))))
|
||||
|
||||
|
||||
|
@ -160,7 +161,7 @@ class CallbackModule(CallbackBase):
|
|||
if ninvalidKeys > 0:
|
||||
for key in invalidKeys:
|
||||
del meta[key]
|
||||
meta['__errors'] = f"These keys have been sanitized: {', '.join(invalidKeys)}"
|
||||
meta['__errors'] = 'These keys have been sanitized: ' + ', '.join(invalidKeys)
|
||||
return meta
|
||||
|
||||
def sanitizeJSON(self, data):
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Unknown (!UNKNOWN)
|
||||
|
@ -11,7 +12,7 @@ name: logentries
|
|||
type: notification
|
||||
short_description: Sends events to Logentries
|
||||
description:
|
||||
- This callback plugin generates JSON objects and send them to Logentries using TCP for auditing/debugging purposes.
|
||||
- This callback plugin will generate JSON objects and send them to Logentries using TCP for auditing/debugging purposes.
|
||||
requirements:
|
||||
- whitelisting in configuration
|
||||
- certifi (Python library)
|
||||
|
@ -132,7 +133,7 @@ class PlainTextSocketAppender(object):
|
|||
# Error message displayed when an incorrect Token has been detected
|
||||
self.INVALID_TOKEN = "\n\nIt appears the LOGENTRIES_TOKEN parameter you entered is incorrect!\n\n"
|
||||
# Unicode Line separator character \u2028
|
||||
self.LINE_SEP = '\u2028'
|
||||
self.LINE_SEP = u'\u2028'
|
||||
|
||||
self._display = display
|
||||
self._conn = None
|
||||
|
@ -150,7 +151,7 @@ class PlainTextSocketAppender(object):
|
|||
self.open_connection()
|
||||
return
|
||||
except Exception as e:
|
||||
self._display.vvvv(f"Unable to connect to Logentries: {e}")
|
||||
self._display.vvvv(u"Unable to connect to Logentries: %s" % to_text(e))
|
||||
|
||||
root_delay *= 2
|
||||
if root_delay > self.MAX_DELAY:
|
||||
|
@ -159,7 +160,7 @@ class PlainTextSocketAppender(object):
|
|||
wait_for = root_delay + random.uniform(0, root_delay)
|
||||
|
||||
try:
|
||||
self._display.vvvv(f"sleeping {wait_for} before retry")
|
||||
self._display.vvvv("sleeping %s before retry" % wait_for)
|
||||
time.sleep(wait_for)
|
||||
except KeyboardInterrupt:
|
||||
raise
|
||||
|
@ -172,8 +173,8 @@ class PlainTextSocketAppender(object):
|
|||
# Replace newlines with Unicode line separator
|
||||
# for multi-line events
|
||||
data = to_text(data, errors='surrogate_or_strict')
|
||||
multiline = data.replace('\n', self.LINE_SEP)
|
||||
multiline += "\n"
|
||||
multiline = data.replace(u'\n', self.LINE_SEP)
|
||||
multiline += u"\n"
|
||||
# Send data, reconnect if needed
|
||||
while True:
|
||||
try:
|
||||
|
@ -246,7 +247,7 @@ class CallbackModule(CallbackBase):
|
|||
self.use_tls = self.get_option('use_tls')
|
||||
self.flatten = self.get_option('flatten')
|
||||
except KeyError as e:
|
||||
self._display.warning(f"Missing option for Logentries callback plugin: {e}")
|
||||
self._display.warning(u"Missing option for Logentries callback plugin: %s" % to_text(e))
|
||||
self.disabled = True
|
||||
|
||||
try:
|
||||
|
@ -265,10 +266,10 @@ class CallbackModule(CallbackBase):
|
|||
|
||||
if not self.disabled:
|
||||
if self.use_tls:
|
||||
self._display.vvvv(f"Connecting to {self.api_url}:{self.api_tls_port} with TLS")
|
||||
self._display.vvvv("Connecting to %s:%s with TLS" % (self.api_url, self.api_tls_port))
|
||||
self._appender = TLSSocketAppender(display=self._display, LE_API=self.api_url, LE_TLS_PORT=self.api_tls_port)
|
||||
else:
|
||||
self._display.vvvv(f"Connecting to {self.api_url}:{self.api_port}")
|
||||
self._display.vvvv("Connecting to %s:%s" % (self.api_url, self.api_port))
|
||||
self._appender = PlainTextSocketAppender(display=self._display, LE_API=self.api_url, LE_PORT=self.api_port)
|
||||
self._appender.reopen_connection()
|
||||
|
||||
|
@ -281,7 +282,7 @@ class CallbackModule(CallbackBase):
|
|||
|
||||
def emit(self, record):
|
||||
msg = record.rstrip('\n')
|
||||
msg = f"{self.token} {msg}"
|
||||
msg = "{0} {1}".format(self.token, msg)
|
||||
self._appender.put(msg)
|
||||
self._display.vvvv("Sent event to logentries")
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Yevhen Khmelenko (@ujenmr)
|
||||
|
@ -12,7 +13,7 @@ name: logstash
|
|||
type: notification
|
||||
short_description: Sends events to Logstash
|
||||
description:
|
||||
- This callback reports facts and task events to Logstash U(https://www.elastic.co/products/logstash).
|
||||
- This callback will report facts and task events to Logstash U(https://www.elastic.co/products/logstash).
|
||||
requirements:
|
||||
- whitelisting in configuration
|
||||
- logstash (Python library)
|
||||
|
@ -127,7 +128,9 @@ class CallbackModule(CallbackBase):
|
|||
|
||||
if not HAS_LOGSTASH:
|
||||
self.disabled = True
|
||||
self._display.warning("The required python3-logstash is not installed.")
|
||||
self._display.warning("The required python-logstash/python3-logstash is not installed. "
|
||||
"pip install python-logstash for Python 2"
|
||||
"pip install python3-logstash for Python 3")
|
||||
|
||||
self.start_time = now()
|
||||
|
||||
|
@ -180,7 +183,7 @@ class CallbackModule(CallbackBase):
|
|||
data['status'] = "OK"
|
||||
data['ansible_playbook'] = playbook._file_name
|
||||
|
||||
if self.ls_format_version == "v2":
|
||||
if (self.ls_format_version == "v2"):
|
||||
self.logger.info(
|
||||
"START PLAYBOOK | %s", data['ansible_playbook'], extra=data
|
||||
)
|
||||
|
@ -205,7 +208,7 @@ class CallbackModule(CallbackBase):
|
|||
data['ansible_playbook_duration'] = runtime.total_seconds()
|
||||
data['ansible_result'] = json.dumps(summarize_stat) # deprecated field
|
||||
|
||||
if self.ls_format_version == "v2":
|
||||
if (self.ls_format_version == "v2"):
|
||||
self.logger.info(
|
||||
"FINISH PLAYBOOK | %s", json.dumps(summarize_stat), extra=data
|
||||
)
|
||||
|
@ -224,7 +227,7 @@ class CallbackModule(CallbackBase):
|
|||
data['ansible_play_id'] = self.play_id
|
||||
data['ansible_play_name'] = self.play_name
|
||||
|
||||
if self.ls_format_version == "v2":
|
||||
if (self.ls_format_version == "v2"):
|
||||
self.logger.info("START PLAY | %s", self.play_name, extra=data)
|
||||
else:
|
||||
self.logger.info("ansible play", extra=data)
|
||||
|
@ -249,7 +252,7 @@ class CallbackModule(CallbackBase):
|
|||
data['ansible_task'] = task_name
|
||||
data['ansible_facts'] = self._dump_results(result._result)
|
||||
|
||||
if self.ls_format_version == "v2":
|
||||
if (self.ls_format_version == "v2"):
|
||||
self.logger.info(
|
||||
"SETUP FACTS | %s", self._dump_results(result._result), extra=data
|
||||
)
|
||||
|
@ -270,7 +273,7 @@ class CallbackModule(CallbackBase):
|
|||
data['ansible_task_id'] = self.task_id
|
||||
data['ansible_result'] = self._dump_results(result._result)
|
||||
|
||||
if self.ls_format_version == "v2":
|
||||
if (self.ls_format_version == "v2"):
|
||||
self.logger.info(
|
||||
"TASK OK | %s | RESULT | %s",
|
||||
task_name, self._dump_results(result._result), extra=data
|
||||
|
@ -291,7 +294,7 @@ class CallbackModule(CallbackBase):
|
|||
data['ansible_task_id'] = self.task_id
|
||||
data['ansible_result'] = self._dump_results(result._result)
|
||||
|
||||
if self.ls_format_version == "v2":
|
||||
if (self.ls_format_version == "v2"):
|
||||
self.logger.info("TASK SKIPPED | %s", task_name, extra=data)
|
||||
else:
|
||||
self.logger.info("ansible skipped", extra=data)
|
||||
|
@ -305,7 +308,7 @@ class CallbackModule(CallbackBase):
|
|||
data['ansible_play_name'] = self.play_name
|
||||
data['imported_file'] = imported_file
|
||||
|
||||
if self.ls_format_version == "v2":
|
||||
if (self.ls_format_version == "v2"):
|
||||
self.logger.info("IMPORT | %s", imported_file, extra=data)
|
||||
else:
|
||||
self.logger.info("ansible import", extra=data)
|
||||
|
@ -319,7 +322,7 @@ class CallbackModule(CallbackBase):
|
|||
data['ansible_play_name'] = self.play_name
|
||||
data['imported_file'] = missing_file
|
||||
|
||||
if self.ls_format_version == "v2":
|
||||
if (self.ls_format_version == "v2"):
|
||||
self.logger.info("NOT IMPORTED | %s", missing_file, extra=data)
|
||||
else:
|
||||
self.logger.info("ansible import", extra=data)
|
||||
|
@ -343,7 +346,7 @@ class CallbackModule(CallbackBase):
|
|||
data['ansible_result'] = self._dump_results(result._result)
|
||||
|
||||
self.errors += 1
|
||||
if self.ls_format_version == "v2":
|
||||
if (self.ls_format_version == "v2"):
|
||||
self.logger.error(
|
||||
"TASK FAILED | %s | HOST | %s | RESULT | %s",
|
||||
task_name, self.hostname,
|
||||
|
@ -366,7 +369,7 @@ class CallbackModule(CallbackBase):
|
|||
data['ansible_result'] = self._dump_results(result._result)
|
||||
|
||||
self.errors += 1
|
||||
if self.ls_format_version == "v2":
|
||||
if (self.ls_format_version == "v2"):
|
||||
self.logger.error(
|
||||
"UNREACHABLE | %s | HOST | %s | RESULT | %s",
|
||||
task_name, self.hostname,
|
||||
|
@ -389,7 +392,7 @@ class CallbackModule(CallbackBase):
|
|||
data['ansible_result'] = self._dump_results(result._result)
|
||||
|
||||
self.errors += 1
|
||||
if self.ls_format_version == "v2":
|
||||
if (self.ls_format_version == "v2"):
|
||||
self.logger.error(
|
||||
"ASYNC FAILED | %s | HOST | %s | RESULT | %s",
|
||||
task_name, self.hostname,
|
||||
|
|
|
@ -4,14 +4,15 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
name: mail
|
||||
type: notification
|
||||
short_description: Sends failure events through email
|
||||
description:
|
||||
- This callback reports failures through email.
|
||||
- This callback will report failures through email.
|
||||
author:
|
||||
- Dag Wieers (@dagwieers)
|
||||
requirements:
|
||||
|
@ -133,14 +134,14 @@ class CallbackModule(CallbackBase):
|
|||
if self.bcc:
|
||||
bcc_addresses = email.utils.getaddresses(self.bcc)
|
||||
|
||||
content = f'Date: {email.utils.formatdate()}\n'
|
||||
content += f'From: {email.utils.formataddr(sender_address)}\n'
|
||||
content = 'Date: %s\n' % email.utils.formatdate()
|
||||
content += 'From: %s\n' % email.utils.formataddr(sender_address)
|
||||
if self.to:
|
||||
content += f"To: {', '.join([email.utils.formataddr(pair) for pair in to_addresses])}\n"
|
||||
content += 'To: %s\n' % ', '.join([email.utils.formataddr(pair) for pair in to_addresses])
|
||||
if self.cc:
|
||||
content += f"Cc: {', '.join([email.utils.formataddr(pair) for pair in cc_addresses])}\n"
|
||||
content += f"Message-ID: {email.utils.make_msgid(domain=self.get_option('message_id_domain'))}\n"
|
||||
content += f'Subject: {subject.strip()}\n\n'
|
||||
content += 'Cc: %s\n' % ', '.join([email.utils.formataddr(pair) for pair in cc_addresses])
|
||||
content += 'Message-ID: %s\n' % email.utils.make_msgid(domain=self.get_option('message_id_domain'))
|
||||
content += 'Subject: %s\n\n' % subject.strip()
|
||||
content += body
|
||||
|
||||
addresses = to_addresses
|
||||
|
@ -157,22 +158,23 @@ class CallbackModule(CallbackBase):
|
|||
smtp.quit()
|
||||
|
||||
def subject_msg(self, multiline, failtype, linenr):
|
||||
msg = multiline.strip('\r\n').splitlines()[linenr]
|
||||
return f'{failtype}: {msg}'
|
||||
return '%s: %s' % (failtype, multiline.strip('\r\n').splitlines()[linenr])
|
||||
|
||||
def indent(self, multiline, indent=8):
|
||||
return re.sub('^', ' ' * indent, multiline, flags=re.MULTILINE)
|
||||
|
||||
def body_blob(self, multiline, texttype):
|
||||
''' Turn some text output in a well-indented block for sending in a mail body '''
|
||||
intro = f'with the following {texttype}:\n\n'
|
||||
blob = "\n".join(multiline.strip('\r\n').splitlines())
|
||||
return f"{intro}{self.indent(blob)}\n"
|
||||
intro = 'with the following %s:\n\n' % texttype
|
||||
blob = ''
|
||||
for line in multiline.strip('\r\n').splitlines():
|
||||
blob += '%s\n' % line
|
||||
return intro + self.indent(blob) + '\n'
|
||||
|
||||
def mail_result(self, result, failtype):
|
||||
host = result._host.get_name()
|
||||
if not self.sender:
|
||||
self.sender = f'"Ansible: {host}" <root>'
|
||||
self.sender = '"Ansible: %s" <root>' % host
|
||||
|
||||
# Add subject
|
||||
if self.itembody:
|
||||
|
@ -188,33 +190,31 @@ class CallbackModule(CallbackBase):
|
|||
elif result._result.get('exception'): # Unrelated exceptions are added to output :-/
|
||||
subject = self.subject_msg(result._result['exception'], failtype, -1)
|
||||
else:
|
||||
subject = f'{failtype}: {result._task.name or result._task.action}'
|
||||
subject = '%s: %s' % (failtype, result._task.name or result._task.action)
|
||||
|
||||
# Make playbook name visible (e.g. in Outlook/Gmail condensed view)
|
||||
body = f'Playbook: {os.path.basename(self.playbook._file_name)}\n'
|
||||
body = 'Playbook: %s\n' % os.path.basename(self.playbook._file_name)
|
||||
if result._task.name:
|
||||
body += f'Task: {result._task.name}\n'
|
||||
body += f'Module: {result._task.action}\n'
|
||||
body += f'Host: {host}\n'
|
||||
body += 'Task: %s\n' % result._task.name
|
||||
body += 'Module: %s\n' % result._task.action
|
||||
body += 'Host: %s\n' % host
|
||||
body += '\n'
|
||||
|
||||
# Add task information (as much as possible)
|
||||
body += 'The following task failed:\n\n'
|
||||
if 'invocation' in result._result:
|
||||
body += self.indent(f"{result._task.action}: {json.dumps(result._result['invocation']['module_args'], indent=4)}\n")
|
||||
body += self.indent('%s: %s\n' % (result._task.action, json.dumps(result._result['invocation']['module_args'], indent=4)))
|
||||
elif result._task.name:
|
||||
body += self.indent(f'{result._task.name} ({result._task.action})\n')
|
||||
body += self.indent('%s (%s)\n' % (result._task.name, result._task.action))
|
||||
else:
|
||||
body += self.indent(f'{result._task.action}\n')
|
||||
body += self.indent('%s\n' % result._task.action)
|
||||
body += '\n'
|
||||
|
||||
# Add item / message
|
||||
if self.itembody:
|
||||
body += self.itembody
|
||||
elif result._result.get('failed_when_result') is True:
|
||||
fail_cond_list = '\n- '.join(result._task.failed_when)
|
||||
fail_cond = self.indent(f"failed_when:\n- {fail_cond_list}")
|
||||
body += f"due to the following condition:\n\n{fail_cond}\n\n"
|
||||
body += "due to the following condition:\n\n" + self.indent('failed_when:\n- ' + '\n- '.join(result._task.failed_when)) + '\n\n'
|
||||
elif result._result.get('msg'):
|
||||
body += self.body_blob(result._result['msg'], 'message')
|
||||
|
||||
|
@ -227,13 +227,13 @@ class CallbackModule(CallbackBase):
|
|||
body += self.body_blob(result._result['exception'], 'exception')
|
||||
if result._result.get('warnings'):
|
||||
for i in range(len(result._result.get('warnings'))):
|
||||
body += self.body_blob(result._result['warnings'][i], f'exception {i + 1}')
|
||||
body += self.body_blob(result._result['warnings'][i], 'exception %d' % (i + 1))
|
||||
if result._result.get('deprecations'):
|
||||
for i in range(len(result._result.get('deprecations'))):
|
||||
body += self.body_blob(result._result['deprecations'][i], f'exception {i + 1}')
|
||||
body += self.body_blob(result._result['deprecations'][i], 'exception %d' % (i + 1))
|
||||
|
||||
body += 'and a complete dump of the error:\n\n'
|
||||
body += self.indent(f'{failtype}: {json.dumps(result._result, cls=AnsibleJSONEncoder, indent=4)}')
|
||||
body += self.indent('%s: %s' % (failtype, json.dumps(result._result, cls=AnsibleJSONEncoder, indent=4)))
|
||||
|
||||
self.mail(subject=subject, body=body)
|
||||
|
||||
|
@ -256,4 +256,4 @@ class CallbackModule(CallbackBase):
|
|||
def v2_runner_item_on_failed(self, result):
|
||||
# Pass item information to task failure
|
||||
self.itemsubject = result._result['msg']
|
||||
self.itembody += self.body_blob(json.dumps(result._result, cls=AnsibleJSONEncoder, indent=4), f"failed item dump '{result._result['item']}'")
|
||||
self.itembody += self.body_blob(json.dumps(result._result, cls=AnsibleJSONEncoder, indent=4), "failed item dump '%(item)s'" % result._result)
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
name: nrdp
|
||||
|
@ -131,10 +132,10 @@ class CallbackModule(CallbackBase):
|
|||
xmldata = "<?xml version='1.0'?>\n"
|
||||
xmldata += "<checkresults>\n"
|
||||
xmldata += "<checkresult type='service'>\n"
|
||||
xmldata += f"<hostname>{self.hostname}</hostname>\n"
|
||||
xmldata += f"<servicename>{self.servicename}</servicename>\n"
|
||||
xmldata += f"<state>{state}</state>\n"
|
||||
xmldata += f"<output>{msg}</output>\n"
|
||||
xmldata += "<hostname>%s</hostname>\n" % self.hostname
|
||||
xmldata += "<servicename>%s</servicename>\n" % self.servicename
|
||||
xmldata += "<state>%d</state>\n" % state
|
||||
xmldata += "<output>%s</output>\n" % msg
|
||||
xmldata += "</checkresult>\n"
|
||||
xmldata += "</checkresults>\n"
|
||||
|
||||
|
@ -151,7 +152,7 @@ class CallbackModule(CallbackBase):
|
|||
validate_certs=self.validate_nrdp_certs)
|
||||
return response.read()
|
||||
except Exception as ex:
|
||||
self._display.warning(f"NRDP callback cannot send result {ex}")
|
||||
self._display.warning("NRDP callback cannot send result {0}".format(ex))
|
||||
|
||||
def v2_playbook_on_play_start(self, play):
|
||||
'''
|
||||
|
@ -169,16 +170,17 @@ class CallbackModule(CallbackBase):
|
|||
critical = warning = 0
|
||||
for host in hosts:
|
||||
stat = stats.summarize(host)
|
||||
gstats += (
|
||||
f"'{host}_ok'={stat['ok']} '{host}_changed'={stat['changed']} '{host}_unreachable'={stat['unreachable']} '{host}_failed'={stat['failures']} "
|
||||
)
|
||||
gstats += "'%s_ok'=%d '%s_changed'=%d \
|
||||
'%s_unreachable'=%d '%s_failed'=%d " % \
|
||||
(host, stat['ok'], host, stat['changed'],
|
||||
host, stat['unreachable'], host, stat['failures'])
|
||||
# Critical when failed tasks or unreachable host
|
||||
critical += stat['failures']
|
||||
critical += stat['unreachable']
|
||||
# Warning when changed tasks
|
||||
warning += stat['changed']
|
||||
|
||||
msg = f"{name} | {gstats}"
|
||||
msg = "%s | %s" % (name, gstats)
|
||||
if critical:
|
||||
# Send Critical
|
||||
self._send_nrdp(self.CRITICAL, msg)
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Unknown (!UNKNOWN)
|
||||
|
@ -12,7 +13,7 @@ name: 'null'
|
|||
type: stdout
|
||||
requirements:
|
||||
- set as main display callback
|
||||
short_description: Do not display stuff to screen
|
||||
short_description: do not display stuff to screen
|
||||
description:
|
||||
- This callback prevents outputting events to screen.
|
||||
"""
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Victor Martinez (@v1v) <VictorMartinezRubio@gmail.com>
|
||||
|
@ -35,8 +36,8 @@ options:
|
|||
- Whether to enable this callback only if the given environment variable exists and it is set to V(true).
|
||||
- This is handy when you use Configuration as Code and want to send distributed traces if running in the CI rather when
|
||||
running Ansible locally.
|
||||
- For such, it evaluates the given O(enable_from_environment) value as environment variable and if set to V(true) this
|
||||
plugin is enabled.
|
||||
- For such, it evaluates the given O(enable_from_environment) value as environment variable and if set to true this
|
||||
plugin will be enabled.
|
||||
env:
|
||||
- name: ANSIBLE_OPENTELEMETRY_ENABLE_FROM_ENVIRONMENT
|
||||
ini:
|
||||
|
@ -136,14 +137,14 @@ import getpass
|
|||
import json
|
||||
import os
|
||||
import socket
|
||||
import sys
|
||||
import time
|
||||
import uuid
|
||||
from time import time_ns
|
||||
|
||||
from collections import OrderedDict
|
||||
from os.path import basename
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.module_utils.ansible_release import __version__ as ansible_version
|
||||
from ansible.module_utils.six import raise_from
|
||||
from ansible.module_utils.six.moves.urllib.parse import urlparse
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
|
@ -164,12 +165,31 @@ try:
|
|||
from opentelemetry.sdk.trace.export.in_memory_span_exporter import (
|
||||
InMemorySpanExporter
|
||||
)
|
||||
# Support for opentelemetry-api <= 1.12
|
||||
try:
|
||||
from opentelemetry.util._time import _time_ns
|
||||
except ImportError as imp_exc:
|
||||
OTEL_LIBRARY_TIME_NS_ERROR = imp_exc
|
||||
else:
|
||||
OTEL_LIBRARY_TIME_NS_ERROR = None
|
||||
|
||||
except ImportError as imp_exc:
|
||||
OTEL_LIBRARY_IMPORT_ERROR = imp_exc
|
||||
OTEL_LIBRARY_TIME_NS_ERROR = imp_exc
|
||||
else:
|
||||
OTEL_LIBRARY_IMPORT_ERROR = None
|
||||
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
time_ns = time.time_ns
|
||||
elif not OTEL_LIBRARY_TIME_NS_ERROR:
|
||||
time_ns = _time_ns
|
||||
else:
|
||||
def time_ns():
|
||||
# Support versions older than 3.7 with opentelemetry-api > 1.12
|
||||
return int(time.time() * 1e9)
|
||||
|
||||
|
||||
class TaskData:
|
||||
"""
|
||||
Data about an individual task.
|
||||
|
@ -190,7 +210,7 @@ class TaskData:
|
|||
if host.uuid in self.host_data:
|
||||
if host.status == 'included':
|
||||
# concatenate task include output from multiple items
|
||||
host.result = f'{self.host_data[host.uuid].result}\n{host.result}'
|
||||
host.result = '%s\n%s' % (self.host_data[host.uuid].result, host.result)
|
||||
else:
|
||||
return
|
||||
|
||||
|
@ -213,6 +233,7 @@ class HostData:
|
|||
class OpenTelemetrySource(object):
|
||||
def __init__(self, display):
|
||||
self.ansible_playbook = ""
|
||||
self.ansible_version = None
|
||||
self.session = str(uuid.uuid4())
|
||||
self.host = socket.gethostname()
|
||||
try:
|
||||
|
@ -260,6 +281,9 @@ class OpenTelemetrySource(object):
|
|||
|
||||
task = tasks_data[task_uuid]
|
||||
|
||||
if self.ansible_version is None and hasattr(result, '_task_fields') and result._task_fields['args'].get('_ansible_version'):
|
||||
self.ansible_version = result._task_fields['args'].get('_ansible_version')
|
||||
|
||||
task.dump = dump
|
||||
task.add_host(HostData(host_uuid, host_name, status, result))
|
||||
|
||||
|
@ -307,7 +331,8 @@ class OpenTelemetrySource(object):
|
|||
start_time=parent_start_time, kind=SpanKind.SERVER) as parent:
|
||||
parent.set_status(status)
|
||||
# Populate trace metadata attributes
|
||||
parent.set_attribute("ansible.version", ansible_version)
|
||||
if self.ansible_version is not None:
|
||||
parent.set_attribute("ansible.version", self.ansible_version)
|
||||
parent.set_attribute("ansible.session", self.session)
|
||||
parent.set_attribute("ansible.host.name", self.host)
|
||||
if self.ip_address is not None:
|
||||
|
@ -323,7 +348,7 @@ class OpenTelemetrySource(object):
|
|||
def update_span_data(self, task_data, host_data, span, disable_logs, disable_attributes_in_logs):
|
||||
""" update the span with the given TaskData and HostData """
|
||||
|
||||
name = f'[{host_data.name}] {task_data.play}: {task_data.name}'
|
||||
name = '[%s] %s: %s' % (host_data.name, task_data.play, task_data.name)
|
||||
|
||||
message = 'success'
|
||||
res = {}
|
||||
|
@ -446,7 +471,7 @@ class OpenTelemetrySource(object):
|
|||
def get_error_message_from_results(results, action):
|
||||
for result in results:
|
||||
if result.get('failed', False):
|
||||
return f"{action}({result.get('item', 'none')}) - {OpenTelemetrySource.get_error_message(result)}"
|
||||
return ('{0}({1}) - {2}').format(action, result.get('item', 'none'), OpenTelemetrySource.get_error_message(result))
|
||||
|
||||
@staticmethod
|
||||
def _last_line(text):
|
||||
|
@ -458,14 +483,14 @@ class OpenTelemetrySource(object):
|
|||
message = result.get('msg', 'failed')
|
||||
exception = result.get('exception')
|
||||
stderr = result.get('stderr')
|
||||
return f"message: \"{message}\"\nexception: \"{exception}\"\nstderr: \"{stderr}\""
|
||||
return ('message: "{0}"\nexception: "{1}"\nstderr: "{2}"').format(message, exception, stderr)
|
||||
|
||||
@staticmethod
|
||||
def enrich_error_message_from_results(results, action):
|
||||
message = ""
|
||||
for result in results:
|
||||
if result.get('failed', False):
|
||||
message = f"{action}({result.get('item', 'none')}) - {OpenTelemetrySource.enrich_error_message(result)}\n{message}"
|
||||
message = ('{0}({1}) - {2}\n{3}').format(action, result.get('item', 'none'), OpenTelemetrySource.enrich_error_message(result), message)
|
||||
return message
|
||||
|
||||
|
||||
|
@ -511,9 +536,8 @@ class CallbackModule(CallbackBase):
|
|||
environment_variable = self.get_option('enable_from_environment')
|
||||
if environment_variable is not None and os.environ.get(environment_variable, 'false').lower() != 'true':
|
||||
self.disabled = True
|
||||
self._display.warning(
|
||||
f"The `enable_from_environment` option has been set and {environment_variable} is not enabled. Disabling the `opentelemetry` callback plugin."
|
||||
)
|
||||
self._display.warning("The `enable_from_environment` option has been set and {0} is not enabled. "
|
||||
"Disabling the `opentelemetry` callback plugin.".format(environment_variable))
|
||||
|
||||
self.hide_task_arguments = self.get_option('hide_task_arguments')
|
||||
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2025, Max Mitschke <maxmitschke@fastmail.com>
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
name: print_task
|
||||
type: aggregate
|
||||
short_description: Prints playbook task snippet to job output
|
||||
description:
|
||||
- This plugin prints the currently executing playbook task to the job output.
|
||||
version_added: 10.7.0
|
||||
requirements:
|
||||
- enable in configuration
|
||||
"""
|
||||
|
||||
EXAMPLES = r"""
|
||||
ansible.cfg: |-
|
||||
# Enable plugin
|
||||
[defaults]
|
||||
callbacks_enabled=community.general.print_task
|
||||
"""
|
||||
|
||||
from yaml import load, dump
|
||||
|
||||
try:
|
||||
from yaml import CSafeDumper as SafeDumper
|
||||
from yaml import CSafeLoader as SafeLoader
|
||||
except ImportError:
|
||||
from yaml import SafeDumper, SafeLoader
|
||||
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
|
||||
|
||||
class CallbackModule(CallbackBase):
|
||||
"""
|
||||
This callback module tells you how long your plays ran for.
|
||||
"""
|
||||
CALLBACK_VERSION = 2.0
|
||||
CALLBACK_TYPE = 'aggregate'
|
||||
CALLBACK_NAME = 'community.general.print_task'
|
||||
|
||||
CALLBACK_NEEDS_ENABLED = True
|
||||
|
||||
def __init__(self):
|
||||
super(CallbackModule, self).__init__()
|
||||
self._printed_message = False
|
||||
|
||||
def _print_task(self, task):
|
||||
if hasattr(task, '_ds'):
|
||||
task_snippet = load(str([task._ds.copy()]), Loader=SafeLoader)
|
||||
task_yaml = dump(task_snippet, sort_keys=False, Dumper=SafeDumper)
|
||||
self._display.display(f"\n{task_yaml}\n")
|
||||
self._printed_message = True
|
||||
|
||||
def v2_playbook_on_task_start(self, task, is_conditional):
|
||||
self._printed_message = False
|
||||
|
||||
def v2_runner_on_start(self, host, task):
|
||||
if not self._printed_message:
|
||||
self._print_task(task)
|
|
@ -5,7 +5,8 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Unknown (!UNKNOWN)
|
||||
|
@ -14,9 +15,9 @@ type: notification
|
|||
requirements:
|
||||
- whitelisting in configuration
|
||||
- the C(/usr/bin/say) command line program (standard on macOS) or C(espeak) command line program
|
||||
short_description: Notify using software speech synthesizer
|
||||
short_description: notify using software speech synthesizer
|
||||
description:
|
||||
- This plugin uses C(say) or C(espeak) to "speak" about play events.
|
||||
- This plugin will use the C(say) or C(espeak) program to "speak" about play events.
|
||||
"""
|
||||
|
||||
import platform
|
||||
|
@ -49,7 +50,7 @@ class CallbackModule(CallbackBase):
|
|||
self.synthesizer = get_bin_path('say')
|
||||
if platform.system() != 'Darwin':
|
||||
# 'say' binary available, it might be GNUstep tool which doesn't support 'voice' parameter
|
||||
self._display.warning(f"'say' executable found but system is '{platform.system()}': ignoring voice parameter")
|
||||
self._display.warning("'say' executable found but system is '%s': ignoring voice parameter" % platform.system())
|
||||
else:
|
||||
self.FAILED_VOICE = 'Zarvox'
|
||||
self.REGULAR_VOICE = 'Trinoids'
|
||||
|
@ -68,7 +69,7 @@ class CallbackModule(CallbackBase):
|
|||
# ansible will not call any callback if disabled is set to True
|
||||
if not self.synthesizer:
|
||||
self.disabled = True
|
||||
self._display.warning(f"Unable to find either 'say' or 'espeak' executable, plugin {os.path.basename(__file__)} disabled")
|
||||
self._display.warning("Unable to find either 'say' or 'espeak' executable, plugin %s disabled" % os.path.basename(__file__))
|
||||
|
||||
def say(self, msg, voice):
|
||||
cmd = [self.synthesizer, msg]
|
||||
|
@ -77,7 +78,7 @@ class CallbackModule(CallbackBase):
|
|||
subprocess.call(cmd)
|
||||
|
||||
def runner_on_failed(self, host, res, ignore_errors=False):
|
||||
self.say(f"Failure on host {host}", self.FAILED_VOICE)
|
||||
self.say("Failure on host %s" % host, self.FAILED_VOICE)
|
||||
|
||||
def runner_on_ok(self, host, res):
|
||||
self.say("pew", self.LASER_VOICE)
|
||||
|
@ -86,13 +87,13 @@ class CallbackModule(CallbackBase):
|
|||
self.say("pew", self.LASER_VOICE)
|
||||
|
||||
def runner_on_unreachable(self, host, res):
|
||||
self.say(f"Failure on host {host}", self.FAILED_VOICE)
|
||||
self.say("Failure on host %s" % host, self.FAILED_VOICE)
|
||||
|
||||
def runner_on_async_ok(self, host, res, jid):
|
||||
self.say("pew", self.LASER_VOICE)
|
||||
|
||||
def runner_on_async_failed(self, host, res, jid):
|
||||
self.say(f"Failure on host {host}", self.FAILED_VOICE)
|
||||
self.say("Failure on host %s" % host, self.FAILED_VOICE)
|
||||
|
||||
def playbook_on_start(self):
|
||||
self.say("Running Playbook", self.REGULAR_VOICE)
|
||||
|
@ -102,15 +103,15 @@ class CallbackModule(CallbackBase):
|
|||
|
||||
def playbook_on_task_start(self, name, is_conditional):
|
||||
if not is_conditional:
|
||||
self.say(f"Starting task: {name}", self.REGULAR_VOICE)
|
||||
self.say("Starting task: %s" % name, self.REGULAR_VOICE)
|
||||
else:
|
||||
self.say(f"Notifying task: {name}", self.REGULAR_VOICE)
|
||||
self.say("Notifying task: %s" % name, self.REGULAR_VOICE)
|
||||
|
||||
def playbook_on_setup(self):
|
||||
self.say("Gathering facts", self.REGULAR_VOICE)
|
||||
|
||||
def playbook_on_play_start(self, name):
|
||||
self.say(f"Starting play: {name}", self.HAPPY_VOICE)
|
||||
self.say("Starting play: %s" % name, self.HAPPY_VOICE)
|
||||
|
||||
def playbook_on_stats(self, stats):
|
||||
self.say("Play complete", self.HAPPY_VOICE)
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
author: Unknown (!UNKNOWN)
|
||||
|
@ -12,7 +13,7 @@ name: selective
|
|||
type: stdout
|
||||
requirements:
|
||||
- set as main display callback
|
||||
short_description: Only print certain tasks
|
||||
short_description: only print certain tasks
|
||||
description:
|
||||
- This callback only prints tasks that have been tagged with C(print_action) or that have failed. This allows operators
|
||||
to focus on the tasks that provide value only.
|
||||
|
@ -47,13 +48,13 @@ from ansible.module_utils.common.text.converters import to_text
|
|||
DONT_COLORIZE = False
|
||||
COLORS = {
|
||||
'normal': '\033[0m',
|
||||
'ok': f'\x1b[{C.COLOR_CODES[C.COLOR_OK]}m',
|
||||
'ok': '\033[{0}m'.format(C.COLOR_CODES[C.COLOR_OK]),
|
||||
'bold': '\033[1m',
|
||||
'not_so_bold': '\033[1m\033[34m',
|
||||
'changed': f'\x1b[{C.COLOR_CODES[C.COLOR_CHANGED]}m',
|
||||
'failed': f'\x1b[{C.COLOR_CODES[C.COLOR_ERROR]}m',
|
||||
'changed': '\033[{0}m'.format(C.COLOR_CODES[C.COLOR_CHANGED]),
|
||||
'failed': '\033[{0}m'.format(C.COLOR_CODES[C.COLOR_ERROR]),
|
||||
'endc': '\033[0m',
|
||||
'skipped': f'\x1b[{C.COLOR_CODES[C.COLOR_SKIP]}m',
|
||||
'skipped': '\033[{0}m'.format(C.COLOR_CODES[C.COLOR_SKIP]),
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,7 +73,7 @@ def colorize(msg, color):
|
|||
if DONT_COLORIZE:
|
||||
return msg
|
||||
else:
|
||||
return f"{COLORS[color]}{msg}{COLORS['endc']}"
|
||||
return '{0}{1}{2}'.format(COLORS[color], msg, COLORS['endc'])
|
||||
|
||||
|
||||
class CallbackModule(CallbackBase):
|
||||
|
@ -105,15 +106,15 @@ class CallbackModule(CallbackBase):
|
|||
line_length = 120
|
||||
if self.last_skipped:
|
||||
print()
|
||||
line = f"# {task_name} "
|
||||
msg = colorize(f"{line}{'*' * (line_length - len(line))}", 'bold')
|
||||
line = "# {0} ".format(task_name)
|
||||
msg = colorize("{0}{1}".format(line, '*' * (line_length - len(line))), 'bold')
|
||||
print(msg)
|
||||
|
||||
def _indent_text(self, text, indent_level):
|
||||
lines = text.splitlines()
|
||||
result_lines = []
|
||||
for l in lines:
|
||||
result_lines.append(f"{' ' * indent_level}{l}")
|
||||
result_lines.append("{0}{1}".format(' ' * indent_level, l))
|
||||
return '\n'.join(result_lines)
|
||||
|
||||
def _print_diff(self, diff, indent_level):
|
||||
|
@ -146,19 +147,19 @@ class CallbackModule(CallbackBase):
|
|||
change_string = colorize('FAILED!!!', color)
|
||||
else:
|
||||
color = 'changed' if changed else 'ok'
|
||||
change_string = colorize(f"changed={changed}", color)
|
||||
change_string = colorize("changed={0}".format(changed), color)
|
||||
|
||||
msg = colorize(msg, color)
|
||||
|
||||
line_length = 120
|
||||
spaces = ' ' * (40 - len(name) - indent_level)
|
||||
line = f"{' ' * indent_level} * {name}{spaces}- {change_string}"
|
||||
line = "{0} * {1}{2}- {3}".format(' ' * indent_level, name, spaces, change_string)
|
||||
|
||||
if len(msg) < 50:
|
||||
line += f' -- {msg}'
|
||||
print(f"{line} {'-' * (line_length - len(line))}---------")
|
||||
line += ' -- {0}'.format(msg)
|
||||
print("{0} {1}---------".format(line, '-' * (line_length - len(line))))
|
||||
else:
|
||||
print(f"{line} {'-' * (line_length - len(line))}")
|
||||
print("{0} {1}".format(line, '-' * (line_length - len(line))))
|
||||
print(self._indent_text(msg, indent_level + 4))
|
||||
|
||||
if diff:
|
||||
|
@ -238,10 +239,8 @@ class CallbackModule(CallbackBase):
|
|||
else:
|
||||
color = 'ok'
|
||||
|
||||
msg = (
|
||||
f"{host} : ok={s['ok']}\tchanged={s['changed']}\tfailed={s['failures']}\tunreachable="
|
||||
f"{s['unreachable']}\trescued={s['rescued']}\tignored={s['ignored']}"
|
||||
)
|
||||
msg = '{0} : ok={1}\tchanged={2}\tfailed={3}\tunreachable={4}\trescued={5}\tignored={6}'.format(
|
||||
host, s['ok'], s['changed'], s['failures'], s['unreachable'], s['rescued'], s['ignored'])
|
||||
print(colorize(msg, color))
|
||||
|
||||
def v2_runner_on_skipped(self, result, **kwargs):
|
||||
|
@ -253,15 +252,17 @@ class CallbackModule(CallbackBase):
|
|||
line_length = 120
|
||||
spaces = ' ' * (31 - len(result._host.name) - 4)
|
||||
|
||||
line = f" * {colorize(result._host.name, 'not_so_bold')}{spaces}- {colorize('skipped', 'skipped')}"
|
||||
line = " * {0}{1}- {2}".format(colorize(result._host.name, 'not_so_bold'),
|
||||
spaces,
|
||||
colorize("skipped", 'skipped'),)
|
||||
|
||||
reason = result._result.get('skipped_reason', '') or \
|
||||
result._result.get('skip_reason', '')
|
||||
if len(reason) < 50:
|
||||
line += f' -- {reason}'
|
||||
print(f"{line} {'-' * (line_length - len(line))}---------")
|
||||
line += ' -- {0}'.format(reason)
|
||||
print("{0} {1}---------".format(line, '-' * (line_length - len(line))))
|
||||
else:
|
||||
print(f"{line} {'-' * (line_length - len(line))}")
|
||||
print("{0} {1}".format(line, '-' * (line_length - len(line))))
|
||||
print(self._indent_text(reason, 8))
|
||||
print(reason)
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue