mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-28 17:36:49 +00:00
Compare commits
339 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4aeb322bb | ||
|
|
165da11731 | ||
|
|
88f7b5a675 | ||
|
|
ca3beb68de | ||
|
|
aa6b5e4a60 | ||
|
|
c740f89df3 | ||
|
|
9708561131 | ||
|
|
6558c9981f | ||
|
|
c949f3a834 | ||
|
|
9f3c86a589 | ||
|
|
febe7a2fb4 | ||
|
|
165182cdbf | ||
|
|
61a0dc4370 | ||
|
|
4e57240e9f | ||
|
|
ca388f064a | ||
|
|
fe224a6537 | ||
|
|
9c11230824 | ||
|
|
be1a905f6f | ||
|
|
57cfd1b46d | ||
|
|
737d37e019 | ||
|
|
3c20261264 | ||
|
|
d254372d37 | ||
|
|
fab717bb2d | ||
|
|
27a3d6d85d | ||
|
|
91376f7989 | ||
|
|
9a4e77384d | ||
|
|
f09b1e7f4c | ||
|
|
cb81abc636 | ||
|
|
c411e12555 | ||
|
|
24efe6b9db | ||
|
|
b4628e27b2 | ||
|
|
c58dda14c2 | ||
|
|
6e913a3b28 | ||
|
|
d4df585370 | ||
|
|
0a26b6d48d | ||
|
|
f0fcc91ac7 | ||
|
|
69d7f19c74 | ||
|
|
0edc3e820e | ||
|
|
6861450243 | ||
|
|
e49c6a339e | ||
|
|
486c47f922 | ||
|
|
c1b16d534f | ||
|
|
eab39ffc23 | ||
|
|
bc228d82be | ||
|
|
e7cc996470 | ||
|
|
3e338a1cca | ||
|
|
ad6ff9b0c5 | ||
|
|
0eb33c2839 | ||
|
|
114eb67f58 | ||
|
|
1f2c7b1731 | ||
|
|
f4dd4d5ace | ||
|
|
9b493d53a9 | ||
|
|
484f642c23 | ||
|
|
4171418e37 | ||
|
|
996fc8c18e | ||
|
|
ae5090d90e | ||
|
|
76dd465e08 | ||
|
|
fe798e22a6 | ||
|
|
6e0bc4f45c | ||
|
|
087c5a53d5 | ||
|
|
1aa94a5a1d | ||
|
|
2bac3bb8b2 | ||
|
|
0524d70805 | ||
|
|
91ecb8042d | ||
|
|
0cfd43be2c | ||
|
|
f8823211c7 | ||
|
|
59cb5b2d6f | ||
|
|
ee11847c7e | ||
|
|
67b921e4e6 | ||
|
|
86042b726a | ||
|
|
64e797d077 | ||
|
|
a35542d0d1 | ||
|
|
cb3ca05bd1 | ||
|
|
29a7d24d75 | ||
|
|
d7340945a4 | ||
|
|
f95b8ab9cd | ||
|
|
42bc2cb4d8 | ||
|
|
83994c0a2d | ||
|
|
bf780ea738 | ||
|
|
a5765143f1 | ||
|
|
86f9a657e7 | ||
|
|
6c5c05dfdc | ||
|
|
ea8720f572 | ||
|
|
14b19afc9a | ||
|
|
aa77a88f4b | ||
|
|
f93a1bf5ec | ||
|
|
28bdf1ed74 | ||
|
|
08f14f3eb0 | ||
|
|
37cddb8c02 | ||
|
|
a64e36820f | ||
|
|
7d19eca8bf | ||
|
|
cee5f31b70 | ||
|
|
c280b793de | ||
|
|
9bb768ae62 | ||
|
|
c9e11e5c0c | ||
|
|
33093e9f3e | ||
|
|
f3ea3e0da5 | ||
|
|
5e1e8d06ef | ||
|
|
05824a0754 | ||
|
|
f52dd194f9 | ||
|
|
be7f11bf39 | ||
|
|
997761878c | ||
|
|
59e58079cb | ||
|
|
cd706454ec | ||
|
|
81b16a88ee | ||
|
|
5ee687049f | ||
|
|
d4f272ba52 | ||
|
|
6fa833feed | ||
|
|
33ccabed13 | ||
|
|
e96552396e | ||
|
|
7059789f35 | ||
|
|
f3be0076af | ||
|
|
b1d94385ae | ||
|
|
ed8049a220 | ||
|
|
bbd68e26a2 | ||
|
|
9f67cbbe36 | ||
|
|
512bf4b77f | ||
|
|
f66cc7c933 | ||
|
|
3fb1ff0b72 | ||
|
|
bf8f2950b4 | ||
|
|
e8a7c27cab | ||
|
|
1dd86bcb55 | ||
|
|
b97bee3fd6 | ||
|
|
df34569fad | ||
|
|
e939cd07ef | ||
|
|
a49ad340af | ||
|
|
3862de3f15 | ||
|
|
1ddcdc63ff | ||
|
|
abcba9dbbe | ||
|
|
6b8a1cd8e6 | ||
|
|
6d003ca7fc | ||
|
|
6cf674485f | ||
|
|
11c7611ced | ||
|
|
627371e2d8 | ||
|
|
733e31c85f | ||
|
|
c077818c5d | ||
|
|
3d67f51824 | ||
|
|
2dee3464dd | ||
|
|
9a97bc7c11 | ||
|
|
c0cb7958cb | ||
|
|
345a69304a | ||
|
|
03084d1133 | ||
|
|
d209466985 | ||
|
|
38adbec483 | ||
|
|
681fad92c2 | ||
|
|
e8bdec2733 | ||
|
|
29f5033737 | ||
|
|
617be6e124 | ||
|
|
c8a2ac3a47 | ||
|
|
094dc6b69c | ||
|
|
810f3b50fc | ||
|
|
3db0fcf1bd | ||
|
|
b64929118e | ||
|
|
7d3e6d1bb7 | ||
|
|
1877ef1510 | ||
|
|
53f729730b | ||
|
|
f0529dcb0e | ||
|
|
682c6fc967 | ||
|
|
92544993c0 | ||
|
|
95b8afdea3 | ||
|
|
2c762c4753 | ||
|
|
de1f0ff419 | ||
|
|
b72b7d4936 | ||
|
|
0307fd12eb | ||
|
|
18a6bdd6aa | ||
|
|
3ec2fde2c6 | ||
|
|
3b97fad577 | ||
|
|
51394b55a0 | ||
|
|
673c79f6d9 | ||
|
|
5b9ee78610 | ||
|
|
1f1ae558f9 | ||
|
|
bad4b4b086 | ||
|
|
e944a67c18 | ||
|
|
cc3a79bc48 | ||
|
|
cc29b16536 | ||
|
|
50d7597ddc | ||
|
|
6bd131f2fb | ||
|
|
490899f87f | ||
|
|
c168f9c3be | ||
|
|
a7e8e95b50 | ||
|
|
e348d28559 | ||
|
|
5648e0e2af | ||
|
|
78297e44b7 | ||
|
|
cb7a970f6f | ||
|
|
7e3c73ceb2 | ||
|
|
867aee606e | ||
|
|
4b262e39f0 | ||
|
|
d03ae532ed | ||
|
|
b4a500103a | ||
|
|
0ef805699d | ||
|
|
9de145482b | ||
|
|
755a49692d | ||
|
|
ed79a68553 | ||
|
|
3186a944e9 | ||
|
|
1b2c2af9a8 | ||
|
|
71d74a7960 | ||
|
|
49e3da3646 | ||
|
|
33df7b61c0 | ||
|
|
24efe9ee9a | ||
|
|
4c4ef80ca9 | ||
|
|
cd0a414e9f | ||
|
|
c587c09df1 | ||
|
|
f0fd6aa97d | ||
|
|
68d0cac310 | ||
|
|
9f87989e7f | ||
|
|
2b8ac3c629 | ||
|
|
de193ac1bf | ||
|
|
b1d9507cd2 | ||
|
|
a64df658c5 | ||
|
|
868699dc5f | ||
|
|
84dbb286eb | ||
|
|
ea5cbe2553 | ||
|
|
31ff3f662d | ||
|
|
dcc3d4f508 | ||
|
|
393f2d6153 | ||
|
|
451c90251a | ||
|
|
3da24d50cd | ||
|
|
6c6de8fb90 | ||
|
|
8818a6f242 | ||
|
|
7b8b73f17f | ||
|
|
855cbd67ae | ||
|
|
fe520a6b09 | ||
|
|
f38bfaddf0 | ||
|
|
bf117c839c | ||
|
|
6781dd1918 | ||
|
|
0ca41dedce | ||
|
|
098912c229 | ||
|
|
59a9d34250 | ||
|
|
c4b18361b9 | ||
|
|
1430ed000c | ||
|
|
a35b2eda4c | ||
|
|
b92542dea2 | ||
|
|
4a40f99cd6 | ||
|
|
5ad703ac64 | ||
|
|
44172ddaa6 | ||
|
|
937dea6af3 | ||
|
|
f05f8bb49a | ||
|
|
756c0776d6 | ||
|
|
3985ade3fc | ||
|
|
6ec049734e | ||
|
|
08b0ea700d | ||
|
|
cc79c24c01 | ||
|
|
58eb495797 | ||
|
|
317f79ff1f | ||
|
|
b9ac2dcda5 | ||
|
|
682bb4b88a | ||
|
|
4caa6574de | ||
|
|
6fb212b104 | ||
|
|
3b73e7ed2a | ||
|
|
759ca9a0ab | ||
|
|
0ff003d312 | ||
|
|
9e3a729da9 | ||
|
|
2670215c8a | ||
|
|
e3f02cb161 | ||
|
|
fc2b1aac4a | ||
|
|
dc531b183d | ||
|
|
02431341b7 | ||
|
|
217a62aca2 | ||
|
|
4dc897d559 | ||
|
|
84ebda65f1 | ||
|
|
b49bf081f8 | ||
|
|
7c99c53c64 | ||
|
|
06d72dfed9 | ||
|
|
568e18809c | ||
|
|
2d4ce9f219 | ||
|
|
669d0925f7 | ||
|
|
eb1c1210d6 | ||
|
|
2ce3cf91b8 | ||
|
|
6383c82328 | ||
|
|
b3485b8fca | ||
|
|
28969c61ad | ||
|
|
2fc7baecf8 | ||
|
|
488e828f9b | ||
|
|
1f49241481 | ||
|
|
77fde030cd | ||
|
|
2b39470a77 | ||
|
|
fab73a1d1e | ||
|
|
25be366cc3 | ||
|
|
af53271c41 | ||
|
|
f95e0d775d | ||
|
|
c3bc172bf6 | ||
|
|
b5e58a3bcc | ||
|
|
471f523f53 | ||
|
|
50021d6bfb | ||
|
|
b52a7a6b0e | ||
|
|
b22638ba0c | ||
|
|
f0b3bba030 | ||
|
|
7ea544a624 | ||
|
|
fb2833d34d | ||
|
|
632fc07e65 | ||
|
|
be22ca0633 | ||
|
|
23aacc78e1 | ||
|
|
fd436bdbc2 | ||
|
|
da7cba4c12 | ||
|
|
03039a56c0 | ||
|
|
428e181440 | ||
|
|
b8545d10e6 | ||
|
|
f7fa54eed9 | ||
|
|
101c957631 | ||
|
|
53da86c1a5 | ||
|
|
1ca775248f | ||
|
|
3f80aa3c63 | ||
|
|
b1094d840f | ||
|
|
a3b748a15e | ||
|
|
911769d2f3 | ||
|
|
11e1423f60 | ||
|
|
79929830c4 | ||
|
|
5c1c8152ec | ||
|
|
3bf3d6bff4 | ||
|
|
f2a420ead5 | ||
|
|
c7481c5c96 | ||
|
|
83ff4429e8 | ||
|
|
52c28494ca | ||
|
|
8ad43fd774 | ||
|
|
0624951e17 | ||
|
|
5e5af458fb | ||
|
|
6a03108609 | ||
|
|
e87ca10b61 | ||
|
|
801e3d86ef | ||
|
|
270dc133b3 | ||
|
|
9874462abb | ||
|
|
6c7e9116e1 | ||
|
|
6a6bbb6577 | ||
|
|
60c8b9a67f | ||
|
|
672385309c | ||
|
|
27a4ffc293 | ||
|
|
bc0f99386b | ||
|
|
7610501c66 | ||
|
|
6b20572ea1 | ||
|
|
0e9cd5e6b6 | ||
|
|
f683d6a05d | ||
|
|
c604cc5ba9 | ||
|
|
eae33c20f6 | ||
|
|
97b584e261 | ||
|
|
621fb6a619 | ||
|
|
27827cbea4 | ||
|
|
858eaac500 | ||
|
|
df9c5d1d35 | ||
|
|
16cd2ae76e |
@@ -112,6 +112,19 @@ stages:
|
||||
- test: 2
|
||||
- test: 3
|
||||
- test: 4
|
||||
- stage: Sanity_2_12
|
||||
displayName: Sanity 2.12
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Test {0}
|
||||
testFormat: 2.12/sanity/{0}
|
||||
targets:
|
||||
- test: 1
|
||||
- test: 2
|
||||
- test: 3
|
||||
- test: 4
|
||||
### Units
|
||||
- stage: Units_devel
|
||||
displayName: Units devel
|
||||
@@ -123,6 +136,7 @@ stages:
|
||||
testFormat: devel/units/{0}/1
|
||||
targets:
|
||||
- test: 2.7
|
||||
- test: 3.5
|
||||
- test: 3.6
|
||||
- test: 3.7
|
||||
- test: 3.8
|
||||
@@ -138,7 +152,6 @@ stages:
|
||||
nameFormat: Python {0}
|
||||
testFormat: 2.15/units/{0}/1
|
||||
targets:
|
||||
- test: 3.5
|
||||
- test: "3.10"
|
||||
- stage: Units_2_14
|
||||
displayName: Units 2.14
|
||||
@@ -161,6 +174,17 @@ stages:
|
||||
targets:
|
||||
- test: 2.7
|
||||
- test: 3.8
|
||||
- stage: Units_2_12
|
||||
displayName: Units 2.12
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: 2.12/units/{0}/1
|
||||
targets:
|
||||
- test: 2.6
|
||||
- test: 3.8
|
||||
|
||||
## Remote
|
||||
- stage: Remote_devel_extra_vms
|
||||
@@ -175,6 +199,8 @@ stages:
|
||||
test: alpine/3.17
|
||||
# - name: Fedora 37
|
||||
# test: fedora/37
|
||||
# - name: Ubuntu 20.04
|
||||
# test: ubuntu/20.04
|
||||
- name: Ubuntu 22.04
|
||||
test: ubuntu/22.04
|
||||
groups:
|
||||
@@ -243,6 +269,22 @@ stages:
|
||||
test: macos/12.0
|
||||
- name: RHEL 8.5
|
||||
test: rhel/8.5
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- stage: Remote_2_12
|
||||
displayName: Remote 2.12
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.12/{0}
|
||||
targets:
|
||||
- name: macOS 11.1
|
||||
test: macos/11.1
|
||||
- name: RHEL 8.4
|
||||
test: rhel/8.4
|
||||
- name: FreeBSD 13.0
|
||||
test: freebsd/13.0
|
||||
groups:
|
||||
@@ -319,6 +361,24 @@ stages:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- stage: Docker_2_12
|
||||
displayName: Docker 2.12
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
testFormat: 2.12/linux/{0}
|
||||
targets:
|
||||
- name: CentOS 6
|
||||
test: centos6
|
||||
- name: Fedora 34
|
||||
test: fedora34
|
||||
- name: Ubuntu 18.04
|
||||
test: ubuntu1804
|
||||
groups:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
|
||||
### Community Docker
|
||||
- stage: Docker_community_devel
|
||||
@@ -382,30 +442,45 @@ stages:
|
||||
testFormat: 2.13/generic/{0}/1
|
||||
targets:
|
||||
- test: 3.9
|
||||
- stage: Generic_2_12
|
||||
displayName: Generic 2.12
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: templates/matrix.yml
|
||||
parameters:
|
||||
nameFormat: Python {0}
|
||||
testFormat: 2.12/generic/{0}/1
|
||||
targets:
|
||||
- test: 3.8
|
||||
|
||||
- stage: Summary
|
||||
condition: succeededOrFailed()
|
||||
dependsOn:
|
||||
- Sanity_devel
|
||||
- Sanity_2_12
|
||||
- Sanity_2_13
|
||||
- Sanity_2_14
|
||||
- Sanity_2_15
|
||||
- Units_devel
|
||||
- Units_2_12
|
||||
- Units_2_13
|
||||
- Units_2_14
|
||||
- Units_2_15
|
||||
- Remote_devel_extra_vms
|
||||
- Remote_devel
|
||||
- Remote_2_12
|
||||
- Remote_2_13
|
||||
- Remote_2_14
|
||||
- Remote_2_15
|
||||
- Docker_devel
|
||||
- Docker_2_12
|
||||
- Docker_2_13
|
||||
- Docker_2_14
|
||||
- Docker_2_15
|
||||
- Docker_community_devel
|
||||
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
|
||||
# - Generic_devel
|
||||
# - Generic_2_12
|
||||
# - Generic_2_13
|
||||
# - Generic_2_14
|
||||
# - Generic_2_15
|
||||
|
||||
10
.github/BOTMETA.yml
vendored
10
.github/BOTMETA.yml
vendored
@@ -539,8 +539,6 @@ files:
|
||||
maintainers: zimbatm
|
||||
$modules/gunicorn.py:
|
||||
maintainers: agmezr
|
||||
$modules/hana_query.py:
|
||||
maintainers: rainerleber
|
||||
$modules/haproxy.py:
|
||||
maintainers: ravibhure Normo
|
||||
$modules/heroku_collaborator.py:
|
||||
@@ -625,6 +623,8 @@ files:
|
||||
maintainers: bregman-arie
|
||||
$modules/ipa_:
|
||||
maintainers: $team_ipa
|
||||
$modules/ipbase_info.py:
|
||||
maintainers: dominikkukacka
|
||||
$modules/ipa_pwpolicy.py:
|
||||
maintainers: adralioh
|
||||
$modules/ipa_service.py:
|
||||
@@ -929,7 +929,7 @@ files:
|
||||
$modules/pamd.py:
|
||||
maintainers: kevensen
|
||||
$modules/parted.py:
|
||||
maintainers: ColOfAbRiX jake2184
|
||||
maintainers: ColOfAbRiX rosowiecki jake2184
|
||||
$modules/pear.py:
|
||||
ignore: jle64
|
||||
labels: pear
|
||||
@@ -1100,10 +1100,6 @@ files:
|
||||
maintainers: nerzhul
|
||||
$modules/runit.py:
|
||||
maintainers: jsumners
|
||||
$modules/sap_task_list_execute:
|
||||
maintainers: rainerleber
|
||||
$modules/sapcar_extract.py:
|
||||
maintainers: RainerLeber
|
||||
$modules/say.py:
|
||||
maintainers: $team_ansible_core
|
||||
ignore: mpdehaan
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -47,7 +47,7 @@ body:
|
||||
label: Component Name
|
||||
description: >-
|
||||
Write the short name of the module, plugin, task or feature below,
|
||||
*use your best guess if unsure*.
|
||||
*use your best guess if unsure*. Do not include `community.general.`!
|
||||
placeholder: dnf, apt, yum, pip, user etc.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -46,8 +46,8 @@ body:
|
||||
attributes:
|
||||
label: Component Name
|
||||
description: >-
|
||||
Write the short name of the rst file, module, plugin, task or
|
||||
feature below, *use your best guess if unsure*.
|
||||
Write the short name of the file, module, plugin, task or feature below,
|
||||
*use your best guess if unsure*. Do not include `community.general.`!
|
||||
placeholder: mysql_user
|
||||
validations:
|
||||
required: true
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -42,8 +42,8 @@ body:
|
||||
attributes:
|
||||
label: Component Name
|
||||
description: >-
|
||||
Write the short name of the module, plugin, task or feature below,
|
||||
*use your best guess if unsure*.
|
||||
Write the short name of the module or plugin, or which other part(s) of the collection this feature affects.
|
||||
*use your best guess if unsure*. Do not include `community.general.`!
|
||||
placeholder: dnf, apt, yum, pip, user etc.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
32
.github/pull_request_template.md
vendored
Normal file
32
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
##### SUMMARY
|
||||
<!--- Describe the change below, including rationale and design decisions -->
|
||||
|
||||
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
|
||||
|
||||
<!--- Please do not forget to include a changelog fragment:
|
||||
https://docs.ansible.com/ansible/devel/community/collection_development_process.html#creating-changelog-fragments
|
||||
No need to include one for docs-only or test-only PR, and for new plugin/module PRs.
|
||||
Read about more details in CONTRIBUTING.md.
|
||||
-->
|
||||
|
||||
##### ISSUE TYPE
|
||||
<!--- Pick one or more below and delete the rest.
|
||||
'Test Pull Request' is for PRs that add/extend tests without code changes. -->
|
||||
- Bugfix Pull Request
|
||||
- Docs Pull Request
|
||||
- Feature Pull Request
|
||||
- New Module/Plugin Pull Request
|
||||
- Refactoring Pull Request
|
||||
- Test Pull Request
|
||||
|
||||
##### COMPONENT NAME
|
||||
<!--- Write the SHORT NAME of the module, plugin, task or feature below. -->
|
||||
|
||||
##### ADDITIONAL INFORMATION
|
||||
<!--- Include additional information to help people understand the change here -->
|
||||
<!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->
|
||||
|
||||
<!--- Paste verbatim command output below, e.g. before and after your change -->
|
||||
```paste below
|
||||
|
||||
```
|
||||
3
.github/pull_request_template.md.license
vendored
Normal file
3
.github/pull_request_template.md.license
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
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
|
||||
59
.github/workflows/ansible-test.yml
vendored
59
.github/workflows/ansible-test.yml
vendored
@@ -14,9 +14,9 @@ on:
|
||||
- main
|
||||
- stable-*
|
||||
pull_request:
|
||||
# Run EOL CI once per day (at 10:00 UTC)
|
||||
# Run EOL CI once per day (at 08:00 UTC)
|
||||
schedule:
|
||||
- cron: '0 10 * * *'
|
||||
- cron: '0 8 * * *'
|
||||
|
||||
concurrency:
|
||||
# Make sure there is at most one active run per PR, but do not cancel any non-PR runs
|
||||
@@ -30,7 +30,6 @@ jobs:
|
||||
matrix:
|
||||
ansible:
|
||||
- '2.11'
|
||||
- '2.12'
|
||||
# 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
|
||||
@@ -44,7 +43,7 @@ jobs:
|
||||
- name: Perform sanity testing
|
||||
uses: felixfontein/ansible-test-gh-action@main
|
||||
with:
|
||||
ansible-core-github-repository-slug: ${{ contains(fromJson('["2.10", "2.11"]'), matrix.ansible) && 'felixfontein/ansible' || 'ansible/ansible' }}
|
||||
ansible-core-github-repository-slug: felixfontein/ansible
|
||||
ansible-core-version: stable-${{ matrix.ansible }}
|
||||
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
|
||||
pull-request-change-detection: 'true'
|
||||
@@ -76,10 +75,6 @@ jobs:
|
||||
python: '2.7'
|
||||
- ansible: '2.11'
|
||||
python: '3.5'
|
||||
- ansible: '2.12'
|
||||
python: '2.6'
|
||||
- ansible: '2.12'
|
||||
python: '3.8'
|
||||
|
||||
steps:
|
||||
- name: >-
|
||||
@@ -87,7 +82,7 @@ jobs:
|
||||
Ansible version ${{ matrix.ansible }}
|
||||
uses: felixfontein/ansible-test-gh-action@main
|
||||
with:
|
||||
ansible-core-github-repository-slug: ${{ contains(fromJson('["2.10", "2.11"]'), matrix.ansible) && 'felixfontein/ansible' || 'ansible/ansible' }}
|
||||
ansible-core-github-repository-slug: felixfontein/ansible
|
||||
ansible-core-version: stable-${{ matrix.ansible }}
|
||||
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
|
||||
pre-test-cmd: >-
|
||||
@@ -168,49 +163,7 @@ jobs:
|
||||
# - ansible: '2.11'
|
||||
# docker: default
|
||||
# python: '3.5'
|
||||
# target: azp/generic/1/
|
||||
# 2.12
|
||||
- ansible: '2.12'
|
||||
docker: centos6
|
||||
python: ''
|
||||
target: azp/posix/1/
|
||||
- ansible: '2.12'
|
||||
docker: centos6
|
||||
python: ''
|
||||
target: azp/posix/2/
|
||||
- ansible: '2.12'
|
||||
docker: centos6
|
||||
python: ''
|
||||
target: azp/posix/3/
|
||||
- ansible: '2.12'
|
||||
docker: fedora34
|
||||
python: ''
|
||||
target: azp/posix/1/
|
||||
- ansible: '2.12'
|
||||
docker: fedora34
|
||||
python: ''
|
||||
target: azp/posix/2/
|
||||
- ansible: '2.12'
|
||||
docker: fedora34
|
||||
python: ''
|
||||
target: azp/posix/3/
|
||||
- ansible: '2.12'
|
||||
docker: ubuntu1804
|
||||
python: ''
|
||||
target: azp/posix/1/
|
||||
- ansible: '2.12'
|
||||
docker: ubuntu1804
|
||||
python: ''
|
||||
target: azp/posix/2/
|
||||
- ansible: '2.12'
|
||||
docker: ubuntu1804
|
||||
python: ''
|
||||
target: azp/posix/3/
|
||||
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
|
||||
# - ansible: '2.12'
|
||||
# docker: default
|
||||
# python: '3.8'
|
||||
# target: azp/generic/1/
|
||||
# target: azp/generic/2/
|
||||
|
||||
steps:
|
||||
- name: >-
|
||||
@@ -219,7 +172,7 @@ jobs:
|
||||
under Python ${{ matrix.python }}
|
||||
uses: felixfontein/ansible-test-gh-action@main
|
||||
with:
|
||||
ansible-core-github-repository-slug: ${{ contains(fromJson('["2.10", "2.11"]'), matrix.ansible) && 'felixfontein/ansible' || 'ansible/ansible' }}
|
||||
ansible-core-github-repository-slug: felixfontein/ansible
|
||||
ansible-core-version: stable-${{ matrix.ansible }}
|
||||
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
|
||||
docker-image: ${{ matrix.docker }}
|
||||
|
||||
31
.github/workflows/codeql-analysis.yml
vendored
31
.github/workflows/codeql-analysis.yml
vendored
@@ -8,6 +8,7 @@ name: "Code scanning - action"
|
||||
on:
|
||||
schedule:
|
||||
- cron: '26 19 * * 1'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -24,38 +25,12 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
fetch-depth: 2
|
||||
|
||||
# If this run was triggered by a pull request event, then checkout
|
||||
# the head of the pull request instead of the merge commit.
|
||||
- run: git checkout HEAD^2
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
# with:
|
||||
# languages: go, javascript, csharp, python, cpp, java
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
with:
|
||||
languages: python
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
|
||||
890
CHANGELOG.rst
890
CHANGELOG.rst
@@ -4,159 +4,305 @@ Community General Release Notes
|
||||
|
||||
.. contents:: Topics
|
||||
|
||||
This changelog describes changes after version 5.0.0.
|
||||
This changelog describes changes after version 6.0.0.
|
||||
|
||||
v6.6.2
|
||||
v7.0.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix release.
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- csv module utils - detects and remove unicode BOM markers from incoming CSV content (https://github.com/ansible-collections/community.general/pull/6662).
|
||||
- gitlab_group - the module passed parameters to the API call even when not set. The module is now filtering out ``None`` values to remediate this (https://github.com/ansible-collections/community.general/pull/6712).
|
||||
- ini_file - fix a bug where the inactive options were not used when possible (https://github.com/ansible-collections/community.general/pull/6575).
|
||||
- keycloak module utils - fix ``is_struct_included`` handling of lists of lists/dictionaries (https://github.com/ansible-collections/community.general/pull/6688).
|
||||
- keycloak module utils - the function ``get_user_by_username`` now return the user representation or ``None`` as stated in the documentation (https://github.com/ansible-collections/community.general/pull/6758).
|
||||
|
||||
v6.6.1
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- dconf - if ``gi.repository.GLib`` is missing, try to respawn in a Python interpreter that has it (https://github.com/ansible-collections/community.general/pull/6491).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- deps module utils - do not fail when dependency cannot be found (https://github.com/ansible-collections/community.general/pull/6479).
|
||||
- nmcli - fix bond option ``xmit_hash_policy`` (https://github.com/ansible-collections/community.general/pull/6527).
|
||||
- passwordstore lookup plugin - make compatible with ansible-core 2.16 (https://github.com/ansible-collections/community.general/pull/6447).
|
||||
- portage - fix ``changed_use`` and ``newuse`` not triggering rebuilds (https://github.com/ansible-collections/community.general/issues/6008, https://github.com/ansible-collections/community.general/pull/6548).
|
||||
- portage - update the logic for generating the emerge command arguments to ensure that ``withbdeps: false`` results in a passing an ``n`` argument with the ``--with-bdeps`` emerge flag (https://github.com/ansible-collections/community.general/issues/6451, https://github.com/ansible-collections/community.general/pull/6456).
|
||||
- proxmox_tasks_info - remove ``api_user`` + ``api_password`` constraint from ``required_together`` as it causes to require ``api_password`` even when API token param is used (https://github.com/ansible-collections/community.general/issues/6201).
|
||||
- puppet - handling ``noop`` parameter was not working at all, now it is has been fixed (https://github.com/ansible-collections/community.general/issues/6452, https://github.com/ansible-collections/community.general/issues/6458).
|
||||
- terraform - fix broken ``warn()`` call (https://github.com/ansible-collections/community.general/pull/6497).
|
||||
- xfs_quota - in case of a project quota, the call to ``xfs_quota`` did not initialize/reset the project (https://github.com/ansible-collections/community.general/issues/5143).
|
||||
- zypper - added handling of zypper exitcode 102. Changed state is set correctly now and rc 102 is still preserved to be evaluated by the playbook (https://github.com/ansible-collections/community.general/pull/6534).
|
||||
|
||||
v6.6.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Bugfix and feature release.
|
||||
This is release 7.0.0 of ``community.general``, released on 2023-05-09.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- apache2_module - add module argument ``warn_mpm_absent`` to control whether warning are raised in some edge cases (https://github.com/ansible-collections/community.general/pull/5793).
|
||||
- apt_rpm - adds ``clean``, ``dist_upgrade`` and ``update_kernel`` parameters for clear caches, complete upgrade system, and upgrade kernel packages (https://github.com/ansible-collections/community.general/pull/5867).
|
||||
- bitwarden lookup plugin - can now retrieve secrets from custom fields (https://github.com/ansible-collections/community.general/pull/5694).
|
||||
- bitwarden lookup plugin - implement filtering results by ``collection_id`` parameter (https://github.com/ansible-collections/community.general/issues/5849).
|
||||
- cmd_runner module utils - ``cmd_runner_fmt.as_bool()`` can now take an extra parameter to format when value is false (https://github.com/ansible-collections/community.general/pull/5647).
|
||||
- cpanm - minor change, use feature from ``ModuleHelper`` (https://github.com/ansible-collections/community.general/pull/6385).
|
||||
- dconf - be forgiving about boolean values: convert them to GVariant booleans automatically (https://github.com/ansible-collections/community.general/pull/6206).
|
||||
- dconf - if ``gi.repository.GLib`` is missing, try to respawn in a Python interpreter that has it (https://github.com/ansible-collections/community.general/pull/6491).
|
||||
- dconf - minor refactoring improving parameters and dependencies validation (https://github.com/ansible-collections/community.general/pull/6336).
|
||||
- dconf - parse GVariants for equality comparison when the Python module ``gi.repository`` is available (https://github.com/ansible-collections/community.general/pull/6049).
|
||||
- deps module utils - add function ``failed()`` providing the ability to check the dependency check result without triggering an exception (https://github.com/ansible-collections/community.general/pull/6383).
|
||||
- dig lookup plugin - Support multiple domains to be queried as indicated in docs (https://github.com/ansible-collections/community.general/pull/6334).
|
||||
- dig lookup plugin - support CAA record type (https://github.com/ansible-collections/community.general/pull/5913).
|
||||
- dnsimple - set custom User-Agent for API requests to DNSimple (https://github.com/ansible-collections/community.general/pull/5927).
|
||||
- dnsimple_info - minor refactor in the code (https://github.com/ansible-collections/community.general/pull/6440).
|
||||
- flatpak_remote - add new boolean option ``enabled``. It controls, whether the remote is enabled or not (https://github.com/ansible-collections/community.general/pull/5926).
|
||||
- gconftool2 - refactor using ``ModuleHelper`` and ``CmdRunner`` (https://github.com/ansible-collections/community.general/pull/5545).
|
||||
- gitlab_group_variable, gitlab_project_variable - refactor function out to module utils (https://github.com/ansible-collections/community.general/pull/6384).
|
||||
- gitlab_project - add ``builds_access_level``, ``container_registry_access_level`` and ``forking_access_level`` options (https://github.com/ansible-collections/community.general/pull/5706).
|
||||
- gitlab_project - add ``releases_access_level``, ``environments_access_level``, ``feature_flags_access_level``, ``infrastructure_access_level``, ``monitor_access_level``, and ``security_and_compliance_access_level`` options (https://github.com/ansible-collections/community.general/pull/5986).
|
||||
- gitlab_project - add new option ``topics`` for adding topics to GitLab projects (https://github.com/ansible-collections/community.general/pull/6278).
|
||||
- gitlab_runner - add new boolean option ``access_level_on_creation``. It controls, whether the value of ``access_level`` is used for runner registration or not. The option ``access_level`` has been ignored on registration so far and was only used on updates (https://github.com/ansible-collections/community.general/issues/5907, https://github.com/ansible-collections/community.general/pull/5908).
|
||||
- gitlab_runner - allow to register group runner (https://github.com/ansible-collections/community.general/pull/3935).
|
||||
- homebrew_cask - allows passing ``--greedy`` option to ``upgrade_all`` (https://github.com/ansible-collections/community.general/pull/6267).
|
||||
- idrac_redfish_command - add ``job_id`` to ``CreateBiosConfigJob`` response (https://github.com/ansible-collections/community.general/issues/5603).
|
||||
- ilo_redfish_utils module utils - change implementation of DNS Server IP and NTP Server IP update (https://github.com/ansible-collections/community.general/pull/5804).
|
||||
- ipa_group - allow to add and remove external users with the ``external_user`` option (https://github.com/ansible-collections/community.general/pull/5897).
|
||||
- ipa_hostgroup - add ``append`` parameter for adding a new hosts to existing hostgroups without changing existing hostgroup members (https://github.com/ansible-collections/community.general/pull/6203).
|
||||
- iptables_state - minor refactoring within the module (https://github.com/ansible-collections/community.general/pull/5844).
|
||||
- java_certs - add more detailed error output when extracting certificate from PKCS12 fails (https://github.com/ansible-collections/community.general/pull/5550).
|
||||
- jc filter plugin - added the ability to use parser plugins (https://github.com/ansible-collections/community.general/pull/6043).
|
||||
- jenkins_plugin - refactor code to module util to fix sanity check (https://github.com/ansible-collections/community.general/pull/5565).
|
||||
- jira - add worklog functionality (https://github.com/ansible-collections/community.general/issues/6209, https://github.com/ansible-collections/community.general/pull/6210).
|
||||
- keycloak_authentication - add flow type option to sub flows to allow the creation of 'form-flow' sub flows like in Keycloak's built-in registration flow (https://github.com/ansible-collections/community.general/pull/6318).
|
||||
- keycloak_group - add new optional module parameter ``parents`` to properly handle keycloak subgroups (https://github.com/ansible-collections/community.general/pull/5814).
|
||||
- keycloak_user_federation - make ``org.keycloak.storage.ldap.mappers.LDAPStorageMapper`` the default value for mappers ``providerType`` (https://github.com/ansible-collections/community.general/pull/5863).
|
||||
- ldap modules - add ``ca_path`` option (https://github.com/ansible-collections/community.general/pull/6185).
|
||||
- ldap modules - add ``xorder_discovery`` option (https://github.com/ansible-collections/community.general/issues/6045, https://github.com/ansible-collections/community.general/pull/6109).
|
||||
- ldap_search - the new ``base64_attributes`` allows to specify which attribute values should be Base64 encoded (https://github.com/ansible-collections/community.general/pull/6473).
|
||||
- lxd_container - add diff and check mode (https://github.com/ansible-collections/community.general/pull/5866).
|
||||
- lxd_project - refactored code out to module utils to clear sanity check (https://github.com/ansible-collections/community.general/pull/5549).
|
||||
- make - add ``command`` return value to the module output (https://github.com/ansible-collections/community.general/pull/6160).
|
||||
- mattermost, rocketchat, slack - replace missing default favicon with docs.ansible.com favicon (https://github.com/ansible-collections/community.general/pull/5928).
|
||||
- mksysb - improved the output of the module in case of errors (https://github.com/ansible-collections/community.general/issues/6263).
|
||||
- modprobe - add ``persistent`` option (https://github.com/ansible-collections/community.general/issues/4028, https://github.com/ansible-collections/community.general/pull/542).
|
||||
- module_helper module utils - updated the imports to make more MH features available at ``plugins/module_utils/module_helper.py`` (https://github.com/ansible-collections/community.general/pull/6464).
|
||||
- mssql_script - allow for ``GO`` statement to be mixed-case for scripts not using strict syntax (https://github.com/ansible-collections/community.general/pull/6457).
|
||||
- mssql_script - handle error condition for empty resultsets to allow for non-returning SQL statements (for example ``UPDATE`` and ``INSERT``) (https://github.com/ansible-collections/community.general/pull/6457).
|
||||
- mssql_script - improve batching logic to allow a wider variety of input scripts. For example, SQL scripts slurped from Windows machines which may contain carriage return (''\r'') characters (https://github.com/ansible-collections/community.general/pull/6457).
|
||||
- nmap inventory plugin - add new option ``open`` for only returning open ports (https://github.com/ansible-collections/community.general/pull/6200).
|
||||
- nmap inventory plugin - add new option ``port`` for port specific scan (https://github.com/ansible-collections/community.general/pull/6165).
|
||||
- nmap inventory plugin - add new options ``udp_scan``, ``icmp_timestamp``, and ``dns_resolve`` for different types of scans (https://github.com/ansible-collections/community.general/pull/5566).
|
||||
- nmap inventory plugin - added environment variables for configure ``address`` and ``exclude`` (https://github.com/ansible-collections/community.general/issues/6351).
|
||||
- nmcli - add ``default`` and ``default-or-eui64`` to the list of valid choices for ``addr_gen_mode6`` parameter (https://github.com/ansible-collections/community.general/pull/5974).
|
||||
- nmcli - add ``macvlan`` connection type (https://github.com/ansible-collections/community.general/pull/6312).
|
||||
- nmcli - add support for ``team.runner-fast-rate`` parameter for ``team`` connections (https://github.com/ansible-collections/community.general/issues/6065).
|
||||
- nmcli - new module option ``slave_type`` added to allow creation of various types of slave devices (https://github.com/ansible-collections/community.general/issues/473, https://github.com/ansible-collections/community.general/pull/6108).
|
||||
- one_vm - add a new ``updateconf`` option which implements the ``one.vm.updateconf`` API call (https://github.com/ansible-collections/community.general/pull/5812).
|
||||
- openbsd_pkg - set ``TERM`` to ``'dumb'`` in ``execute_command()`` to make module less dependant on the ``TERM`` environment variable set on the Ansible controller (https://github.com/ansible-collections/community.general/pull/6149).
|
||||
- opkg - allow installing a package in a certain version (https://github.com/ansible-collections/community.general/pull/5688).
|
||||
- opkg - refactored module to use ``CmdRunner`` for executing ``opkg`` (https://github.com/ansible-collections/community.general/pull/5718).
|
||||
- osx_defaults - include stderr in error messages (https://github.com/ansible-collections/community.general/pull/6011).
|
||||
- pipx - add ``system_site_packages`` parameter to give application access to system-wide packages (https://github.com/ansible-collections/community.general/pull/6308).
|
||||
- pipx - ensure ``include_injected`` parameter works with ``state=upgrade`` and ``state=latest`` (https://github.com/ansible-collections/community.general/pull/6212).
|
||||
- pipx - optional ``install_apps`` parameter added to install applications from injected packages (https://github.com/ansible-collections/community.general/pull/6198).
|
||||
- proxmox - added new module parameter ``tags`` for use with PVE 7+ (https://github.com/ansible-collections/community.general/pull/5714).
|
||||
- proxmox - suppress urllib3 ``InsecureRequestWarnings`` when ``validate_certs`` option is ``false`` (https://github.com/ansible-collections/community.general/pull/5931).
|
||||
- proxmox_kvm - add new ``archive`` parameter. This is needed to create a VM from an archive (backup) (https://github.com/ansible-collections/community.general/pull/6159).
|
||||
- proxmox_kvm - adds ``migrate`` parameter to manage online migrations between hosts (https://github.com/ansible-collections/community.general/pull/6448)
|
||||
- puppet - add new options ``skip_tags`` to exclude certain tagged resources during a puppet agent or apply (https://github.com/ansible-collections/community.general/pull/6293).
|
||||
- puppet - refactored module to use ``CmdRunner`` for executing ``puppet`` (https://github.com/ansible-collections/community.general/pull/5612).
|
||||
- rax_scaling_group - refactored out code to the ``rax`` module utils to clear the sanity check (https://github.com/ansible-collections/community.general/pull/5563).
|
||||
- redfish_command - add ``PerformRequestedOperations`` command to perform any operations necessary to continue the update flow (https://github.com/ansible-collections/community.general/issues/4276).
|
||||
- redfish_command - add ``update_apply_time`` to ``SimpleUpdate`` command (https://github.com/ansible-collections/community.general/issues/3910).
|
||||
- redfish_command - add ``update_status`` to output of ``SimpleUpdate`` command to allow a user monitor the update in progress (https://github.com/ansible-collections/community.general/issues/4276).
|
||||
- redfish_command - adding ``EnableSecureBoot`` functionality (https://github.com/ansible-collections/community.general/pull/5899).
|
||||
- redfish_command - adding ``VerifyBiosAttributes`` functionality (https://github.com/ansible-collections/community.general/pull/5900).
|
||||
- redfish_info - add ``GetUpdateStatus`` command to check the progress of a previous update request (https://github.com/ansible-collections/community.general/issues/4276).
|
||||
- redfish_info - adds commands to retrieve the HPE ThermalConfiguration and FanPercentMinimum settings from iLO (https://github.com/ansible-collections/community.general/pull/6208).
|
||||
- redfish_utils module utils - added PUT (``put_request()``) functionality (https://github.com/ansible-collections/community.general/pull/5490).
|
||||
- redhat_subscription - add a ``server_proxy_scheme`` parameter to configure the scheme for the proxy server (https://github.com/ansible-collections/community.general/pull/5662).
|
||||
- redhat_subscription - adds ``token`` parameter for subscription-manager authentication using Red Hat API token (https://github.com/ansible-collections/community.general/pull/5725).
|
||||
- redhat_subscription - credentials (``username``, ``activationkey``, and so on) are required now only if a system needs to be registered, or ``force_register`` is specified (https://github.com/ansible-collections/community.general/pull/5664).
|
||||
- redhat_subscription - the registration is done using the D-Bus ``rhsm`` service instead of spawning a ``subscription-manager register`` command, if possible; this avoids passing plain-text credentials as arguments to ``subscription-manager register``, which can be seen while that command runs (https://github.com/ansible-collections/community.general/pull/6122).
|
||||
- sefcontext - add support for path substitutions (https://github.com/ansible-collections/community.general/issues/1193).
|
||||
- shutdown - if no shutdown commands are found in the ``search_paths`` then the module will attempt to shutdown the system using ``systemctl shutdown`` (https://github.com/ansible-collections/community.general/issues/4269, https://github.com/ansible-collections/community.general/pull/6171).
|
||||
- slack - add option ``prepend_hash`` which allows to control whether a ``#`` is prepended to ``channel_id``. The current behavior (value ``auto``) is to prepend ``#`` unless some specific prefixes are found. That list of prefixes is incomplete, and there does not seem to exist a documented condition on when exactly ``#`` must not be prepended. We recommend to explicitly set ``prepend_hash=always`` or ``prepend_hash=never`` to avoid any ambiguity (https://github.com/ansible-collections/community.general/pull/5629).
|
||||
- snap - minor refactor when executing module (https://github.com/ansible-collections/community.general/pull/5773).
|
||||
- snap - refactor module to use ``CmdRunner`` to execute external commands (https://github.com/ansible-collections/community.general/pull/6468).
|
||||
- snap_alias - refactor code to module utils (https://github.com/ansible-collections/community.general/pull/6441).
|
||||
- snap_alias - refactored module to use ``CmdRunner`` to execute ``snap`` (https://github.com/ansible-collections/community.general/pull/5486).
|
||||
- spotinst_aws_elastigroup - add ``elements`` attribute when missing in ``list`` parameters (https://github.com/ansible-collections/community.general/pull/5553).
|
||||
- ssh_config - add ``host_key_algorithms`` option (https://github.com/ansible-collections/community.general/pull/5605).
|
||||
- ssh_config - add ``proxyjump`` option (https://github.com/ansible-collections/community.general/pull/5970).
|
||||
- ssh_config - refactor code to module util to fix sanity check (https://github.com/ansible-collections/community.general/pull/5720).
|
||||
- ssh_config - vendored StormSSH's config parser to avoid having to install StormSSH to use the module (https://github.com/ansible-collections/community.general/pull/6117).
|
||||
- sudoers - add ``setenv`` parameters to support passing environment variables via sudo. (https://github.com/ansible-collections/community.general/pull/5883)
|
||||
- sudoers - adds ``host`` parameter for setting hostname restrictions in sudoers rules (https://github.com/ansible-collections/community.general/issues/5702).
|
||||
- terraform - remove state file check condition and error block, because in the native implementation of terraform will not cause errors due to the non-existent file (https://github.com/ansible-collections/community.general/pull/6296).
|
||||
- udm_dns_record - minor refactor to the code (https://github.com/ansible-collections/community.general/pull/6382).
|
||||
- udm_share - added ``elements`` attribute to ``list`` type parameters (https://github.com/ansible-collections/community.general/pull/5557).
|
||||
- udm_user - add ``elements`` attribute when missing in ``list`` parameters (https://github.com/ansible-collections/community.general/pull/5559).
|
||||
- znode module - optional ``use_tls`` parameter added for encrypted communication (https://github.com/ansible-collections/community.general/issues/6154).
|
||||
|
||||
Breaking Changes / Porting Guide
|
||||
--------------------------------
|
||||
|
||||
- If you are not using this collection as part of Ansible, but installed (and/or upgraded) community.general manually, you need to make sure to also install ``community.sap_libs`` if you are using any of the ``sapcar_extract``, ``sap_task_list_execute``, and ``hana_query`` modules.
|
||||
Without that collection installed, the redirects for these modules do not work.
|
||||
- ModuleHelper module utils - when the module sets output variables named ``msg``, ``exception``, ``output``, ``vars``, or ``changed``, the actual output will prefix those names with ``_`` (underscore symbol) only when they clash with output variables generated by ModuleHelper itself, which only occurs when handling exceptions. Please note that this breaking change does not require a new major release since before this release, it was not possible to add such variables to the output `due to a bug <https://github.com/ansible-collections/community.general/pull/5755>`__ (https://github.com/ansible-collections/community.general/pull/5765).
|
||||
- gconftool2 - fix processing of ``gconftool-2`` when ``key`` does not exist, returning ``null`` instead of empty string for both ``value`` and ``previous_value`` return values (https://github.com/ansible-collections/community.general/issues/6028).
|
||||
- gitlab_runner - the default of ``access_level_on_creation`` changed from ``false`` to ``true`` (https://github.com/ansible-collections/community.general/pull/6428).
|
||||
- ldap_search - convert all string-like values to UTF-8 (https://github.com/ansible-collections/community.general/issues/5704, https://github.com/ansible-collections/community.general/pull/6473).
|
||||
- nmcli - the default of the ``hairpin`` option changed from ``true`` to ``false`` (https://github.com/ansible-collections/community.general/pull/6428).
|
||||
- proxmox - the default of the ``unprivileged`` option changed from ``false`` to ``true`` (https://github.com/ansible-collections/community.general/pull/6428).
|
||||
|
||||
Deprecated Features
|
||||
-------------------
|
||||
|
||||
- ModuleHelper module_utils - ``deps`` mixin for MH classes deprecated in favour of using the ``deps`` module_utils (https://github.com/ansible-collections/community.general/pull/6465).
|
||||
- consul - deprecate using parameters unused for ``state=absent`` (https://github.com/ansible-collections/community.general/pull/5772).
|
||||
- gitlab_runner - the default of the new option ``access_level_on_creation`` will change from ``false`` to ``true`` in community.general 7.0.0. This will cause ``access_level`` to be used during runner registration as well, and not only during updates (https://github.com/ansible-collections/community.general/pull/5908).
|
||||
- gitlab_runner - the option ``access_level`` will lose its default value in community.general 8.0.0. From that version on, you have set this option to ``ref_protected`` explicitly, if you want to have a protected runner (https://github.com/ansible-collections/community.general/issues/5925).
|
||||
- manageiq_policies - deprecate ``state=list`` in favour of using ``community.general.manageiq_policies_info`` (https://github.com/ansible-collections/community.general/pull/5721).
|
||||
- manageiq_tags - deprecate ``state=list`` in favour of using ``community.general.manageiq_tags_info`` (https://github.com/ansible-collections/community.general/pull/5727).
|
||||
- rax - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax module utils - module utils code relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_cbs - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_cbs_attachments - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_cdb - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_cdb_database - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_cdb_user - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_clb - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_clb_nodes - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_clb_ssl - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_dns - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_dns_record - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_facts - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_files - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_files_objects - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_identity - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_keypair - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_meta - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_mon_alarm - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_mon_check - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_mon_entity - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_mon_notification - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_mon_notification_plan - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_network - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_queue - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_scaling_group - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rax_scaling_policy - module relies on deprecated library ``pyrax`` and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5752).
|
||||
- rhn_channel, rhn_register - RHN hosted at redhat.com was discontinued years
|
||||
ago, and Spacewalk 5 (which uses RHN) is EOL since 2020, May 31st;
|
||||
while these modules could work on Uyuni / SUSE Manager (fork of Spacewalk 5),
|
||||
we have not heard about anyone using them in those setups. Hence, these
|
||||
modules are deprecated, and will be removed in community.general 10.0.0
|
||||
in case there are no reports about being still useful, and potentially
|
||||
noone that steps up to maintain them
|
||||
(https://github.com/ansible-collections/community.general/pull/6493).
|
||||
|
||||
Removed Features (previously deprecated)
|
||||
----------------------------------------
|
||||
|
||||
- All ``sap`` modules have been removed from this collection.
|
||||
They have been migrated to the `community.sap_libs <https://galaxy.ansible.com/community/sap_libs>`_ collection.
|
||||
Redirections have been provided.
|
||||
Following modules are affected:
|
||||
- sapcar_extract
|
||||
- sap_task_list_execute
|
||||
- hana_query
|
||||
- cmd_runner module utils - the ``fmt`` alias of ``cmd_runner_fmt`` has been removed. Use ``cmd_runner_fmt`` instead (https://github.com/ansible-collections/community.general/pull/6428).
|
||||
- newrelic_deployment - the ``appname`` and ``environment`` options have been removed. They did not do anything (https://github.com/ansible-collections/community.general/pull/6428).
|
||||
- puppet - the alias ``show-diff`` of the ``show_diff`` option has been removed. Use ``show_diff`` instead (https://github.com/ansible-collections/community.general/pull/6428).
|
||||
- xfconf - generating facts was deprecated in community.general 3.0.0, however three factoids, ``property``, ``channel`` and ``value`` continued to be generated by mistake. This behaviour has been removed and ``xfconf`` generate no facts whatsoever (https://github.com/ansible-collections/community.general/pull/5502).
|
||||
- xfconf - generating facts was deprecated in community.general 3.0.0, however two factoids, ``previous_value`` and ``type`` continued to be generated by mistake. This behaviour has been removed and ``xfconf`` generate no facts whatsoever (https://github.com/ansible-collections/community.general/pull/5502).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- ModuleHelper - fix bug when adjusting the name of reserved output variables (https://github.com/ansible-collections/community.general/pull/5755).
|
||||
- alternatives - support subcommands on Fedora 37, which uses ``follower`` instead of ``slave`` (https://github.com/ansible-collections/community.general/pull/5794).
|
||||
- ansible_galaxy_install - set default to raise exception if command's return code is different from zero (https://github.com/ansible-collections/community.general/pull/5680).
|
||||
- ansible_galaxy_install - try ``C.UTF-8`` and then fall back to ``en_US.UTF-8`` before failing (https://github.com/ansible-collections/community.general/pull/5680).
|
||||
- archive - avoid deprecated exception class on Python 3 (https://github.com/ansible-collections/community.general/pull/6180).
|
||||
- archive - reduce RAM usage by generating CRC32 checksum over chunks (https://github.com/ansible-collections/community.general/pull/6274).
|
||||
- bitwarden lookup plugin - clarify what to do, if the bitwarden vault is not unlocked (https://github.com/ansible-collections/community.general/pull/5811).
|
||||
- cartesian and flattened lookup plugins - adjust to parameter deprecation in ansible-core 2.14's ``listify_lookup_plugin_terms`` helper function (https://github.com/ansible-collections/community.general/pull/6074).
|
||||
- chroot connection plugin - add ``inventory_hostname`` to vars under ``remote_addr``. This is needed for compatibility with ansible-core 2.13 (https://github.com/ansible-collections/community.general/pull/5570).
|
||||
- cloudflare_dns - fixed the idempotency for SRV DNS records (https://github.com/ansible-collections/community.general/pull/5972).
|
||||
- cloudflare_dns - fixed the possiblity of setting a root-level SRV DNS record (https://github.com/ansible-collections/community.general/pull/5972).
|
||||
- cmd_runner module utils - fixed bug when handling default cases in ``cmd_runner_fmt.as_map()`` (https://github.com/ansible-collections/community.general/pull/5538).
|
||||
- cmd_runner module utils - formatting arguments ``cmd_runner_fmt.as_fixed()`` was expecting an non-existing argument (https://github.com/ansible-collections/community.general/pull/5538).
|
||||
- dependent lookup plugin - avoid warning on deprecated parameter for ``Templar.template()`` (https://github.com/ansible-collections/community.general/pull/5543).
|
||||
- deps module utils - do not fail when dependency cannot be found (https://github.com/ansible-collections/community.general/pull/6479).
|
||||
- dig lookup plugin - correctly handle DNSKEY record type's ``algorithm`` field (https://github.com/ansible-collections/community.general/pull/5914).
|
||||
- flatpak - fixes idempotency detection issues. In some cases the module could fail to properly detect already existing Flatpaks because of a parameter witch only checks the installed apps (https://github.com/ansible-collections/community.general/pull/6289).
|
||||
- gconftool2 - fix ``changed`` result always being ``true`` (https://github.com/ansible-collections/community.general/issues/6028).
|
||||
- gconftool2 - remove requirement of parameter ``value`` when ``state=absent`` (https://github.com/ansible-collections/community.general/issues/6028).
|
||||
- gem - fix force parameter not being passed to gem command when uninstalling (https://github.com/ansible-collections/community.general/pull/5822).
|
||||
- gem - fix hang due to interactive prompt for confirmation on specific version uninstall (https://github.com/ansible-collections/community.general/pull/5751).
|
||||
- github_webhook - fix always changed state when no secret is provided (https://github.com/ansible-collections/community.general/pull/5994).
|
||||
- gitlab_deploy_key - also update ``title`` and not just ``can_push`` (https://github.com/ansible-collections/community.general/pull/5888).
|
||||
- gitlab_group_variables - fix dropping variables accidentally when GitLab introduced new properties (https://github.com/ansible-collections/community.general/pull/5667).
|
||||
- gitlab_project_variables - fix dropping variables accidentally when GitLab introduced new properties (https://github.com/ansible-collections/community.general/pull/5667).
|
||||
- gitlab_runner - fix ``KeyError`` on runner creation and update (https://github.com/ansible-collections/community.general/issues/6112).
|
||||
- icinga2_host - fix the data structure sent to Icinga to make use of host templates and template vars (https://github.com/ansible-collections/community.general/pull/6286).
|
||||
- idrac_redfish_command - allow user to specify ``resource_id`` for ``CreateBiosConfigJob`` to specify an exact manager (https://github.com/ansible-collections/community.general/issues/2090).
|
||||
- influxdb_user - fix running in check mode when the user does not exist yet (https://github.com/ansible-collections/community.general/pull/6111).
|
||||
- ini_file - make ``section`` parameter not required so it is possible to pass ``null`` as a value. This only was possible in the past due to a bug in ansible-core that now has been fixed (https://github.com/ansible-collections/community.general/pull/6404).
|
||||
- interfaces_file - fix reading options in lines not starting with a space (https://github.com/ansible-collections/community.general/issues/6120).
|
||||
- jail connection plugin - add ``inventory_hostname`` to vars under ``remote_addr``. This is needed for compatibility with ansible-core 2.13 (https://github.com/ansible-collections/community.general/pull/6118).
|
||||
- jenkins_build - fix the logical flaw when deleting a Jenkins build (https://github.com/ansible-collections/community.general/pull/5514).
|
||||
- jenkins_plugin - fix error due to undefined variable when updates file is not downloaded (https://github.com/ansible-collections/community.general/pull/6100).
|
||||
- keycloak - improve error messages (https://github.com/ansible-collections/community.general/pull/6318).
|
||||
- keycloak_client - fix accidental replacement of value for attribute ``saml.signing.private.key`` with ``no_log`` in wrong contexts (https://github.com/ansible-collections/community.general/pull/5934).
|
||||
- keycloak_client_rolemapping - calculate ``proposed`` and ``after`` return values properly (https://github.com/ansible-collections/community.general/pull/5619).
|
||||
- keycloak_client_rolemapping - remove only listed mappings with ``state=absent`` (https://github.com/ansible-collections/community.general/pull/5619).
|
||||
- keycloak_user_federation - fixes federation creation issue. When a new federation was created and at the same time a default / standard mapper was also changed / updated the creation process failed as a bad None set variable led to a bad malformed url request (https://github.com/ansible-collections/community.general/pull/5750).
|
||||
- keycloak_user_federation - fixes idempotency detection issues. In some cases the module could fail to properly detect already existing user federations because of a buggy seemingly superflous extra query parameter (https://github.com/ansible-collections/community.general/pull/5732).
|
||||
- loganalytics callback plugin - adjust type of callback to ``notification``, it was incorrectly classified as ``aggregate`` before (https://github.com/ansible-collections/community.general/pull/5761).
|
||||
- logdna callback plugin - adjust type of callback to ``notification``, it was incorrectly classified as ``aggregate`` before (https://github.com/ansible-collections/community.general/pull/5761).
|
||||
- logstash callback plugin - adjust type of callback to ``notification``, it was incorrectly classified as ``aggregate`` before (https://github.com/ansible-collections/community.general/pull/5761).
|
||||
- lxc_container - fix the arguments of the lxc command which broke the creation and cloning of containers (https://github.com/ansible-collections/community.general/issues/5578).
|
||||
- lxd_* modules, lxd inventory plugin - fix TLS/SSL certificate validation problems by using the correct purpose when creating the TLS context (https://github.com/ansible-collections/community.general/issues/5616, https://github.com/ansible-collections/community.general/pull/6034).
|
||||
- memset - fix memset urlerror handling (https://github.com/ansible-collections/community.general/pull/6114).
|
||||
- nmcli - fix change handling of values specified as an integer 0 (https://github.com/ansible-collections/community.general/pull/5431).
|
||||
- nmcli - fix failure to handle WIFI settings when connection type not specified (https://github.com/ansible-collections/community.general/pull/5431).
|
||||
- nmcli - fix improper detection of changes to ``wifi.wake-on-wlan`` (https://github.com/ansible-collections/community.general/pull/5431).
|
||||
- nmcli - fixed idempotency issue for bridge connections. Module forced default value of ``bridge.priority`` to nmcli if not set; if ``bridge.stp`` is disabled nmcli ignores it and keep default (https://github.com/ansible-collections/community.general/issues/3216, https://github.com/ansible-collections/community.general/issues/4683).
|
||||
- nmcli - fixed idempotency issue when module params is set to ``may_fail4=false`` and ``method4=disabled``; in this case nmcli ignores change and keeps their own default value ``yes`` (https://github.com/ansible-collections/community.general/pull/6106).
|
||||
- nmcli - implemented changing mtu value on vlan interfaces (https://github.com/ansible-collections/community.general/issues/4387).
|
||||
- nmcli - order is significant for lists of addresses (https://github.com/ansible-collections/community.general/pull/6048).
|
||||
- nsupdate - fix zone lookup. The SOA record for an existing zone is returned as an answer RR and not as an authority RR (https://github.com/ansible-collections/community.general/issues/5817, https://github.com/ansible-collections/community.general/pull/5818).
|
||||
- one_vm - avoid splitting labels that are ``None`` (https://github.com/ansible-collections/community.general/pull/5489).
|
||||
- one_vm - fix syntax error when creating VMs with a more complex template (https://github.com/ansible-collections/community.general/issues/6225).
|
||||
- onepassword lookup plugin - Changed to ignore errors from "op account get" calls. Previously, errors would prevent auto-signin code from executing (https://github.com/ansible-collections/community.general/pull/5942).
|
||||
- onepassword_raw - add missing parameter to plugin documentation (https://github.com/ansible-collections/community.general/issues/5506).
|
||||
- opkg - fix issue that ``force=reinstall`` would not reinstall an existing package (https://github.com/ansible-collections/community.general/pull/5705).
|
||||
- opkg - fixes bug when using ``update_cache=true`` (https://github.com/ansible-collections/community.general/issues/6004).
|
||||
- passwordstore lookup plugin - make compatible with ansible-core 2.16 (https://github.com/ansible-collections/community.general/pull/6447).
|
||||
- pipx - fixed handling of ``install_deps=true`` with ``state=latest`` and ``state=upgrade`` (https://github.com/ansible-collections/community.general/pull/6303).
|
||||
- portage - update the logic for generating the emerge command arguments to ensure that ``withbdeps: false`` results in a passing an ``n`` argument with the ``--with-bdeps`` emerge flag (https://github.com/ansible-collections/community.general/issues/6451, https://github.com/ansible-collections/community.general/pull/6456).
|
||||
- proxmox inventory plugin - fix bug while templating when using templates for the ``url``, ``user``, ``password``, ``token_id``, or ``token_secret`` options (https://github.com/ansible-collections/community.general/pull/5640).
|
||||
- proxmox inventory plugin - handle tags delimited by semicolon instead of comma, which happens from Proxmox 7.3 on (https://github.com/ansible-collections/community.general/pull/5602).
|
||||
- proxmox_disk - avoid duplicate ``vmid`` reference (https://github.com/ansible-collections/community.general/issues/5492, https://github.com/ansible-collections/community.general/pull/5493).
|
||||
- proxmox_disk - fixed issue with read timeout on import action (https://github.com/ansible-collections/community.general/pull/5803).
|
||||
- proxmox_disk - fixed possible issues with redundant ``vmid`` parameter (https://github.com/ansible-collections/community.general/issues/5492, https://github.com/ansible-collections/community.general/pull/5672).
|
||||
- proxmox_nic - fixed possible issues with redundant ``vmid`` parameter (https://github.com/ansible-collections/community.general/issues/5492, https://github.com/ansible-collections/community.general/pull/5672).
|
||||
- puppet - handling ``noop`` parameter was not working at all, now it is has been fixed (https://github.com/ansible-collections/community.general/issues/6452, https://github.com/ansible-collections/community.general/issues/6458).
|
||||
- redfish_utils - removed basic auth HTTP header when performing a GET on the service root resource and when performing a POST to the session collection (https://github.com/ansible-collections/community.general/issues/5886).
|
||||
- redhat_subscription - do not ignore ``consumer_name`` and other variables if ``activationkey`` is specified (https://github.com/ansible-collections/community.general/issues/3486, https://github.com/ansible-collections/community.general/pull/5627).
|
||||
- redhat_subscription - do not pass arguments to ``subscription-manager register`` for things already configured; now a specified ``rhsm_baseurl`` is properly set for subscription-manager (https://github.com/ansible-collections/community.general/pull/5583).
|
||||
- redhat_subscription - do not use D-Bus for registering when ``environment`` is specified, so it possible to specify again the environment names for registering, as the D-Bus APIs work only with IDs (https://github.com/ansible-collections/community.general/pull/6319).
|
||||
- redhat_subscription - try to unregister only when already registered when ``force_register`` is specified (https://github.com/ansible-collections/community.general/issues/6258, https://github.com/ansible-collections/community.general/pull/6259).
|
||||
- redhat_subscription - use the right D-Bus options for environments when registering a CentOS Stream 8 system and using ``environment`` (https://github.com/ansible-collections/community.general/pull/6275).
|
||||
- redhat_subscription, rhsm_release, rhsm_repository - cleanly fail when not running as root, rather than hanging on an interactive ``console-helper`` prompt; they all interact with ``subscription-manager``, which already requires to be run as root (https://github.com/ansible-collections/community.general/issues/734, https://github.com/ansible-collections/community.general/pull/6211).
|
||||
- rhsm_release - make ``release`` parameter not required so it is possible to pass ``null`` as a value. This only was possible in the past due to a bug in ansible-core that now has been fixed (https://github.com/ansible-collections/community.general/pull/6401).
|
||||
- rundeck module utils - fix errors caused by the API empty responses (https://github.com/ansible-collections/community.general/pull/6300)
|
||||
- rundeck_acl_policy - fix ``TypeError - byte indices must be integers or slices, not str`` error caused by empty API response. Update the module to use ``module_utils.rundeck`` functions (https://github.com/ansible-collections/community.general/pull/5887, https://github.com/ansible-collections/community.general/pull/6300).
|
||||
- rundeck_project - update the module to use ``module_utils.rundeck`` functions (https://github.com/ansible-collections/community.general/issues/5742) (https://github.com/ansible-collections/community.general/pull/6300)
|
||||
- snap_alias - module would only recognize snap names containing letter, numbers or the underscore character, failing to identify valid snap names such as ``lxd.lxc`` (https://github.com/ansible-collections/community.general/pull/6361).
|
||||
|
||||
New Modules
|
||||
-----------
|
||||
|
||||
- btrfs_info - Query btrfs filesystem info
|
||||
- btrfs_subvolume - Manage btrfs subvolumes
|
||||
- ilo_redfish_command - Manages Out-Of-Band controllers using Redfish APIs
|
||||
- keycloak_authz_authorization_scope - Allows administration of Keycloak client authorization scopes via Keycloak API
|
||||
- keycloak_clientscope_type - Set the type of aclientscope in realm or client via Keycloak API
|
||||
|
||||
v6.5.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Feature and bugfix release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- apt_rpm - adds ``clean``, ``dist_upgrade`` and ``update_kernel`` parameters for clear caches, complete upgrade system, and upgrade kernel packages (https://github.com/ansible-collections/community.general/pull/5867).
|
||||
- dconf - parse GVariants for equality comparison when the Python module ``gi.repository`` is available (https://github.com/ansible-collections/community.general/pull/6049).
|
||||
- gitlab_runner - allow to register group runner (https://github.com/ansible-collections/community.general/pull/3935).
|
||||
- jira - add worklog functionality (https://github.com/ansible-collections/community.general/issues/6209, https://github.com/ansible-collections/community.general/pull/6210).
|
||||
- ldap modules - add ``ca_path`` option (https://github.com/ansible-collections/community.general/pull/6185).
|
||||
- make - add ``command`` return value to the module output (https://github.com/ansible-collections/community.general/pull/6160).
|
||||
- nmap inventory plugin - add new option ``open`` for only returning open ports (https://github.com/ansible-collections/community.general/pull/6200).
|
||||
- nmap inventory plugin - add new option ``port`` for port specific scan (https://github.com/ansible-collections/community.general/pull/6165).
|
||||
- nmcli - add ``default`` and ``default-or-eui64`` to the list of valid choices for ``addr_gen_mode6`` parameter (https://github.com/ansible-collections/community.general/pull/5974).
|
||||
- nmcli - add support for ``team.runner-fast-rate`` parameter for ``team`` connections (https://github.com/ansible-collections/community.general/issues/6065).
|
||||
- openbsd_pkg - set ``TERM`` to ``'dumb'`` in ``execute_command()`` to make module less dependant on the ``TERM`` environment variable set on the Ansible controller (https://github.com/ansible-collections/community.general/pull/6149).
|
||||
- pipx - optional ``install_apps`` parameter added to install applications from injected packages (https://github.com/ansible-collections/community.general/pull/6198).
|
||||
- proxmox_kvm - add new ``archive`` parameter. This is needed to create a VM from an archive (backup) (https://github.com/ansible-collections/community.general/pull/6159).
|
||||
- redfish_info - adds commands to retrieve the HPE ThermalConfiguration and FanPercentMinimum settings from iLO (https://github.com/ansible-collections/community.general/pull/6208).
|
||||
- redhat_subscription - credentials (``username``, ``activationkey``, and so on) are required now only if a system needs to be registered, or ``force_register`` is specified (https://github.com/ansible-collections/community.general/pull/5664).
|
||||
- redhat_subscription - the registration is done using the D-Bus ``rhsm`` service instead of spawning a ``subscription-manager register`` command, if possible; this avoids passing plain-text credentials as arguments to ``subscription-manager register``, which can be seen while that command runs (https://github.com/ansible-collections/community.general/pull/6122).
|
||||
- ssh_config - add ``proxyjump`` option (https://github.com/ansible-collections/community.general/pull/5970).
|
||||
- ssh_config - vendored StormSSH's config parser to avoid having to install StormSSH to use the module (https://github.com/ansible-collections/community.general/pull/6117).
|
||||
- znode module - optional ``use_tls`` parameter added for encrypted communication (https://github.com/ansible-collections/community.general/issues/6154).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- archive - avoid deprecated exception class on Python 3 (https://github.com/ansible-collections/community.general/pull/6180).
|
||||
- gitlab_runner - fix ``KeyError`` on runner creation and update (https://github.com/ansible-collections/community.general/issues/6112).
|
||||
- influxdb_user - fix running in check mode when the user does not exist yet (https://github.com/ansible-collections/community.general/pull/6111).
|
||||
- interfaces_file - fix reading options in lines not starting with a space (https://github.com/ansible-collections/community.general/issues/6120).
|
||||
- jail connection plugin - add ``inventory_hostname`` to vars under ``remote_addr``. This is needed for compatibility with ansible-core 2.13 (https://github.com/ansible-collections/community.general/pull/6118).
|
||||
- memset - fix memset urlerror handling (https://github.com/ansible-collections/community.general/pull/6114).
|
||||
- nmcli - fixed idempotency issue for bridge connections. Module forced default value of ``bridge.priority`` to nmcli if not set; if ``bridge.stp`` is disabled nmcli ignores it and keep default (https://github.com/ansible-collections/community.general/issues/3216, https://github.com/ansible-collections/community.general/issues/4683).
|
||||
- nmcli - fixed idempotency issue when module params is set to ``may_fail4=false`` and ``method4=disabled``; in this case nmcli ignores change and keeps their own default value ``yes`` (https://github.com/ansible-collections/community.general/pull/6106).
|
||||
- nmcli - implemented changing mtu value on vlan interfaces (https://github.com/ansible-collections/community.general/issues/4387).
|
||||
- opkg - fixes bug when using ``update_cache=true`` (https://github.com/ansible-collections/community.general/issues/6004).
|
||||
- redhat_subscription, rhsm_release, rhsm_repository - cleanly fail when not running as root, rather than hanging on an interactive ``console-helper`` prompt; they all interact with ``subscription-manager``, which already requires to be run as root (https://github.com/ansible-collections/community.general/issues/734, https://github.com/ansible-collections/community.general/pull/6211).
|
||||
- splunk callback plugin - adjust type of callback to ``notification``, it was incorrectly classified as ``aggregate`` before (https://github.com/ansible-collections/community.general/pull/5761).
|
||||
- sumologic callback plugin - adjust type of callback to ``notification``, it was incorrectly classified as ``aggregate`` before (https://github.com/ansible-collections/community.general/pull/5761).
|
||||
- syslog_json callback plugin - adjust type of callback to ``notification``, it was incorrectly classified as ``aggregate`` before (https://github.com/ansible-collections/community.general/pull/5761).
|
||||
- terraform - fix ``current`` workspace never getting appended to the ``all`` key in the ``workspace_ctf`` object (https://github.com/ansible-collections/community.general/pull/5735).
|
||||
- terraform - fix ``terraform init`` failure when there are multiple workspaces on the remote backend and when ``default`` workspace is missing by setting ``TF_WORKSPACE`` environmental variable to the value of ``workspace`` when used (https://github.com/ansible-collections/community.general/pull/5735).
|
||||
- terraform - fix broken ``warn()`` call (https://github.com/ansible-collections/community.general/pull/6497).
|
||||
- terraform and timezone - slight refactoring to avoid linter reporting potentially undefined variables (https://github.com/ansible-collections/community.general/pull/5933).
|
||||
- terraform module - disable ANSI escape sequences during validation phase (https://github.com/ansible-collections/community.general/pull/5843).
|
||||
- tss lookup plugin - allow to download secret attachments. Previously, we could not download secret attachments but now use ``fetch_attachments`` and ``file_download_path`` variables to download attachments (https://github.com/ansible-collections/community.general/issues/6224).
|
||||
- unixy callback plugin - fix plugin to work with ansible-core 2.14 by using Ansible's configuration manager for handling options (https://github.com/ansible-collections/community.general/issues/5600).
|
||||
- unixy callback plugin - fix typo introduced when updating to use Ansible's configuration manager for handling options (https://github.com/ansible-collections/community.general/issues/5600).
|
||||
- various plugins and modules - remove unnecessary imports (https://github.com/ansible-collections/community.general/pull/5940).
|
||||
- vdo - now uses ``yaml.safe_load()`` to parse command output instead of the deprecated ``yaml.load()`` which is potentially unsafe. Using ``yaml.load()`` without explicitely setting a ``Loader=`` is also an error in pyYAML 6.0 (https://github.com/ansible-collections/community.general/pull/5632).
|
||||
- vmadm - fix for index out of range error in ``get_vm_uuid`` (https://github.com/ansible-collections/community.general/pull/5628).
|
||||
- xenorchestra inventory plugin - fix failure to receive objects from server due to not checking the id of the response (https://github.com/ansible-collections/community.general/pull/6227).
|
||||
- xfs_quota - in case of a project quota, the call to ``xfs_quota`` did not initialize/reset the project (https://github.com/ansible-collections/community.general/issues/5143).
|
||||
- xml - fixed a bug where empty ``children`` list would not be set (https://github.com/ansible-collections/community.general/pull/5808).
|
||||
- yarn - fix ``global=true`` to check for the configured global folder instead of assuming the default (https://github.com/ansible-collections/community.general/pull/5829)
|
||||
- yarn - fix ``global=true`` to not fail when `executable` wasn't specified (https://github.com/ansible-collections/community.general/pull/6132)
|
||||
- yarn - fix ``state=absent`` not working with ``global=true`` when the package does not include a binary (https://github.com/ansible-collections/community.general/pull/5829)
|
||||
- yarn - fix ``state=latest`` not working with ``global=true`` (https://github.com/ansible-collections/community.general/issues/5712).
|
||||
- yarn - fixes bug where yarn module tasks would fail when warnings were emitted from Yarn. The ``yarn.list`` method was not filtering out warnings (https://github.com/ansible-collections/community.general/issues/6127).
|
||||
- zfs_delegate_admin - zfs allow output can now be parsed when uids/gids are not known to the host system (https://github.com/ansible-collections/community.general/pull/5943).
|
||||
- zypper - make package managing work on readonly filesystem of openSUSE MicroOS (https://github.com/ansible-collections/community.general/pull/5615).
|
||||
|
||||
New Plugins
|
||||
-----------
|
||||
@@ -169,537 +315,15 @@ Lookup
|
||||
New Modules
|
||||
-----------
|
||||
|
||||
- kdeconfig - Manage KDE configuration files
|
||||
|
||||
v6.4.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular feature and bugfix release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- dnsimple - set custom User-Agent for API requests to DNSimple (https://github.com/ansible-collections/community.general/pull/5927).
|
||||
- flatpak_remote - add new boolean option ``enabled``. It controls, whether the remote is enabled or not (https://github.com/ansible-collections/community.general/pull/5926).
|
||||
- gitlab_project - add ``releases_access_level``, ``environments_access_level``, ``feature_flags_access_level``, ``infrastructure_access_level``, ``monitor_access_level``, and ``security_and_compliance_access_level`` options (https://github.com/ansible-collections/community.general/pull/5986).
|
||||
- jc filter plugin - added the ability to use parser plugins (https://github.com/ansible-collections/community.general/pull/6043).
|
||||
- keycloak_group - add new optional module parameter ``parents`` to properly handle keycloak subgroups (https://github.com/ansible-collections/community.general/pull/5814).
|
||||
- keycloak_user_federation - make ``org.keycloak.storage.ldap.mappers.LDAPStorageMapper`` the default value for mappers ``providerType`` (https://github.com/ansible-collections/community.general/pull/5863).
|
||||
- ldap modules - add ``xorder_discovery`` option (https://github.com/ansible-collections/community.general/issues/6045, https://github.com/ansible-collections/community.general/pull/6109).
|
||||
- lxd_container - add diff and check mode (https://github.com/ansible-collections/community.general/pull/5866).
|
||||
- mattermost, rocketchat, slack - replace missing default favicon with docs.ansible.com favicon (https://github.com/ansible-collections/community.general/pull/5928).
|
||||
- modprobe - add ``persistent`` option (https://github.com/ansible-collections/community.general/issues/4028, https://github.com/ansible-collections/community.general/pull/542).
|
||||
- osx_defaults - include stderr in error messages (https://github.com/ansible-collections/community.general/pull/6011).
|
||||
- proxmox - suppress urllib3 ``InsecureRequestWarnings`` when ``validate_certs`` option is ``false`` (https://github.com/ansible-collections/community.general/pull/5931).
|
||||
- redfish_command - adding ``EnableSecureBoot`` functionality (https://github.com/ansible-collections/community.general/pull/5899).
|
||||
- redfish_command - adding ``VerifyBiosAttributes`` functionality (https://github.com/ansible-collections/community.general/pull/5900).
|
||||
- sefcontext - add support for path substitutions (https://github.com/ansible-collections/community.general/issues/1193).
|
||||
|
||||
Deprecated Features
|
||||
-------------------
|
||||
|
||||
- gitlab_runner - the option ``access_level`` will lose its default value in community.general 8.0.0. From that version on, you have set this option to ``ref_protected`` explicitly, if you want to have a protected runner (https://github.com/ansible-collections/community.general/issues/5925).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- cartesian and flattened lookup plugins - adjust to parameter deprecation in ansible-core 2.14's ``listify_lookup_plugin_terms`` helper function (https://github.com/ansible-collections/community.general/pull/6074).
|
||||
- cloudflare_dns - fixed the idempotency for SRV DNS records (https://github.com/ansible-collections/community.general/pull/5972).
|
||||
- cloudflare_dns - fixed the possiblity of setting a root-level SRV DNS record (https://github.com/ansible-collections/community.general/pull/5972).
|
||||
- github_webhook - fix always changed state when no secret is provided (https://github.com/ansible-collections/community.general/pull/5994).
|
||||
- jenkins_plugin - fix error due to undefined variable when updates file is not downloaded (https://github.com/ansible-collections/community.general/pull/6100).
|
||||
- keycloak_client - fix accidental replacement of value for attribute ``saml.signing.private.key`` with ``no_log`` in wrong contexts (https://github.com/ansible-collections/community.general/pull/5934).
|
||||
- lxd_* modules, lxd inventory plugin - fix TLS/SSL certificate validation problems by using the correct purpose when creating the TLS context (https://github.com/ansible-collections/community.general/issues/5616, https://github.com/ansible-collections/community.general/pull/6034).
|
||||
- nmcli - fix change handling of values specified as an integer 0 (https://github.com/ansible-collections/community.general/pull/5431).
|
||||
- nmcli - fix failure to handle WIFI settings when connection type not specified (https://github.com/ansible-collections/community.general/pull/5431).
|
||||
- nmcli - fix improper detection of changes to ``wifi.wake-on-wlan`` (https://github.com/ansible-collections/community.general/pull/5431).
|
||||
- nmcli - order is significant for lists of addresses (https://github.com/ansible-collections/community.general/pull/6048).
|
||||
- onepassword lookup plugin - Changed to ignore errors from "op account get" calls. Previously, errors would prevent auto-signin code from executing (https://github.com/ansible-collections/community.general/pull/5942).
|
||||
- terraform and timezone - slight refactoring to avoid linter reporting potentially undefined variables (https://github.com/ansible-collections/community.general/pull/5933).
|
||||
- various plugins and modules - remove unnecessary imports (https://github.com/ansible-collections/community.general/pull/5940).
|
||||
- yarn - fix ``global=true`` to check for the configured global folder instead of assuming the default (https://github.com/ansible-collections/community.general/pull/5829)
|
||||
- yarn - fix ``state=absent`` not working with ``global=true`` when the package does not include a binary (https://github.com/ansible-collections/community.general/pull/5829)
|
||||
- yarn - fix ``state=latest`` not working with ``global=true`` (https://github.com/ansible-collections/community.general/issues/5712).
|
||||
- zfs_delegate_admin - zfs allow output can now be parsed when uids/gids are not known to the host system (https://github.com/ansible-collections/community.general/pull/5943).
|
||||
- zypper - make package managing work on readonly filesystem of openSUSE MicroOS (https://github.com/ansible-collections/community.general/pull/5615).
|
||||
|
||||
v6.3.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix and feature release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- apache2_module - add module argument ``warn_mpm_absent`` to control whether warning are raised in some edge cases (https://github.com/ansible-collections/community.general/pull/5793).
|
||||
- bitwarden lookup plugin - can now retrieve secrets from custom fields (https://github.com/ansible-collections/community.general/pull/5694).
|
||||
- bitwarden lookup plugin - implement filtering results by ``collection_id`` parameter (https://github.com/ansible-collections/community.general/issues/5849).
|
||||
- dig lookup plugin - support CAA record type (https://github.com/ansible-collections/community.general/pull/5913).
|
||||
- gitlab_project - add ``builds_access_level``, ``container_registry_access_level`` and ``forking_access_level`` options (https://github.com/ansible-collections/community.general/pull/5706).
|
||||
- gitlab_runner - add new boolean option ``access_level_on_creation``. It controls, whether the value of ``access_level`` is used for runner registration or not. The option ``access_level`` has been ignored on registration so far and was only used on updates (https://github.com/ansible-collections/community.general/issues/5907, https://github.com/ansible-collections/community.general/pull/5908).
|
||||
- ilo_redfish_utils module utils - change implementation of DNS Server IP and NTP Server IP update (https://github.com/ansible-collections/community.general/pull/5804).
|
||||
- ipa_group - allow to add and remove external users with the ``external_user`` option (https://github.com/ansible-collections/community.general/pull/5897).
|
||||
- iptables_state - minor refactoring within the module (https://github.com/ansible-collections/community.general/pull/5844).
|
||||
- one_vm - add a new ``updateconf`` option which implements the ``one.vm.updateconf`` API call (https://github.com/ansible-collections/community.general/pull/5812).
|
||||
- opkg - refactored module to use ``CmdRunner`` for executing ``opkg`` (https://github.com/ansible-collections/community.general/pull/5718).
|
||||
- redhat_subscription - adds ``token`` parameter for subscription-manager authentication using Red Hat API token (https://github.com/ansible-collections/community.general/pull/5725).
|
||||
- snap - minor refactor when executing module (https://github.com/ansible-collections/community.general/pull/5773).
|
||||
- snap_alias - refactored module to use ``CmdRunner`` to execute ``snap`` (https://github.com/ansible-collections/community.general/pull/5486).
|
||||
- sudoers - add ``setenv`` parameters to support passing environment variables via sudo. (https://github.com/ansible-collections/community.general/pull/5883)
|
||||
|
||||
Breaking Changes / Porting Guide
|
||||
--------------------------------
|
||||
|
||||
- ModuleHelper module utils - when the module sets output variables named ``msg``, ``exception``, ``output``, ``vars``, or ``changed``, the actual output will prefix those names with ``_`` (underscore symbol) only when they clash with output variables generated by ModuleHelper itself, which only occurs when handling exceptions. Please note that this breaking change does not require a new major release since before this release, it was not possible to add such variables to the output `due to a bug <https://github.com/ansible-collections/community.general/pull/5755>`__ (https://github.com/ansible-collections/community.general/pull/5765).
|
||||
|
||||
Deprecated Features
|
||||
-------------------
|
||||
|
||||
- consul - deprecate using parameters unused for ``state=absent`` (https://github.com/ansible-collections/community.general/pull/5772).
|
||||
- gitlab_runner - the default of the new option ``access_level_on_creation`` will change from ``false`` to ``true`` in community.general 7.0.0. This will cause ``access_level`` to be used during runner registration as well, and not only during updates (https://github.com/ansible-collections/community.general/pull/5908).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- ModuleHelper - fix bug when adjusting the name of reserved output variables (https://github.com/ansible-collections/community.general/pull/5755).
|
||||
- alternatives - support subcommands on Fedora 37, which uses ``follower`` instead of ``slave`` (https://github.com/ansible-collections/community.general/pull/5794).
|
||||
- bitwarden lookup plugin - clarify what to do, if the bitwarden vault is not unlocked (https://github.com/ansible-collections/community.general/pull/5811).
|
||||
- dig lookup plugin - correctly handle DNSKEY record type's ``algorithm`` field (https://github.com/ansible-collections/community.general/pull/5914).
|
||||
- gem - fix force parameter not being passed to gem command when uninstalling (https://github.com/ansible-collections/community.general/pull/5822).
|
||||
- gem - fix hang due to interactive prompt for confirmation on specific version uninstall (https://github.com/ansible-collections/community.general/pull/5751).
|
||||
- gitlab_deploy_key - also update ``title`` and not just ``can_push`` (https://github.com/ansible-collections/community.general/pull/5888).
|
||||
- keycloak_user_federation - fixes federation creation issue. When a new federation was created and at the same time a default / standard mapper was also changed / updated the creation process failed as a bad None set variable led to a bad malformed url request (https://github.com/ansible-collections/community.general/pull/5750).
|
||||
- keycloak_user_federation - fixes idempotency detection issues. In some cases the module could fail to properly detect already existing user federations because of a buggy seemingly superflous extra query parameter (https://github.com/ansible-collections/community.general/pull/5732).
|
||||
- loganalytics callback plugin - adjust type of callback to ``notification``, it was incorrectly classified as ``aggregate`` before (https://github.com/ansible-collections/community.general/pull/5761).
|
||||
- logdna callback plugin - adjust type of callback to ``notification``, it was incorrectly classified as ``aggregate`` before (https://github.com/ansible-collections/community.general/pull/5761).
|
||||
- logstash callback plugin - adjust type of callback to ``notification``, it was incorrectly classified as ``aggregate`` before (https://github.com/ansible-collections/community.general/pull/5761).
|
||||
- nsupdate - fix zone lookup. The SOA record for an existing zone is returned as an answer RR and not as an authority RR (https://github.com/ansible-collections/community.general/issues/5817, https://github.com/ansible-collections/community.general/pull/5818).
|
||||
- proxmox_disk - fixed issue with read timeout on import action (https://github.com/ansible-collections/community.general/pull/5803).
|
||||
- redfish_utils - removed basic auth HTTP header when performing a GET on the service root resource and when performing a POST to the session collection (https://github.com/ansible-collections/community.general/issues/5886).
|
||||
- splunk callback plugin - adjust type of callback to ``notification``, it was incorrectly classified as ``aggregate`` before (https://github.com/ansible-collections/community.general/pull/5761).
|
||||
- sumologic callback plugin - adjust type of callback to ``notification``, it was incorrectly classified as ``aggregate`` before (https://github.com/ansible-collections/community.general/pull/5761).
|
||||
- syslog_json callback plugin - adjust type of callback to ``notification``, it was incorrectly classified as ``aggregate`` before (https://github.com/ansible-collections/community.general/pull/5761).
|
||||
- terraform - fix ``current`` workspace never getting appended to the ``all`` key in the ``workspace_ctf`` object (https://github.com/ansible-collections/community.general/pull/5735).
|
||||
- terraform - fix ``terraform init`` failure when there are multiple workspaces on the remote backend and when ``default`` workspace is missing by setting ``TF_WORKSPACE`` environmental variable to the value of ``workspace`` when used (https://github.com/ansible-collections/community.general/pull/5735).
|
||||
- terraform module - disable ANSI escape sequences during validation phase (https://github.com/ansible-collections/community.general/pull/5843).
|
||||
- xml - fixed a bug where empty ``children`` list would not be set (https://github.com/ansible-collections/community.general/pull/5808).
|
||||
|
||||
New Modules
|
||||
-----------
|
||||
|
||||
- ocapi_command - Manages Out-Of-Band controllers using Open Composable API (OCAPI)
|
||||
- ocapi_info - Manages Out-Of-Band controllers using Open Composable API (OCAPI)
|
||||
|
||||
v6.2.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix and feature release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- opkg - allow installing a package in a certain version (https://github.com/ansible-collections/community.general/pull/5688).
|
||||
- proxmox - added new module parameter ``tags`` for use with PVE 7+ (https://github.com/ansible-collections/community.general/pull/5714).
|
||||
- puppet - refactored module to use ``CmdRunner`` for executing ``puppet`` (https://github.com/ansible-collections/community.general/pull/5612).
|
||||
- redhat_subscription - add a ``server_proxy_scheme`` parameter to configure the scheme for the proxy server (https://github.com/ansible-collections/community.general/pull/5662).
|
||||
- ssh_config - refactor code to module util to fix sanity check (https://github.com/ansible-collections/community.general/pull/5720).
|
||||
- sudoers - adds ``host`` parameter for setting hostname restrictions in sudoers rules (https://github.com/ansible-collections/community.general/issues/5702).
|
||||
|
||||
Deprecated Features
|
||||
-------------------
|
||||
|
||||
- manageiq_policies - deprecate ``state=list`` in favour of using ``community.general.manageiq_policies_info`` (https://github.com/ansible-collections/community.general/pull/5721).
|
||||
- rax - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_cbs - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_cbs_attachments - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_cdb - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_cdb_database - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_cdb_user - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_clb - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_clb_nodes - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_clb_ssl - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_dns - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_dns_record - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_facts - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_files - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_files_objects - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_identity - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_keypair - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_meta - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_mon_alarm - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_mon_check - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_mon_entity - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_mon_notification - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_mon_notification_plan - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_network - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_queue - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_scaling_group - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
- rax_scaling_policy - module relies on deprecates library ``pyrax``. Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5733).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- ansible_galaxy_install - set default to raise exception if command's return code is different from zero (https://github.com/ansible-collections/community.general/pull/5680).
|
||||
- ansible_galaxy_install - try ``C.UTF-8`` and then fall back to ``en_US.UTF-8`` before failing (https://github.com/ansible-collections/community.general/pull/5680).
|
||||
- gitlab_group_variables - fix dropping variables accidentally when GitLab introduced new properties (https://github.com/ansible-collections/community.general/pull/5667).
|
||||
- gitlab_project_variables - fix dropping variables accidentally when GitLab introduced new properties (https://github.com/ansible-collections/community.general/pull/5667).
|
||||
- lxc_container - fix the arguments of the lxc command which broke the creation and cloning of containers (https://github.com/ansible-collections/community.general/issues/5578).
|
||||
- opkg - fix issue that ``force=reinstall`` would not reinstall an existing package (https://github.com/ansible-collections/community.general/pull/5705).
|
||||
- proxmox_disk - fixed possible issues with redundant ``vmid`` parameter (https://github.com/ansible-collections/community.general/issues/5492, https://github.com/ansible-collections/community.general/pull/5672).
|
||||
- proxmox_nic - fixed possible issues with redundant ``vmid`` parameter (https://github.com/ansible-collections/community.general/issues/5492, https://github.com/ansible-collections/community.general/pull/5672).
|
||||
- unixy callback plugin - fix typo introduced when updating to use Ansible's configuration manager for handling options (https://github.com/ansible-collections/community.general/issues/5600).
|
||||
|
||||
v6.1.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Regular bugfix and feature release.
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- cmd_runner module utils - ``cmd_runner_fmt.as_bool()`` can now take an extra parameter to format when value is false (https://github.com/ansible-collections/community.general/pull/5647).
|
||||
- gconftool2 - refactor using ``ModuleHelper`` and ``CmdRunner`` (https://github.com/ansible-collections/community.general/pull/5545).
|
||||
- java_certs - add more detailed error output when extracting certificate from PKCS12 fails (https://github.com/ansible-collections/community.general/pull/5550).
|
||||
- jenkins_plugin - refactor code to module util to fix sanity check (https://github.com/ansible-collections/community.general/pull/5565).
|
||||
- lxd_project - refactored code out to module utils to clear sanity check (https://github.com/ansible-collections/community.general/pull/5549).
|
||||
- nmap inventory plugin - add new options ``udp_scan``, ``icmp_timestamp``, and ``dns_resolve`` for different types of scans (https://github.com/ansible-collections/community.general/pull/5566).
|
||||
- rax_scaling_group - refactored out code to the ``rax`` module utils to clear the sanity check (https://github.com/ansible-collections/community.general/pull/5563).
|
||||
- redfish_command - add ``PerformRequestedOperations`` command to perform any operations necessary to continue the update flow (https://github.com/ansible-collections/community.general/issues/4276).
|
||||
- redfish_command - add ``update_apply_time`` to ``SimpleUpdate`` command (https://github.com/ansible-collections/community.general/issues/3910).
|
||||
- redfish_command - add ``update_status`` to output of ``SimpleUpdate`` command to allow a user monitor the update in progress (https://github.com/ansible-collections/community.general/issues/4276).
|
||||
- redfish_info - add ``GetUpdateStatus`` command to check the progress of a previous update request (https://github.com/ansible-collections/community.general/issues/4276).
|
||||
- redfish_utils module utils - added PUT (``put_request()``) functionality (https://github.com/ansible-collections/community.general/pull/5490).
|
||||
- slack - add option ``prepend_hash`` which allows to control whether a ``#`` is prepended to ``channel_id``. The current behavior (value ``auto``) is to prepend ``#`` unless some specific prefixes are found. That list of prefixes is incomplete, and there does not seem to exist a documented condition on when exactly ``#`` must not be prepended. We recommend to explicitly set ``prepend_hash=always`` or ``prepend_hash=never`` to avoid any ambiguity (https://github.com/ansible-collections/community.general/pull/5629).
|
||||
- spotinst_aws_elastigroup - add ``elements`` attribute when missing in ``list`` parameters (https://github.com/ansible-collections/community.general/pull/5553).
|
||||
- ssh_config - add ``host_key_algorithms`` option (https://github.com/ansible-collections/community.general/pull/5605).
|
||||
- udm_share - added ``elements`` attribute to ``list`` type parameters (https://github.com/ansible-collections/community.general/pull/5557).
|
||||
- udm_user - add ``elements`` attribute when missing in ``list`` parameters (https://github.com/ansible-collections/community.general/pull/5559).
|
||||
|
||||
Deprecated Features
|
||||
-------------------
|
||||
|
||||
- The ``sap`` modules ``sapcar_extract``, ``sap_task_list_execute``, and ``hana_query``, will be removed from this collection in community.general 7.0.0 and replaced with redirects to ``community.sap_libs``. If you want to continue using these modules, make sure to also install ``community.sap_libs`` (it is part of the Ansible package) (https://github.com/ansible-collections/community.general/pull/5614).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- chroot connection plugin - add ``inventory_hostname`` to vars under ``remote_addr``. This is needed for compatibility with ansible-core 2.13 (https://github.com/ansible-collections/community.general/pull/5570).
|
||||
- cmd_runner module utils - fixed bug when handling default cases in ``cmd_runner_fmt.as_map()`` (https://github.com/ansible-collections/community.general/pull/5538).
|
||||
- cmd_runner module utils - formatting arguments ``cmd_runner_fmt.as_fixed()`` was expecting an non-existing argument (https://github.com/ansible-collections/community.general/pull/5538).
|
||||
- keycloak_client_rolemapping - calculate ``proposed`` and ``after`` return values properly (https://github.com/ansible-collections/community.general/pull/5619).
|
||||
- keycloak_client_rolemapping - remove only listed mappings with ``state=absent`` (https://github.com/ansible-collections/community.general/pull/5619).
|
||||
- proxmox inventory plugin - fix bug while templating when using templates for the ``url``, ``user``, ``password``, ``token_id``, or ``token_secret`` options (https://github.com/ansible-collections/community.general/pull/5640).
|
||||
- proxmox inventory plugin - handle tags delimited by semicolon instead of comma, which happens from Proxmox 7.3 on (https://github.com/ansible-collections/community.general/pull/5602).
|
||||
- redhat_subscription - do not ignore ``consumer_name`` and other variables if ``activationkey`` is specified (https://github.com/ansible-collections/community.general/issues/3486, https://github.com/ansible-collections/community.general/pull/5627).
|
||||
- redhat_subscription - do not pass arguments to ``subscription-manager register`` for things already configured; now a specified ``rhsm_baseurl`` is properly set for subscription-manager (https://github.com/ansible-collections/community.general/pull/5583).
|
||||
- unixy callback plugin - fix plugin to work with ansible-core 2.14 by using Ansible's configuration manager for handling options (https://github.com/ansible-collections/community.general/issues/5600).
|
||||
- vdo - now uses ``yaml.safe_load()`` to parse command output instead of the deprecated ``yaml.load()`` which is potentially unsafe. Using ``yaml.load()`` without explicitely setting a ``Loader=`` is also an error in pyYAML 6.0 (https://github.com/ansible-collections/community.general/pull/5632).
|
||||
- vmadm - fix for index out of range error in ``get_vm_uuid`` (https://github.com/ansible-collections/community.general/pull/5628).
|
||||
|
||||
New Modules
|
||||
-----------
|
||||
|
||||
- btrfs_info - Query btrfs filesystem info
|
||||
- btrfs_subvolume - Manage btrfs subvolumes
|
||||
- gitlab_project_badge - Manage project badges on GitLab Server
|
||||
- ilo_redfish_command - Manages Out-Of-Band controllers using Redfish APIs
|
||||
- ipbase_info - Retrieve IP geolocation and other facts of a host's IP address using the ipbase.com API
|
||||
- kdeconfig - Manage KDE configuration files
|
||||
- keycloak_authz_authorization_scope - Allows administration of Keycloak client authorization scopes via Keycloak API
|
||||
- keycloak_clientscope_type - Set the type of aclientscope in realm or client via Keycloak API
|
||||
- keycloak_clientsecret_info - Retrieve client secret via Keycloak API
|
||||
- keycloak_clientsecret_regenerate - Regenerate Keycloak client secret via Keycloak API
|
||||
|
||||
v6.0.1
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Bugfix release for Ansible 7.0.0.
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- dependent lookup plugin - avoid warning on deprecated parameter for ``Templar.template()`` (https://github.com/ansible-collections/community.general/pull/5543).
|
||||
- jenkins_build - fix the logical flaw when deleting a Jenkins build (https://github.com/ansible-collections/community.general/pull/5514).
|
||||
- one_vm - avoid splitting labels that are ``None`` (https://github.com/ansible-collections/community.general/pull/5489).
|
||||
- onepassword_raw - add missing parameter to plugin documentation (https://github.com/ansible-collections/community.general/issues/5506).
|
||||
- proxmox_disk - avoid duplicate ``vmid`` reference (https://github.com/ansible-collections/community.general/issues/5492, https://github.com/ansible-collections/community.general/pull/5493).
|
||||
|
||||
v6.0.0
|
||||
======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
New major release of community.general with lots of bugfixes, new features, some removed deprecated features, and some other breaking changes. Please check the coresponding sections of the changelog for more details.
|
||||
|
||||
Major Changes
|
||||
-------------
|
||||
|
||||
- The internal structure of the collection was changed for modules and action plugins. These no longer live in a directory hierarchy ordered by topic, but instead are now all in a single (flat) directory. This has no impact on users *assuming they did not use internal FQCNs*. These will still work, but result in deprecation warnings. They were never officially supported and thus the redirects are kept as a courtsey, and this is not labelled as a breaking change. Note that for example the Ansible VScode plugin started recommending these internal names. If you followed its recommendation, you will now have to change back to the short names to avoid deprecation warnings, and potential errors in the future as these redirects will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5461).
|
||||
- newrelic_deployment - removed New Relic v1 API, added support for v2 API (https://github.com/ansible-collections/community.general/pull/5341).
|
||||
|
||||
Minor Changes
|
||||
-------------
|
||||
|
||||
- Added MIT license as ``LICENSES/MIT.txt`` for tests/unit/plugins/modules/packaging/language/test_gem.py (https://github.com/ansible-collections/community.general/pull/5065).
|
||||
- All software licenses are now in the ``LICENSES/`` directory of the collection root (https://github.com/ansible-collections/community.general/pull/5065, https://github.com/ansible-collections/community.general/pull/5079, https://github.com/ansible-collections/community.general/pull/5080, https://github.com/ansible-collections/community.general/pull/5083, https://github.com/ansible-collections/community.general/pull/5087, https://github.com/ansible-collections/community.general/pull/5095, https://github.com/ansible-collections/community.general/pull/5098, https://github.com/ansible-collections/community.general/pull/5106).
|
||||
- ModuleHelper module utils - added property ``verbosity`` to base class (https://github.com/ansible-collections/community.general/pull/5035).
|
||||
- ModuleHelper module utils - improved ``ModuleHelperException``, using ``to_native()`` for the exception message (https://github.com/ansible-collections/community.general/pull/4755).
|
||||
- The collection repository conforms to the `REUSE specification <https://reuse.software/spec/>`__ except for the changelog fragments (https://github.com/ansible-collections/community.general/pull/5138).
|
||||
- ali_instance - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5240).
|
||||
- ali_instance_info - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5240).
|
||||
- alternatives - add ``state=absent`` to be able to remove an alternative (https://github.com/ansible-collections/community.general/pull/4654).
|
||||
- alternatives - add ``subcommands`` parameter (https://github.com/ansible-collections/community.general/pull/4654).
|
||||
- ansible_galaxy_install - minor refactoring using latest ``ModuleHelper`` updates (https://github.com/ansible-collections/community.general/pull/4752).
|
||||
- ansible_galaxy_install - refactored module to use ``CmdRunner`` to execute ``ansible-galaxy`` (https://github.com/ansible-collections/community.general/pull/5477).
|
||||
- apk - add ``world`` parameter for supporting a custom world file (https://github.com/ansible-collections/community.general/pull/4976).
|
||||
- bitwarden lookup plugin - add option ``search`` to search for other attributes than name (https://github.com/ansible-collections/community.general/pull/5297).
|
||||
- cartesian lookup plugin - start using Ansible's configuration manager to parse options (https://github.com/ansible-collections/community.general/pull/5440).
|
||||
- cmd_runner module util - added parameters ``check_mode_skip`` and ``check_mode_return`` to ``CmdRunner.context()``, so that the command is not executed when ``check_mode=True`` (https://github.com/ansible-collections/community.general/pull/4736).
|
||||
- cmd_runner module utils - add ``__call__`` method to invoke context (https://github.com/ansible-collections/community.general/pull/4791).
|
||||
- consul - adds ``ttl`` parameter for session (https://github.com/ansible-collections/community.general/pull/4996).
|
||||
- consul - minor refactoring (https://github.com/ansible-collections/community.general/pull/5367).
|
||||
- consul_session - adds ``token`` parameter for session (https://github.com/ansible-collections/community.general/pull/5193).
|
||||
- cpanm - refactored module to use ``CmdRunner`` to execute ``cpanm`` (https://github.com/ansible-collections/community.general/pull/5485).
|
||||
- cpanm - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674).
|
||||
- credstash lookup plugin - start using Ansible's configuration manager to parse options (https://github.com/ansible-collections/community.general/pull/5440).
|
||||
- dependent lookup plugin - start using Ansible's configuration manager to parse options (https://github.com/ansible-collections/community.general/pull/5440).
|
||||
- dig lookup plugin - add option ``fail_on_error`` to allow stopping execution on lookup failures (https://github.com/ansible-collections/community.general/pull/4973).
|
||||
- dig lookup plugin - start using Ansible's configuration manager to parse options. All documented options can now also be passed as lookup parameters (https://github.com/ansible-collections/community.general/pull/5440).
|
||||
- dnstxt lookup plugin - start using Ansible's configuration manager to parse options (https://github.com/ansible-collections/community.general/pull/5440).
|
||||
- filetree lookup plugin - start using Ansible's configuration manager to parse options (https://github.com/ansible-collections/community.general/pull/5440).
|
||||
- flattened lookup plugin - start using Ansible's configuration manager to parse options (https://github.com/ansible-collections/community.general/pull/5440).
|
||||
- gitlab module util - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259).
|
||||
- gitlab_branch - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259).
|
||||
- gitlab_deploy_key - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259).
|
||||
- gitlab_group - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259).
|
||||
- gitlab_group_members - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259).
|
||||
- gitlab_group_variable - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259).
|
||||
- gitlab_hook - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259).
|
||||
- gitlab_hook - minor refactoring (https://github.com/ansible-collections/community.general/pull/5271).
|
||||
- gitlab_project - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259).
|
||||
- gitlab_project_members - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259).
|
||||
- gitlab_project_variable - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259).
|
||||
- gitlab_protected_branch - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259).
|
||||
- gitlab_runner - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259).
|
||||
- gitlab_user - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259).
|
||||
- hiera lookup plugin - start using Ansible's configuration manager to parse options. The Hiera executable and config file can now also be passed as lookup parameters (https://github.com/ansible-collections/community.general/pull/5440).
|
||||
- homebrew, homebrew_tap - added Homebrew on Linux path to defaults (https://github.com/ansible-collections/community.general/pull/5241).
|
||||
- hponcfg - refactored module to use ``CmdRunner`` to execute ``hponcfg`` (https://github.com/ansible-collections/community.general/pull/5483).
|
||||
- keycloak_* modules - add ``http_agent`` parameter with default value ``Ansible`` (https://github.com/ansible-collections/community.general/issues/5023).
|
||||
- keyring lookup plugin - start using Ansible's configuration manager to parse options (https://github.com/ansible-collections/community.general/pull/5440).
|
||||
- lastpass - use config manager for handling plugin options (https://github.com/ansible-collections/community.general/pull/5022).
|
||||
- ldap_attrs - allow for DNs to have ``{x}`` prefix on first RDN (https://github.com/ansible-collections/community.general/issues/977, https://github.com/ansible-collections/community.general/pull/5450).
|
||||
- linode inventory plugin - simplify option handling (https://github.com/ansible-collections/community.general/pull/5438).
|
||||
- listen_ports_facts - add new ``include_non_listening`` option which adds ``-a`` option to ``netstat`` and ``ss``. This shows both listening and non-listening (for TCP this means established connections) sockets, and returns ``state`` and ``foreign_address`` (https://github.com/ansible-collections/community.general/issues/4762, https://github.com/ansible-collections/community.general/pull/4953).
|
||||
- lmdb_kv lookup plugin - start using Ansible's configuration manager to parse options (https://github.com/ansible-collections/community.general/pull/5440).
|
||||
- lxc_container - minor refactoring (https://github.com/ansible-collections/community.general/pull/5358).
|
||||
- machinectl become plugin - can now be used with a password from another user than root, if a polkit rule is present (https://github.com/ansible-collections/community.general/pull/4849).
|
||||
- machinectl become plugin - combine the success command when building the become command to be consistent with other become plugins (https://github.com/ansible-collections/community.general/pull/5287).
|
||||
- manifold lookup plugin - start using Ansible's configuration manager to parse options (https://github.com/ansible-collections/community.general/pull/5440).
|
||||
- maven_artifact - add a new ``unredirected_headers`` option that can be used with ansible-core 2.12 and above. The default value is to not use ``Authorization`` and ``Cookie`` headers on redirects for security reasons. With ansible-core 2.11, all headers are still passed on for redirects (https://github.com/ansible-collections/community.general/pull/4812).
|
||||
- mksysb - refactored module to use ``CmdRunner`` to execute ``mksysb`` (https://github.com/ansible-collections/community.general/pull/5484).
|
||||
- mksysb - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674).
|
||||
- nagios - minor refactoring on parameter validation for different actions (https://github.com/ansible-collections/community.general/pull/5239).
|
||||
- netcup_dnsapi - add ``timeout`` parameter (https://github.com/ansible-collections/community.general/pull/5301).
|
||||
- nmcli - add ``transport_mode`` configuration for Infiniband devices (https://github.com/ansible-collections/community.general/pull/5361).
|
||||
- nmcli - add bond option ``xmit_hash_policy`` to bond options (https://github.com/ansible-collections/community.general/issues/5148).
|
||||
- nmcli - adds ``vpn`` type and parameter for supporting VPN with service type L2TP and PPTP (https://github.com/ansible-collections/community.general/pull/4746).
|
||||
- nmcli - honor IP options for VPNs (https://github.com/ansible-collections/community.general/pull/5228).
|
||||
- onepassword - support version 2 of the OnePassword CLI (https://github.com/ansible-collections/community.general/pull/4728)
|
||||
- opentelemetry callback plugin - allow configuring opentelementry callback via config file (https://github.com/ansible-collections/community.general/pull/4916).
|
||||
- opentelemetry callback plugin - send logs. This can be disabled by setting ``disable_logs=false`` (https://github.com/ansible-collections/community.general/pull/4175).
|
||||
- pacman - added parameters ``reason`` and ``reason_for`` to set/change the install reason of packages (https://github.com/ansible-collections/community.general/pull/4956).
|
||||
- passwordstore lookup plugin - allow options to be passed lookup options instead of being part of the term strings (https://github.com/ansible-collections/community.general/pull/5444).
|
||||
- passwordstore lookup plugin - allow using alternative password managers by detecting wrapper scripts, allow explicit configuration of pass and gopass backends (https://github.com/ansible-collections/community.general/issues/4766).
|
||||
- passwordstore lookup plugin - improve error messages to include stderr (https://github.com/ansible-collections/community.general/pull/5436)
|
||||
- pipx - added state ``latest`` to the module (https://github.com/ansible-collections/community.general/pull/5105).
|
||||
- pipx - changed implementation to use ``cmd_runner`` (https://github.com/ansible-collections/community.general/pull/5085).
|
||||
- pipx - module fails faster when ``name`` is missing for states ``upgrade`` and ``reinstall`` (https://github.com/ansible-collections/community.general/pull/5100).
|
||||
- pipx - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674).
|
||||
- pipx module utils - created new module util ``pipx`` providing a ``cmd_runner`` specific for the ``pipx`` module (https://github.com/ansible-collections/community.general/pull/5085).
|
||||
- portage - add knobs for Portage's ``--backtrack`` and ``--with-bdeps`` options (https://github.com/ansible-collections/community.general/pull/5349).
|
||||
- portage - use Portage's python module instead of calling gentoolkit-provided program in shell (https://github.com/ansible-collections/community.general/pull/5349).
|
||||
- proxmox inventory plugin - added new flag ``qemu_extended_statuses`` and new groups ``<group_prefix>prelaunch``, ``<group_prefix>paused``. They will be populated only when ``want_facts=true``, ``qemu_extended_statuses=true`` and only for ``QEMU`` machines (https://github.com/ansible-collections/community.general/pull/4723).
|
||||
- proxmox inventory plugin - simplify option handling code (https://github.com/ansible-collections/community.general/pull/5437).
|
||||
- proxmox module utils, the proxmox* modules - add ``api_task_ok`` helper to standardize API task status checks across all proxmox modules (https://github.com/ansible-collections/community.general/pull/5274).
|
||||
- proxmox_kvm - allow ``agent`` argument to be a string (https://github.com/ansible-collections/community.general/pull/5107).
|
||||
- proxmox_snap - add ``unbind`` param to support snapshotting containers with configured mountpoints (https://github.com/ansible-collections/community.general/pull/5274).
|
||||
- puppet - adds ``confdir`` parameter to configure a custom confir location (https://github.com/ansible-collections/community.general/pull/4740).
|
||||
- redfish - added new command GetVirtualMedia, VirtualMediaInsert and VirtualMediaEject to Systems category due to Redfish spec changes the virtualMedia resource location from Manager to System (https://github.com/ansible-collections/community.general/pull/5124).
|
||||
- redfish_config - add ``SetSessionService`` to set default session timeout policy (https://github.com/ansible-collections/community.general/issues/5008).
|
||||
- redfish_info - add ``GetManagerInventory`` to report list of Manager inventory information (https://github.com/ansible-collections/community.general/issues/4899).
|
||||
- seport - added new argument ``local`` (https://github.com/ansible-collections/community.general/pull/5203)
|
||||
- snap - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674).
|
||||
- sudoers - will attempt to validate the proposed sudoers rule using visudo if available, optionally skipped, or required (https://github.com/ansible-collections/community.general/pull/4794, https://github.com/ansible-collections/community.general/issues/4745).
|
||||
- terraform - adds capability to handle complex variable structures for ``variables`` parameter in the module. This must be enabled with the new ``complex_vars`` parameter (https://github.com/ansible-collections/community.general/pull/4797).
|
||||
- terraform - run ``terraform init`` with ``-no-color`` not to mess up the stdout of the task (https://github.com/ansible-collections/community.general/pull/5147).
|
||||
- wdc_redfish_command - add ``IndicatorLedOn`` and ``IndicatorLedOff`` commands for ``Chassis`` category (https://github.com/ansible-collections/community.general/pull/5059).
|
||||
- wdc_redfish_command - add ``PowerModeLow`` and ``PowerModeNormal`` commands for ``Chassis`` category (https://github.com/ansible-collections/community.general/pull/5145).
|
||||
- xfconf - add ``stdout``, ``stderr`` and ``cmd`` to the module results (https://github.com/ansible-collections/community.general/pull/5037).
|
||||
- xfconf - changed implementation to use ``cmd_runner`` (https://github.com/ansible-collections/community.general/pull/4776).
|
||||
- xfconf - use ``do_raise()`` instead of defining custom exception class (https://github.com/ansible-collections/community.general/pull/4975).
|
||||
- xfconf - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674).
|
||||
- xfconf module utils - created new module util ``xfconf`` providing a ``cmd_runner`` specific for ``xfconf`` modules (https://github.com/ansible-collections/community.general/pull/4776).
|
||||
- xfconf_info - changed implementation to use ``cmd_runner`` (https://github.com/ansible-collections/community.general/pull/4776).
|
||||
- xfconf_info - use ``do_raise()`` instead of defining custom exception class (https://github.com/ansible-collections/community.general/pull/4975).
|
||||
- znode - possibility to use ZooKeeper ACL authentication (https://github.com/ansible-collections/community.general/pull/5306).
|
||||
|
||||
Breaking Changes / Porting Guide
|
||||
--------------------------------
|
||||
|
||||
- newrelic_deployment - ``revision`` is required for v2 API (https://github.com/ansible-collections/community.general/pull/5341).
|
||||
- scaleway_container_registry_info - no longer replace ``secret_environment_variables`` in the output by ``SENSITIVE_VALUE`` (https://github.com/ansible-collections/community.general/pull/5497).
|
||||
|
||||
Deprecated Features
|
||||
-------------------
|
||||
|
||||
- ArgFormat module utils - deprecated along ``CmdMixin``, in favor of the ``cmd_runner_fmt`` module util (https://github.com/ansible-collections/community.general/pull/5370).
|
||||
- CmdMixin module utils - deprecated in favor of the ``CmdRunner`` module util (https://github.com/ansible-collections/community.general/pull/5370).
|
||||
- CmdModuleHelper module utils - deprecated in favor of the ``CmdRunner`` module util (https://github.com/ansible-collections/community.general/pull/5370).
|
||||
- CmdStateModuleHelper module utils - deprecated in favor of the ``CmdRunner`` module util (https://github.com/ansible-collections/community.general/pull/5370).
|
||||
- cmd_runner module utils - deprecated ``fmt`` in favour of ``cmd_runner_fmt`` as the parameter format object (https://github.com/ansible-collections/community.general/pull/4777).
|
||||
- django_manage - support for Django releases older than 4.1 has been deprecated and will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5400).
|
||||
- django_manage - support for the commands ``cleanup``, ``syncdb`` and ``validate`` that have been deprecated in Django long time ago will be removed in community.general 9.0.0 (https://github.com/ansible-collections/community.general/pull/5400).
|
||||
- django_manage - the behavior of "creating the virtual environment when missing" is being deprecated and will be removed in community.general version 9.0.0 (https://github.com/ansible-collections/community.general/pull/5405).
|
||||
- gconftool2 - deprecates ``state=get`` in favor of using the module ``gconftool2_info`` (https://github.com/ansible-collections/community.general/pull/4778).
|
||||
- lxc_container - the module will no longer make any effort to support Python 2 (https://github.com/ansible-collections/community.general/pull/5304).
|
||||
- newrelic_deployment - ``appname`` and ``environment`` are no longer valid options in the v2 API. They will be removed in community.general 7.0.0 (https://github.com/ansible-collections/community.general/pull/5341).
|
||||
- proxmox - deprecated the current ``unprivileged`` default value, will be changed to ``true`` in community.general 7.0.0 (https://github.com/pull/5224).
|
||||
- xfconf - deprecated parameter ``disable_facts``, as since version 4.0.0 it only allows value ``true`` (https://github.com/ansible-collections/community.general/pull/4520).
|
||||
|
||||
Removed Features (previously deprecated)
|
||||
----------------------------------------
|
||||
|
||||
- bitbucket* modules - ``username`` is no longer an alias of ``workspace``, but of ``user`` (https://github.com/ansible-collections/community.general/pull/5326).
|
||||
- gem - the default of the ``norc`` option changed from ``false`` to ``true`` (https://github.com/ansible-collections/community.general/pull/5326).
|
||||
- gitlab_group_members - ``gitlab_group`` must now always contain the full path, and no longer just the name or path (https://github.com/ansible-collections/community.general/pull/5326).
|
||||
- keycloak_authentication - the return value ``flow`` has been removed. Use ``end_state`` instead (https://github.com/ansible-collections/community.general/pull/5326).
|
||||
- keycloak_group - the return value ``group`` has been removed. Use ``end_state`` instead (https://github.com/ansible-collections/community.general/pull/5326).
|
||||
- lxd_container - the default of the ``ignore_volatile_options`` option changed from ``true`` to ``false`` (https://github.com/ansible-collections/community.general/pull/5326).
|
||||
- mail callback plugin - the ``sender`` option is now required (https://github.com/ansible-collections/community.general/pull/5326).
|
||||
- module_helper module utils - remove the ``VarDict`` attribute from ``ModuleHelper``. Import ``VarDict`` from ``ansible_collections.community.general.plugins.module_utils.mh.mixins.vars`` instead (https://github.com/ansible-collections/community.general/pull/5326).
|
||||
- proxmox inventory plugin - the default of the ``want_proxmox_nodes_ansible_host`` option changed from ``true`` to ``false`` (https://github.com/ansible-collections/community.general/pull/5326).
|
||||
- vmadm - the ``debug`` option has been removed. It was not used anyway (https://github.com/ansible-collections/community.general/pull/5326).
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- Include ``PSF-license.txt`` file for ``plugins/module_utils/_mount.py``.
|
||||
- Include ``simplified_bsd.txt`` license file for various module utils, the ``lxca_common`` docs fragment, and the ``utm_utils`` unit tests.
|
||||
- alternatives - do not set the priority if the priority was not set by the user (https://github.com/ansible-collections/community.general/pull/4810).
|
||||
- alternatives - only pass subcommands when they are specified as module arguments (https://github.com/ansible-collections/community.general/issues/4803, https://github.com/ansible-collections/community.general/issues/4804, https://github.com/ansible-collections/community.general/pull/4836).
|
||||
- alternatives - when ``subcommands`` is specified, ``link`` must be given for every subcommand. This was already mentioned in the documentation, but not enforced by the code (https://github.com/ansible-collections/community.general/pull/4836).
|
||||
- apache2_mod_proxy - avoid crash when reporting inability to parse balancer_member_page HTML caused by using an undefined variable in the error message (https://github.com/ansible-collections/community.general/pull/5111).
|
||||
- archive - avoid crash when ``lzma`` is not present and ``format`` is not ``xz`` (https://github.com/ansible-collections/community.general/pull/5393).
|
||||
- cmd_runner module utils - fix bug caused by using the ``command`` variable instead of ``self.command`` when looking for binary path (https://github.com/ansible-collections/community.general/pull/4903).
|
||||
- consul - fixed bug introduced in PR 4590 (https://github.com/ansible-collections/community.general/issues/4680).
|
||||
- credstash lookup plugin - pass plugin options to credstash for all terms, not just for the first (https://github.com/ansible-collections/community.general/pull/5440).
|
||||
- dig lookup plugin - add option to return empty result without empty strings, and return empty list instead of ``NXDOMAIN`` (https://github.com/ansible-collections/community.general/pull/5439, https://github.com/ansible-collections/community.general/issues/5428).
|
||||
- dig lookup plugin - fix evaluation of falsy values for boolean parameters ``fail_on_error`` and ``retry_servfail`` (https://github.com/ansible-collections/community.general/pull/5129).
|
||||
- dnsimple_info - correctly report missing library as ``requests`` and not ``another_library`` (https://github.com/ansible-collections/community.general/pull/5111).
|
||||
- dnstxt lookup plugin - add option to return empty result without empty strings, and return empty list instead of ``NXDOMAIN`` (https://github.com/ansible-collections/community.general/pull/5457, https://github.com/ansible-collections/community.general/issues/5428).
|
||||
- dsv lookup plugin - do not ignore the ``tld`` parameter (https://github.com/ansible-collections/community.general/pull/4911).
|
||||
- filesystem - handle ``fatresize --info`` output lines without ``:`` (https://github.com/ansible-collections/community.general/pull/4700).
|
||||
- filesystem - improve error messages when output cannot be parsed by including newlines in escaped form (https://github.com/ansible-collections/community.general/pull/4700).
|
||||
- funcd connection plugin - fix signature of ``exec_command`` (https://github.com/ansible-collections/community.general/pull/5111).
|
||||
- ini_file - minor refactor fixing a python lint error (https://github.com/ansible-collections/community.general/pull/5307).
|
||||
- iso_create - the module somtimes failed to add folders for Joliet and UDF formats (https://github.com/ansible-collections/community.general/issues/5275).
|
||||
- keycloak_realm - fix default groups and roles (https://github.com/ansible-collections/community.general/issues/4241).
|
||||
- keyring_info - fix the result from the keyring library never getting returned (https://github.com/ansible-collections/community.general/pull/4964).
|
||||
- ldap_attrs - fix bug which caused a ``Bad search filter`` error. The error was occuring when the ldap attribute value contained special characters such as ``(`` or ``*`` (https://github.com/ansible-collections/community.general/issues/5434, https://github.com/ansible-collections/community.general/pull/5435).
|
||||
- ldap_attrs - fix ordering issue by ignoring the ``{x}`` prefix on attribute values (https://github.com/ansible-collections/community.general/issues/977, https://github.com/ansible-collections/community.general/pull/5385).
|
||||
- listen_ports_facts - removed leftover ``EnvironmentError`` . The ``else`` clause had a wrong indentation. The check is now handled in the ``split_pid_name`` function (https://github.com/ansible-collections/community.general/pull/5202).
|
||||
- locale_gen - fix support for Ubuntu (https://github.com/ansible-collections/community.general/issues/5281).
|
||||
- lxc_container - the module has been updated to support Python 3 (https://github.com/ansible-collections/community.general/pull/5304).
|
||||
- lxd connection plugin - fix incorrect ``inventory_hostname`` in ``remote_addr``. This is needed for compatibility with ansible-core 2.13 (https://github.com/ansible-collections/community.general/issues/4886).
|
||||
- manageiq_alert_profiles - avoid crash when reporting unknown profile caused by trying to return an undefined variable (https://github.com/ansible-collections/community.general/pull/5111).
|
||||
- nmcli - avoid changed status for most cases with VPN connections (https://github.com/ansible-collections/community.general/pull/5126).
|
||||
- nmcli - fix error caused by adding undefined module arguments for list options (https://github.com/ansible-collections/community.general/issues/4373, https://github.com/ansible-collections/community.general/pull/4813).
|
||||
- nmcli - fix error when setting previously unset MAC address, ``gsm.apn`` or ``vpn.data``: current values were being normalized without checking if they might be ``None`` (https://github.com/ansible-collections/community.general/pull/5291).
|
||||
- nmcli - fix int options idempotence (https://github.com/ansible-collections/community.general/issues/4998).
|
||||
- nsupdate - compatibility with NS records (https://github.com/ansible-collections/community.general/pull/5112).
|
||||
- nsupdate - fix silent failures when updating ``NS`` entries from Bind9 managed DNS zones (https://github.com/ansible-collections/community.general/issues/4657).
|
||||
- opentelemetry callback plugin - support opentelemetry-api 1.13.0 that removed support for ``_time_ns`` (https://github.com/ansible-collections/community.general/pull/5342).
|
||||
- osx_defaults - no longer expand ``~`` in ``value`` to the user's home directory, or expand environment variables (https://github.com/ansible-collections/community.general/issues/5234, https://github.com/ansible-collections/community.general/pull/5243).
|
||||
- packet_ip_subnet - fix error reporting in case of invalid CIDR prefix lengths (https://github.com/ansible-collections/community.general/pull/5111).
|
||||
- pacman - fixed name resolution of URL packages (https://github.com/ansible-collections/community.general/pull/4959).
|
||||
- passwordstore lookup plugin - fix ``returnall`` for gopass (https://github.com/ansible-collections/community.general/pull/5027).
|
||||
- passwordstore lookup plugin - fix password store path detection for gopass (https://github.com/ansible-collections/community.general/pull/4955).
|
||||
- pfexec become plugin - remove superflous quotes preventing exe wrap from working as expected (https://github.com/ansible-collections/community.general/issues/3671, https://github.com/ansible-collections/community.general/pull/3889).
|
||||
- pip_package_info - remove usage of global variable (https://github.com/ansible-collections/community.general/pull/5111).
|
||||
- pkgng - fix case when ``pkg`` fails when trying to upgrade all packages (https://github.com/ansible-collections/community.general/issues/5363).
|
||||
- proxmox - fix error handling when getting VM by name when ``state=absent`` (https://github.com/ansible-collections/community.general/pull/4945).
|
||||
- proxmox inventory plugin - fix crash when ``enabled=1`` is used in agent config string (https://github.com/ansible-collections/community.general/pull/4910).
|
||||
- proxmox inventory plugin - fixed extended status detection for qemu (https://github.com/ansible-collections/community.general/pull/4816).
|
||||
- proxmox_kvm - fix ``agent`` parameter when boolean value is specified (https://github.com/ansible-collections/community.general/pull/5198).
|
||||
- proxmox_kvm - fix error handling when getting VM by name when ``state=absent`` (https://github.com/ansible-collections/community.general/pull/4945).
|
||||
- proxmox_kvm - fix exception when no ``agent`` argument is specified (https://github.com/ansible-collections/community.general/pull/5194).
|
||||
- proxmox_kvm - fix wrong condition (https://github.com/ansible-collections/community.general/pull/5108).
|
||||
- proxmox_kvm - replace new condition with proper condition to allow for using ``vmid`` on update (https://github.com/ansible-collections/community.general/pull/5206).
|
||||
- rax_clb_nodes - fix code to be compatible with Python 3 (https://github.com/ansible-collections/community.general/pull/4933).
|
||||
- redfish_command - fix the check if a virtual media is unmounted to just check for ``instered= false`` caused by Supermicro hardware that does not clear the ``ImageName`` (https://github.com/ansible-collections/community.general/pull/4839).
|
||||
- redfish_command - the Supermicro Redfish implementation only supports the ``image_url`` parameter in the underlying API calls to ``VirtualMediaInsert`` and ``VirtualMediaEject``. Any values set (or the defaults) for ``write_protected`` or ``inserted`` will be ignored (https://github.com/ansible-collections/community.general/pull/4839).
|
||||
- redfish_info - fix to ``GetChassisPower`` to correctly report power information when multiple chassis exist, but not all chassis report power information (https://github.com/ansible-collections/community.general/issues/4901).
|
||||
- redfish_utils module utils - centralize payload checking when performing modification requests to a Redfish service (https://github.com/ansible-collections/community.general/issues/5210/).
|
||||
- redhat_subscription - fix unsubscribing on RHEL 9 (https://github.com/ansible-collections/community.general/issues/4741).
|
||||
- redhat_subscription - make module idempotent when ``pool_ids`` are used (https://github.com/ansible-collections/community.general/issues/5313).
|
||||
- redis* modules - fix call to ``module.fail_json`` when failing because of missing Python libraries (https://github.com/ansible-collections/community.general/pull/4733).
|
||||
- slack - fix incorrect channel prefix ``#`` caused by incomplete pattern detection by adding ``G0`` and ``GF`` as channel ID patterns (https://github.com/ansible-collections/community.general/pull/5019).
|
||||
- slack - fix message update for channels which start with ``CP``. When ``message-id`` was passed it failed for channels which started with ``CP`` because the ``#`` symbol was added before the ``channel_id`` (https://github.com/ansible-collections/community.general/pull/5249).
|
||||
- snap - allow values in the ``options`` parameter to contain whitespaces (https://github.com/ansible-collections/community.general/pull/5475).
|
||||
- sudoers - ensure sudoers config files are created with the permissions requested by sudoers (0440) (https://github.com/ansible-collections/community.general/pull/4814).
|
||||
- sudoers - fix incorrect handling of ``state: absent`` (https://github.com/ansible-collections/community.general/issues/4852).
|
||||
- tss lookup plugin - adding support for updated Delinea library (https://github.com/DelineaXPM/python-tss-sdk/issues/9, https://github.com/ansible-collections/community.general/pull/5151).
|
||||
- virtualbox inventory plugin - skip parsing values with keys that have both a value and nested data. Skip parsing values that are nested more than two keys deep (https://github.com/ansible-collections/community.general/issues/5332, https://github.com/ansible-collections/community.general/pull/5348).
|
||||
- xcc_redfish_command - for compatibility due to Redfish spec changes the virtualMedia resource location changed from Manager to System (https://github.com/ansible-collections/community.general/pull/4682).
|
||||
- xenserver_facts - fix broken ``AnsibleModule`` call that prevented the module from working at all (https://github.com/ansible-collections/community.general/pull/5383).
|
||||
- xfconf - fix setting of boolean values (https://github.com/ansible-collections/community.general/issues/4999, https://github.com/ansible-collections/community.general/pull/5007).
|
||||
- zfs - fix wrong quoting of properties (https://github.com/ansible-collections/community.general/issues/4707, https://github.com/ansible-collections/community.general/pull/4726).
|
||||
|
||||
New Plugins
|
||||
-----------
|
||||
|
||||
Filter
|
||||
~~~~~~
|
||||
|
||||
- counter - Counts hashable elements in a sequence
|
||||
|
||||
Lookup
|
||||
~~~~~~
|
||||
|
||||
- bitwarden - Retrieve secrets from Bitwarden
|
||||
|
||||
New Modules
|
||||
-----------
|
||||
|
||||
- gconftool2_info - Retrieve GConf configurations
|
||||
- iso_customize - Add/remove/change files in ISO file
|
||||
- keycloak_user_rolemapping - Allows administration of Keycloak user_rolemapping with the Keycloak API
|
||||
- keyring - Set or delete a passphrase using the Operating System's native keyring
|
||||
- keyring_info - Get a passphrase using the Operating System's native keyring
|
||||
- manageiq_policies_info - Listing of resource policy_profiles in ManageIQ
|
||||
- manageiq_tags_info - Retrieve resource tags in ManageIQ
|
||||
- pipx_info - Rretrieves information about applications installed with pipx
|
||||
- proxmox_disk - Management of a disk of a Qemu(KVM) VM in a Proxmox VE cluster.
|
||||
- scaleway_compute_private_network - Scaleway compute - private network management
|
||||
- scaleway_container - Scaleway Container management
|
||||
- scaleway_container_info - Retrieve information on Scaleway Container
|
||||
- scaleway_container_namespace - Scaleway Container namespace management
|
||||
- scaleway_container_namespace_info - Retrieve information on Scaleway Container namespace
|
||||
- scaleway_container_registry - Scaleway Container registry management module
|
||||
- scaleway_container_registry_info - Scaleway Container registry info module
|
||||
- scaleway_function - Scaleway Function management
|
||||
- scaleway_function_info - Retrieve information on Scaleway Function
|
||||
- scaleway_function_namespace - Scaleway Function namespace management
|
||||
- scaleway_function_namespace_info - Retrieve information on Scaleway Function namespace
|
||||
- wdc_redfish_command - Manages WDC UltraStar Data102 Out-Of-Band controllers using Redfish APIs
|
||||
- wdc_redfish_info - Manages WDC UltraStar Data102 Out-Of-Band controllers using Redfish APIs
|
||||
- ocapi_command - Manages Out-Of-Band controllers using Open Composable API (OCAPI)
|
||||
- ocapi_info - Manages Out-Of-Band controllers using Open Composable API (OCAPI)
|
||||
|
||||
@@ -31,7 +31,7 @@ Also, consider taking up a valuable, reviewed, but abandoned pull request which
|
||||
* Try committing your changes with an informative but short commit message.
|
||||
* Do not squash your commits and force-push to your branch if not needed. Reviews of your pull request are much easier with individual commits to comprehend the pull request history. All commits of your pull request branch will be squashed into one commit by GitHub upon merge.
|
||||
* Do not add merge commits to your PR. The bot will complain and you will have to rebase ([instructions for rebasing](https://docs.ansible.com/ansible/latest/dev_guide/developing_rebasing.html)) to remove them before your PR can be merged. To avoid that git automatically does merges during pulls, you can configure it to do rebases instead by running `git config pull.rebase true` inside the repository checkout.
|
||||
* Make sure your PR includes a [changelog fragment](https://docs.ansible.com/ansible/devel/community/development_process.html#creating-changelog-fragments). (You must not include a fragment for new modules or new plugins, except for test and filter plugins. Also you shouldn't include one for docs-only changes. If you're not sure, simply don't include one, we'll tell you whether one is needed or not :) )
|
||||
* Make sure your PR includes a [changelog fragment](https://docs.ansible.com/ansible/devel/community/development_process.html#creating-changelog-fragments). (You must not include a fragment for new modules or new plugins. Also you shouldn't include one for docs-only changes. If you're not sure, simply don't include one, we'll tell you whether one is needed or not :) )
|
||||
* Avoid reformatting unrelated parts of the codebase in your PR. These types of changes will likely be requested for reversion, create additional work for reviewers, and may cause approval to be delayed.
|
||||
|
||||
You can also read [our Quick-start development guide](https://github.com/ansible/community-docs/blob/main/create_pr_quick_start_guide.rst).
|
||||
|
||||
16
README.md
16
README.md
@@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Community General Collection
|
||||
|
||||
[](https://dev.azure.com/ansible/community.general/_build?definitionId=31)
|
||||
[](https://dev.azure.com/ansible/community.general/_build?definitionId=31)
|
||||
[](https://github.com/ansible-collections/community.general/actions)
|
||||
[](https://codecov.io/gh/ansible-collections/community.general)
|
||||
|
||||
@@ -73,13 +73,13 @@ We are actively accepting new contributors.
|
||||
|
||||
All types of contributions are very welcome.
|
||||
|
||||
You don't know how to start? Refer to our [contribution guide](https://github.com/ansible-collections/community.general/blob/stable-6/CONTRIBUTING.md)!
|
||||
You don't know how to start? Refer to our [contribution guide](https://github.com/ansible-collections/community.general/blob/stable-7/CONTRIBUTING.md)!
|
||||
|
||||
The current maintainers are listed in the [commit-rights.md](https://github.com/ansible-collections/community.general/blob/stable-6/commit-rights.md#people) file. If you have questions or need help, feel free to mention them in the proposals.
|
||||
The current maintainers are listed in the [commit-rights.md](https://github.com/ansible-collections/community.general/blob/stable-7/commit-rights.md#people) file. If you have questions or need help, feel free to mention them in the proposals.
|
||||
|
||||
You can find more information in the [developer guide for collections](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections), and in the [Ansible Community Guide](https://docs.ansible.com/ansible/latest/community/index.html).
|
||||
|
||||
Also for some notes specific to this collection see [our CONTRIBUTING documentation](https://github.com/ansible-collections/community.general/blob/stable-6/CONTRIBUTING.md).
|
||||
Also for some notes specific to this collection see [our CONTRIBUTING documentation](https://github.com/ansible-collections/community.general/blob/stable-7/CONTRIBUTING.md).
|
||||
|
||||
### Running tests
|
||||
|
||||
@@ -89,7 +89,7 @@ See [here](https://docs.ansible.com/ansible/devel/dev_guide/developing_collectio
|
||||
|
||||
To learn how to maintain / become a maintainer of this collection, refer to:
|
||||
|
||||
* [Committer guidelines](https://github.com/ansible-collections/community.general/blob/stable-6/commit-rights.md).
|
||||
* [Committer guidelines](https://github.com/ansible-collections/community.general/blob/stable-7/commit-rights.md).
|
||||
* [Maintainer guidelines](https://github.com/ansible/community-docs/blob/main/maintaining.rst).
|
||||
|
||||
It is necessary for maintainers of this collection to be subscribed to:
|
||||
@@ -117,7 +117,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/stable-6/CHANGELOG.rst).
|
||||
See the [changelog](https://github.com/ansible-collections/community.general/blob/stable-7/CHANGELOG.rst).
|
||||
|
||||
## Roadmap
|
||||
|
||||
@@ -136,8 +136,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/stable-6/COPYING) for the full text.
|
||||
See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.general/blob/stable-7/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/stable-6/LICENSES/BSD-2-Clause.txt), the [MIT license](https://github.com/ansible-collections/community.general/blob/stable-6/LICENSES/MIT.txt), and the [PSF 2.0 license](https://github.com/ansible-collections/community.general/blob/stable-6/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-7/LICENSES/BSD-2-Clause.txt), the [MIT license](https://github.com/ansible-collections/community.general/blob/stable-7/LICENSES/MIT.txt), and the [PSF 2.0 license](https://github.com/ansible-collections/community.general/blob/stable-7/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/dep5`. This conforms to the [REUSE specification](https://reuse.software/spec/).
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace: community
|
||||
name: general
|
||||
version: 6.6.2
|
||||
version: 7.0.0
|
||||
readme: README.md
|
||||
authors:
|
||||
- Ansible (https://github.com/ansible)
|
||||
|
||||
128
meta/runtime.yml
128
meta/runtime.yml
@@ -22,6 +22,120 @@ plugin_routing:
|
||||
nios_next_network:
|
||||
redirect: infoblox.nios_modules.nios_next_network
|
||||
modules:
|
||||
rax_cbs_attachments:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_cbs:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_cdb_database:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_cdb_user:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_cdb:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_clb_nodes:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_clb_ssl:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_clb:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_dns_record:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_dns:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_facts:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_files_objects:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_files:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_identity:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_keypair:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_meta:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_mon_alarm:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_mon_check:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_mon_entity:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_mon_notification_plan:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_mon_notification:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_network:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_queue:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_scaling_group:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies on the deprecated package pyrax.
|
||||
rax_scaling_policy:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module relies 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.
|
||||
database.aerospike.aerospike_migrations:
|
||||
redirect: community.general.aerospike_migrations
|
||||
deprecation:
|
||||
@@ -972,6 +1086,8 @@ plugin_routing:
|
||||
warning_text: You are using an internal name to access the community.general.heroku_collaborator
|
||||
modules. This has never been supported or documented, and will stop working
|
||||
in community.general 9.0.0.
|
||||
hana_query:
|
||||
redirect: community.sap_libs.sap_hdbsql
|
||||
hetzner_failover_ip:
|
||||
redirect: community.hrobot.failover_ip
|
||||
hetzner_failover_ip_info:
|
||||
@@ -3389,6 +3505,10 @@ plugin_routing:
|
||||
warning_text: You are using an internal name to access the community.general.redfish_info
|
||||
modules. This has never been supported or documented, and will stop working
|
||||
in community.general 9.0.0.
|
||||
sapcar_extract:
|
||||
redirect: community.sap_libs.sapcar_extract
|
||||
sap_task_list_execute:
|
||||
redirect: community.sap_libs.sap_task_list_execute
|
||||
packaging.os.redhat_subscription:
|
||||
redirect: community.general.redhat_subscription
|
||||
deprecation:
|
||||
@@ -4493,6 +4613,10 @@ plugin_routing:
|
||||
modules. This has never been supported or documented, and will stop working
|
||||
in community.general 9.0.0.
|
||||
doc_fragments:
|
||||
rackspace:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This doc fragment is used by rax modules, that rely on the deprecated package pyrax.
|
||||
_gcp:
|
||||
redirect: community.google._gcp
|
||||
docker:
|
||||
@@ -4508,6 +4632,10 @@ plugin_routing:
|
||||
postgresql:
|
||||
redirect: community.postgresql.postgresql
|
||||
module_utils:
|
||||
rax:
|
||||
deprecation:
|
||||
removal_version: 9.0.0
|
||||
warning_text: This module util relies on the deprecated package pyrax.
|
||||
docker.common:
|
||||
redirect: community.docker.common
|
||||
docker.swarm:
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
from ansible.errors import AnsibleError, AnsibleConnectionFailure
|
||||
@@ -80,13 +81,6 @@ class ActionModule(ActionBase):
|
||||
getattr(self, default_value))))
|
||||
return value
|
||||
|
||||
def get_shutdown_command_args(self, distribution):
|
||||
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)
|
||||
return args.format(delay_sec=delay_sec, delay_min=delay_sec // 60, message=shutdown_message)
|
||||
|
||||
def get_distribution(self, task_vars):
|
||||
# FIXME: only execute the module if we don't already have the facts we need
|
||||
distribution = {}
|
||||
@@ -101,7 +95,8 @@ class ActionModule(ActionBase):
|
||||
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['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("{action}: distribution: {dist}".format(action=self._task.action, dist=distribution))
|
||||
return distribution
|
||||
@@ -109,6 +104,23 @@ class ActionModule(ActionBase):
|
||||
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('{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)
|
||||
module_name='ansible.legacy.find',
|
||||
module_args={
|
||||
'paths': find_search_paths,
|
||||
'patterns': [command],
|
||||
'file_type': 'any'
|
||||
}
|
||||
)
|
||||
return [x['path'] for x in find_result['files']]
|
||||
|
||||
shutdown_bin = self._get_value_from_facts('SHUTDOWN_COMMANDS', distribution, 'DEFAULT_SHUTDOWN_COMMAND')
|
||||
default_search_paths = ['/sbin', '/usr/sbin', '/usr/local/sbin']
|
||||
search_paths = self._task.args.get('search_paths', default_search_paths)
|
||||
@@ -127,45 +139,53 @@ class ActionModule(ActionBase):
|
||||
except TypeError:
|
||||
raise AnsibleError(err_msg.format(search_paths))
|
||||
|
||||
display.debug('{action}: running find module looking in {paths} to get path for "{command}"'.format(
|
||||
action=self._task.action,
|
||||
command=shutdown_bin,
|
||||
paths=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)
|
||||
module_name='ansible.legacy.find',
|
||||
module_args={
|
||||
'paths': search_paths,
|
||||
'patterns': [shutdown_bin],
|
||||
'file_type': 'any'
|
||||
}
|
||||
)
|
||||
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
|
||||
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(
|
||||
'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 "{0} poweroff".format(full_path[0]) # done, since we cannot use args with systemd shutdown
|
||||
|
||||
full_path = [x['path'] for x in find_result['files']]
|
||||
if not full_path:
|
||||
raise AnsibleError('Unable to find command "{0}" in search paths: {1}'.format(shutdown_bin, search_paths))
|
||||
self._shutdown_command = full_path[0]
|
||||
return self._shutdown_command
|
||||
# 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)
|
||||
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 = {}
|
||||
shutdown_result = {}
|
||||
shutdown_command = self.get_shutdown_command(task_vars, distribution)
|
||||
shutdown_command_args = self.get_shutdown_command_args(distribution)
|
||||
shutdown_command_exec = '{0} {1}'.format(shutdown_command, shutdown_command_args)
|
||||
shutdown_command_exec = self.get_shutdown_command(task_vars, distribution)
|
||||
|
||||
self.cleanup(force=True)
|
||||
try:
|
||||
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))
|
||||
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:
|
||||
shutdown_result = self._low_level_execute_command(shutdown_command_exec, sudoable=self.DEFAULT_SUDOABLE)
|
||||
except AnsibleConnectionFailure as e:
|
||||
# If the connection is closed too quickly due to the system being shutdown, carry on
|
||||
display.debug('{action}: AnsibleConnectionFailure caught and handled: {error}'.format(action=self._task.action, error=to_text(e)))
|
||||
display.debug(
|
||||
'{action}: AnsibleConnectionFailure caught and handled: {error}'.format(action=self._task.action,
|
||||
error=to_text(e)))
|
||||
shutdown_result['rc'] = 0
|
||||
|
||||
if shutdown_result['rc'] != 0:
|
||||
|
||||
@@ -105,6 +105,10 @@ options:
|
||||
- Whether or not to require SSL validation of API endpoints.
|
||||
type: bool
|
||||
aliases: [ verify_ssl ]
|
||||
deprecated:
|
||||
removed_in: 9.0.0
|
||||
why: This module relies on the deprecated package pyrax.
|
||||
alternative: Use the Openstack modules instead.
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
- pyrax
|
||||
|
||||
@@ -12,8 +12,6 @@ DOCUMENTATION = """
|
||||
requirements:
|
||||
- bw (command line utility)
|
||||
- be logged into bitwarden
|
||||
- bitwarden vault unlocked
|
||||
- C(BW_SESSION) environment variable set
|
||||
short_description: Retrieve secrets from Bitwarden
|
||||
version_added: 5.4.0
|
||||
description:
|
||||
|
||||
@@ -26,6 +26,18 @@ options:
|
||||
description: The integer ID of the secret.
|
||||
required: true
|
||||
type: int
|
||||
fetch_attachments:
|
||||
description:
|
||||
- Boolean flag which indicates whether attached files will get downloaded or not.
|
||||
- The download will only happen if I(file_download_path) has been provided.
|
||||
required: false
|
||||
type: bool
|
||||
version_added: 7.0.0
|
||||
file_download_path:
|
||||
description: Indicate the file attachment download location.
|
||||
required: false
|
||||
type: path
|
||||
version_added: 7.0.0
|
||||
base_url:
|
||||
description: The base URL of the server, e.g. C(https://localhost/SecretServer).
|
||||
env:
|
||||
@@ -157,10 +169,35 @@ EXAMPLES = r"""
|
||||
tasks:
|
||||
- ansible.builtin.debug:
|
||||
msg: the password is {{ secret_password }}
|
||||
|
||||
# Private key stores into certificate file which is attached with secret.
|
||||
# If fetch_attachments=True then private key file will be download on specified path
|
||||
# and file content will display in debug message.
|
||||
- hosts: localhost
|
||||
vars:
|
||||
secret: >-
|
||||
{{
|
||||
lookup(
|
||||
'community.general.tss',
|
||||
102,
|
||||
fetch_attachments=True,
|
||||
file_download_path='/home/certs',
|
||||
base_url='https://secretserver.domain.com/SecretServer/',
|
||||
token='thycotic_access_token'
|
||||
)
|
||||
}}
|
||||
tasks:
|
||||
- ansible.builtin.debug:
|
||||
msg: >
|
||||
the private key is {{
|
||||
(secret['items']
|
||||
| items2dict(key_name='slug',
|
||||
value_name='itemValue'))['private-key']
|
||||
}}
|
||||
"""
|
||||
|
||||
import abc
|
||||
|
||||
import os
|
||||
from ansible.errors import AnsibleError, AnsibleOptionsError
|
||||
from ansible.module_utils import six
|
||||
from ansible.plugins.lookup import LookupBase
|
||||
@@ -211,13 +248,27 @@ class TSSClient(object):
|
||||
else:
|
||||
return TSSClientV0(**server_parameters)
|
||||
|
||||
def get_secret(self, term):
|
||||
def get_secret(self, term, fetch_file_attachments, file_download_path):
|
||||
display.debug("tss_lookup term: %s" % term)
|
||||
|
||||
secret_id = self._term_to_secret_id(term)
|
||||
display.vvv(u"Secret Server lookup of Secret with ID %d" % secret_id)
|
||||
|
||||
return self._client.get_secret_json(secret_id)
|
||||
if fetch_file_attachments:
|
||||
obj = self._client.get_secret(secret_id, fetch_file_attachments)
|
||||
for i in obj['items']:
|
||||
if file_download_path and os.path.isdir(file_download_path):
|
||||
if i['isFile']:
|
||||
try:
|
||||
with open(os.path.join(file_download_path, str(obj['id']) + "_" + i['slug']), "w") as f:
|
||||
f.write(i['itemValue'].text)
|
||||
i['itemValue'] = "*** Not Valid For Display ***"
|
||||
except ValueError:
|
||||
raise AnsibleOptionsError("Failed to download {0}".format(str(i['slug'])))
|
||||
else:
|
||||
raise AnsibleOptionsError("File download path does not exist")
|
||||
return obj
|
||||
else:
|
||||
return self._client.get_secret_json(secret_id)
|
||||
|
||||
@staticmethod
|
||||
def _term_to_secret_id(term):
|
||||
@@ -294,6 +345,6 @@ class LookupModule(LookupBase):
|
||||
)
|
||||
|
||||
try:
|
||||
return [tss.get_secret(term) for term in terms]
|
||||
return [tss.get_secret(term, self.get_option("fetch_attachments"), self.get_option("file_download_path")) for term in terms]
|
||||
except SecretServerError as error:
|
||||
raise AnsibleError("Secret Server lookup failure: %s" % error.message)
|
||||
|
||||
@@ -309,11 +309,3 @@ class _CmdRunnerContext(object):
|
||||
|
||||
|
||||
cmd_runner_fmt = _Format()
|
||||
|
||||
#
|
||||
# The fmt form is deprecated and will be removed in community.general 7.0.0
|
||||
# Please use:
|
||||
# cmd_runner_fmt
|
||||
# Or, to retain the same effect, use:
|
||||
# from ansible_collections.community.general.plugins.module_utils.cmd_runner import cmd_runner_fmt as fmt
|
||||
fmt = cmd_runner_fmt
|
||||
|
||||
@@ -55,10 +55,8 @@ def initialize_dialect(dialect, **kwargs):
|
||||
|
||||
|
||||
def read_csv(data, dialect, fieldnames=None):
|
||||
BOM = to_native(u'\ufeff')
|
||||
|
||||
data = to_native(data, errors='surrogate_or_strict')
|
||||
if data.startswith(BOM):
|
||||
data = data[len(BOM):]
|
||||
|
||||
if PY3:
|
||||
fake_fh = StringIO(data)
|
||||
|
||||
@@ -10,6 +10,7 @@ __metaclass__ = type
|
||||
|
||||
from ansible.module_utils.basic import missing_required_lib
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
from ansible.module_utils.six import integer_types, string_types
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
|
||||
|
||||
@@ -121,3 +122,38 @@ def filter_returned_variables(gitlab_variables):
|
||||
if key not in KNOWN:
|
||||
item.pop(key)
|
||||
return existing_variables
|
||||
|
||||
|
||||
def vars_to_variables(vars, module):
|
||||
# transform old vars to new variables structure
|
||||
variables = list()
|
||||
for item, value in vars.items():
|
||||
if isinstance(value, (string_types, integer_types, float)):
|
||||
variables.append(
|
||||
{
|
||||
"name": item,
|
||||
"value": str(value),
|
||||
"masked": False,
|
||||
"protected": False,
|
||||
"variable_type": "env_var",
|
||||
}
|
||||
)
|
||||
|
||||
elif isinstance(value, dict):
|
||||
new_item = {
|
||||
"name": item,
|
||||
"value": value.get('value'),
|
||||
"masked": value.get('masked'),
|
||||
"protected": value.get('protected'),
|
||||
"variable_type": value.get('variable_type'),
|
||||
}
|
||||
|
||||
if value.get('environment_scope'):
|
||||
new_item['environment_scope'] = value.get('environment_scope')
|
||||
|
||||
variables.append(new_item)
|
||||
|
||||
else:
|
||||
module.fail_json(msg="value must be of type string, integer, float or dict")
|
||||
|
||||
return variables
|
||||
|
||||
@@ -207,30 +207,24 @@ def is_struct_included(struct1, struct2, exclude=None):
|
||||
Return True if all element of dict 1 are present in dict 2, return false otherwise.
|
||||
"""
|
||||
if isinstance(struct1, list) and isinstance(struct2, list):
|
||||
if not struct1 and not struct2:
|
||||
return True
|
||||
for item1 in struct1:
|
||||
if isinstance(item1, (list, dict)):
|
||||
for item2 in struct2:
|
||||
if is_struct_included(item1, item2, exclude):
|
||||
break
|
||||
else:
|
||||
return False
|
||||
if not is_struct_included(item1, item2, exclude):
|
||||
return False
|
||||
else:
|
||||
if item1 not in struct2:
|
||||
return False
|
||||
return True
|
||||
elif isinstance(struct1, dict) and isinstance(struct2, dict):
|
||||
if not struct1 and not struct2:
|
||||
return True
|
||||
try:
|
||||
for key in struct1:
|
||||
if not (exclude and key in exclude):
|
||||
if not is_struct_included(struct1[key], struct2[key], exclude):
|
||||
return False
|
||||
return True
|
||||
except KeyError:
|
||||
return False
|
||||
return True
|
||||
elif isinstance(struct1, bool) and isinstance(struct2, bool):
|
||||
return struct1 == struct2
|
||||
else:
|
||||
@@ -753,15 +747,8 @@ class KeycloakAPI(object):
|
||||
users_url = URL_USERS.format(url=self.baseurl, realm=realm)
|
||||
users_url += '?username=%s&exact=true' % username
|
||||
try:
|
||||
userrep = None
|
||||
users = json.loads(to_native(open_url(users_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
|
||||
validate_certs=self.validate_certs).read()))
|
||||
for user in users:
|
||||
if user['username'] == username:
|
||||
userrep = user
|
||||
break
|
||||
return userrep
|
||||
|
||||
return json.loads(to_native(open_url(users_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
|
||||
validate_certs=self.validate_certs).read()))
|
||||
except ValueError as e:
|
||||
self.module.fail_json(msg='API returned incorrect JSON when trying to obtain the user for realm %s and username %s: %s'
|
||||
% (realm, username, str(e)))
|
||||
|
||||
@@ -38,6 +38,12 @@ class DependencyCtxMgr(object):
|
||||
|
||||
|
||||
class DependencyMixin(ModuleHelperBase):
|
||||
"""
|
||||
THIS CLASS IS BEING DEPRECATED.
|
||||
See the deprecation notice in ``DependencyMixin.fail_on_missing_deps()`` below.
|
||||
|
||||
Mixin for mapping module options to running a CLI command with its arguments.
|
||||
"""
|
||||
_dependencies = []
|
||||
|
||||
@classmethod
|
||||
@@ -46,6 +52,12 @@ class DependencyMixin(ModuleHelperBase):
|
||||
return cls._dependencies[-1]
|
||||
|
||||
def fail_on_missing_deps(self):
|
||||
self.module.deprecate(
|
||||
'The DependencyMixin is being deprecated. '
|
||||
'Modules should use community.general.plugins.module_utils.deps instead.',
|
||||
version='9.0.0',
|
||||
collection_name='community.general',
|
||||
)
|
||||
for d in self._dependencies:
|
||||
if not d.has_it:
|
||||
self.module.fail_json(changed=False,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
from ansible.module_utils.common.dict_transformations import dict_merge
|
||||
|
||||
# (TODO: remove AnsibleModule!) pylint: disable-next=unused-import
|
||||
|
||||
@@ -7,14 +7,17 @@
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
# pylint: disable=unused-import
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.module_helper import ( # noqa: F401, pylint: disable=unused-import
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.module_helper import (
|
||||
ModuleHelper, StateModuleHelper, CmdModuleHelper, CmdStateModuleHelper, AnsibleModule
|
||||
)
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.mixins.cmd import CmdMixin, ArgFormat # noqa: F401, pylint: disable=unused-import
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.mixins.state import StateMixin # noqa: F401, pylint: disable=unused-import
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.mixins.deps import DependencyCtxMgr # noqa: F401, pylint: disable=unused-import
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.exceptions import ModuleHelperException # noqa: F401, pylint: disable=unused-import
|
||||
# pylint: disable-next=unused-import
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.deco import cause_changes, module_fails_on_exception # noqa: F401
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.mixins.vars import VarMeta, VarDict # noqa: F401, pylint: disable=unused-import
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.mixins.cmd import CmdMixin, ArgFormat # noqa: F401
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.mixins.state import StateMixin # noqa: F401
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.mixins.deps import DependencyCtxMgr, DependencyMixin # noqa: F401
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.exceptions import ModuleHelperException # noqa: F401
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.deco import (
|
||||
cause_changes, module_fails_on_exception, check_mode_skip, check_mode_skip_returns,
|
||||
)
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.mixins.vars import VarMeta, VarDict, VarsMixin # noqa: F401
|
||||
|
||||
45
plugins/module_utils/snap.py
Normal file
45
plugins/module_utils/snap.py
Normal file
@@ -0,0 +1,45 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2023, Alexei Znamensky <russoz@gmail.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
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt
|
||||
|
||||
|
||||
_alias_state_map = dict(
|
||||
present='alias',
|
||||
absent='unalias',
|
||||
info='aliases',
|
||||
)
|
||||
|
||||
_state_map = dict(
|
||||
present='install',
|
||||
absent='remove',
|
||||
enabled='enable',
|
||||
disabled='disable',
|
||||
)
|
||||
|
||||
|
||||
def snap_runner(module, **kwargs):
|
||||
runner = CmdRunner(
|
||||
module,
|
||||
"snap",
|
||||
arg_formats=dict(
|
||||
state_alias=cmd_runner_fmt.as_map(_alias_state_map), # snap_alias only
|
||||
name=cmd_runner_fmt.as_list(),
|
||||
alias=cmd_runner_fmt.as_list(), # snap_alias only
|
||||
state=cmd_runner_fmt.as_map(_state_map),
|
||||
_list=cmd_runner_fmt.as_fixed("list"),
|
||||
_set=cmd_runner_fmt.as_fixed("set"),
|
||||
get=cmd_runner_fmt.as_fixed(["get", "-d"]),
|
||||
classic=cmd_runner_fmt.as_bool("--classic"),
|
||||
channel=cmd_runner_fmt.as_func(lambda v: [] if v == 'stable' else ['--channel', '{0}'.format(v)]),
|
||||
options=cmd_runner_fmt.as_list(),
|
||||
),
|
||||
check_rc=False,
|
||||
**kwargs
|
||||
)
|
||||
return runner
|
||||
@@ -16,7 +16,7 @@ short_description: Manages Datadog downtimes
|
||||
version_added: 2.0.0
|
||||
description:
|
||||
- Manages downtimes within Datadog.
|
||||
- Options as described on U(https://docs.datadoghq.com/api/v1/downtimes/).
|
||||
- Options as described on U(https://docs.datadoghq.com/api/v1/downtimes/s).
|
||||
author:
|
||||
- Datadog (@Datadog)
|
||||
requirements:
|
||||
|
||||
@@ -49,8 +49,8 @@ notes:
|
||||
I(value="'myvalue'") - with single quotes as part of the Ansible parameter
|
||||
value.
|
||||
- When using loops in combination with a value like
|
||||
"[('xkb', 'us'), ('xkb', 'se')]", you need to be aware of possible
|
||||
type conversions. Applying a filter C({{ item.value | string }})
|
||||
:code:`"[('xkb', 'us'), ('xkb', 'se')]"`, you need to be aware of possible
|
||||
type conversions. Applying a filter :code:`"{{ item.value | string }}"`
|
||||
to the parameter variable can avoid potential conversion problems.
|
||||
- The easiest way to figure out exact syntax/value you need to provide for a
|
||||
key is by making the configuration change in application affected by the
|
||||
|
||||
@@ -239,9 +239,9 @@ with deps.declare("requests"):
|
||||
|
||||
def build_url(account, key, is_sandbox):
|
||||
headers = {'Accept': 'application/json',
|
||||
'Authorization': 'Bearer ' + key}
|
||||
url = 'https://api{sandbox}.dnsimple.com/'.format(
|
||||
sandbox=".sandbox" if is_sandbox else "") + 'v2/' + account
|
||||
'Authorization': 'Bearer {0}'.format(key)}
|
||||
sandbox = '.sandbox' if is_sandbox else ''
|
||||
url = 'https://api{sandbox}.dnsimple.com/v2/{account}'.format(sandbox=sandbox, account=account)
|
||||
req = Request(url=url, headers=headers)
|
||||
prepped_request = req.prepare()
|
||||
return prepped_request
|
||||
@@ -250,19 +250,21 @@ def build_url(account, key, is_sandbox):
|
||||
def iterate_data(module, request_object):
|
||||
base_url = request_object.url
|
||||
response = Session().send(request_object)
|
||||
if 'pagination' in response.json():
|
||||
data = response.json()["data"]
|
||||
pages = response.json()["pagination"]["total_pages"]
|
||||
if int(pages) > 1:
|
||||
for page in range(1, pages):
|
||||
page = page + 1
|
||||
request_object.url = base_url + '&page=' + str(page)
|
||||
new_results = Session().send(request_object)
|
||||
data = data + new_results.json()["data"]
|
||||
return data
|
||||
else:
|
||||
if 'pagination' not in response.json():
|
||||
module.fail_json('API Call failed, check ID, key and sandbox values')
|
||||
|
||||
data = response.json()["data"]
|
||||
total_pages = response.json()["pagination"]["total_pages"]
|
||||
page = 1
|
||||
|
||||
while page < total_pages:
|
||||
page = page + 1
|
||||
request_object.url = '{url}&page={page}'.format(url=base_url, page=page)
|
||||
new_results = Session().send(request_object)
|
||||
data = data + new_results.json()['data']
|
||||
|
||||
return data
|
||||
|
||||
|
||||
def record_info(dnsimple_mod, req_obj):
|
||||
req_obj.url, req_obj.method = req_obj.url + '/zones/' + dnsimple_mod.params["name"] + '/records?name=' + dnsimple_mod.params["record"], 'GET'
|
||||
|
||||
@@ -35,12 +35,13 @@ options:
|
||||
type: str
|
||||
description:
|
||||
- Preference keys typically have simple values such as strings,
|
||||
integers, or lists of strings and integers. This is ignored if the state
|
||||
is "get". See man gconftool-2(1).
|
||||
integers, or lists of strings and integers.
|
||||
This is ignored unless I(state=present). See man gconftool-2(1).
|
||||
value_type:
|
||||
type: str
|
||||
description:
|
||||
- The type of value being set. This is ignored if the state is "get".
|
||||
- The type of value being set.
|
||||
This is ignored unless I(state=present). See man gconftool-2(1).
|
||||
choices: [ bool, float, int, string ]
|
||||
state:
|
||||
type: str
|
||||
@@ -56,8 +57,8 @@ options:
|
||||
See man gconftool-2(1).
|
||||
direct:
|
||||
description:
|
||||
- Access the config database directly, bypassing server. If direct is
|
||||
specified then the config_source must be specified as well.
|
||||
- Access the config database directly, bypassing server. If I(direct) is
|
||||
specified then the I(config_source) must be specified as well.
|
||||
See man gconftool-2(1).
|
||||
type: bool
|
||||
default: false
|
||||
@@ -73,17 +74,26 @@ EXAMPLES = """
|
||||
|
||||
RETURN = '''
|
||||
key:
|
||||
description: The key specified in the module parameters
|
||||
description: The key specified in the module parameters.
|
||||
returned: success
|
||||
type: str
|
||||
sample: /desktop/gnome/interface/font_name
|
||||
value_type:
|
||||
description: The type of the value that was changed
|
||||
description: The type of the value that was changed.
|
||||
returned: success
|
||||
type: str
|
||||
sample: string
|
||||
value:
|
||||
description: The value of the preference key after executing the module
|
||||
description:
|
||||
- The value of the preference key after executing the module or C(null) if key is removed.
|
||||
- From community.general 7.0.0 onwards it returns C(null) for a non-existent I(key), and returns C("") before that.
|
||||
returned: success
|
||||
type: str
|
||||
sample: "Serif 12"
|
||||
previous_value:
|
||||
description:
|
||||
- The value of the preference key before executing the module.
|
||||
- From community.general 7.0.0 onwards it returns C(null) for a non-existent I(key), and returns C("") before that.
|
||||
returned: success
|
||||
type: str
|
||||
sample: "Serif 12"
|
||||
@@ -95,7 +105,6 @@ from ansible_collections.community.general.plugins.module_utils.gconftool2 impor
|
||||
|
||||
|
||||
class GConftool(StateModuleHelper):
|
||||
change_params = ('value', )
|
||||
diff_params = ('value', )
|
||||
output_params = ('key', 'value_type')
|
||||
facts_params = ('key', 'value_type')
|
||||
@@ -111,7 +120,6 @@ class GConftool(StateModuleHelper):
|
||||
),
|
||||
required_if=[
|
||||
('state', 'present', ['value', 'value_type']),
|
||||
('state', 'absent', ['value']),
|
||||
('direct', True, ['config_source']),
|
||||
],
|
||||
supports_check_mode=True,
|
||||
@@ -125,6 +133,7 @@ class GConftool(StateModuleHelper):
|
||||
|
||||
self.vars.set('previous_value', self._get(), fact=True)
|
||||
self.vars.set('value_type', self.vars.value_type)
|
||||
self.vars.set('_value', self.vars.previous_value, output=False, change=True)
|
||||
self.vars.set_meta('value', initial_value=self.vars.previous_value)
|
||||
self.vars.set('playbook_value', self.vars.value, fact=True)
|
||||
|
||||
@@ -132,7 +141,8 @@ class GConftool(StateModuleHelper):
|
||||
def process(rc, out, err):
|
||||
if err and fail_on_err:
|
||||
self.ansible.fail_json(msg='gconftool-2 failed with error: %s' % (str(err)))
|
||||
self.vars.value = out.rstrip()
|
||||
out = out.rstrip()
|
||||
self.vars.value = None if out == "" else out
|
||||
return self.vars.value
|
||||
return process
|
||||
|
||||
@@ -148,11 +158,18 @@ class GConftool(StateModuleHelper):
|
||||
def state_absent(self):
|
||||
with self.runner("state key", output_process=self._make_process(False)) as ctx:
|
||||
ctx.run()
|
||||
if self.verbosity >= 4:
|
||||
self.vars.run_info = ctx.run_info
|
||||
self.vars.set('new_value', None, fact=True)
|
||||
self.vars._value = None
|
||||
|
||||
def state_present(self):
|
||||
with self.runner("direct config_source value_type state key value", output_process=self._make_process(True)) as ctx:
|
||||
self.vars.set('new_value', ctx.run(), fact=True)
|
||||
ctx.run()
|
||||
if self.verbosity >= 4:
|
||||
self.vars.run_info = ctx.run_info
|
||||
self.vars.set('new_value', self._get(), fact=True)
|
||||
self.vars._value = self.vars.new_value
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@@ -255,10 +255,7 @@ class GitLabGroup(object):
|
||||
return True
|
||||
|
||||
try:
|
||||
# Filter out None values
|
||||
filtered = dict((arg_key, arg_value) for arg_key, arg_value in arguments.items() if arg_value is not None)
|
||||
|
||||
group = self._gitlab.groups.create(filtered)
|
||||
group = self._gitlab.groups.create(arguments)
|
||||
except (gitlab.exceptions.GitlabCreateError) as e:
|
||||
self._module.fail_json(msg="Failed to create group: %s " % to_native(e))
|
||||
|
||||
|
||||
@@ -166,52 +166,11 @@ group_variable:
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.api import basic_auth_argument_spec
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible.module_utils.six import integer_types
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.gitlab import (
|
||||
auth_argument_spec, gitlab_authentication, ensure_gitlab_package, filter_returned_variables
|
||||
auth_argument_spec, gitlab_authentication, ensure_gitlab_package, filter_returned_variables, vars_to_variables
|
||||
)
|
||||
|
||||
|
||||
def vars_to_variables(vars, module):
|
||||
# transform old vars to new variables structure
|
||||
variables = list()
|
||||
for item, value in vars.items():
|
||||
if (isinstance(value, string_types) or
|
||||
isinstance(value, (integer_types, float))):
|
||||
variables.append(
|
||||
{
|
||||
"name": item,
|
||||
"value": str(value),
|
||||
"masked": False,
|
||||
"protected": False,
|
||||
"variable_type": "env_var",
|
||||
}
|
||||
)
|
||||
|
||||
elif isinstance(value, dict):
|
||||
new_item = {"name": item, "value": value.get('value')}
|
||||
|
||||
new_item = {
|
||||
"name": item,
|
||||
"value": value.get('value'),
|
||||
"masked": value.get('masked'),
|
||||
"protected": value.get('protected'),
|
||||
"variable_type": value.get('variable_type'),
|
||||
}
|
||||
|
||||
if value.get('environment_scope'):
|
||||
new_item['environment_scope'] = value.get('environment_scope')
|
||||
|
||||
variables.append(new_item)
|
||||
|
||||
else:
|
||||
module.fail_json(msg="value must be of type string, integer, float or dict")
|
||||
|
||||
return variables
|
||||
|
||||
|
||||
class GitlabGroupVariables(object):
|
||||
|
||||
def __init__(self, module, gitlab_instance):
|
||||
|
||||
@@ -184,8 +184,6 @@ project_variable:
|
||||
import traceback
|
||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||
from ansible.module_utils.api import basic_auth_argument_spec
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible.module_utils.six import integer_types
|
||||
|
||||
GITLAB_IMP_ERR = None
|
||||
try:
|
||||
@@ -196,47 +194,10 @@ except Exception:
|
||||
HAS_GITLAB_PACKAGE = False
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.gitlab import (
|
||||
auth_argument_spec, gitlab_authentication, ensure_gitlab_package, filter_returned_variables
|
||||
auth_argument_spec, gitlab_authentication, ensure_gitlab_package, filter_returned_variables, vars_to_variables
|
||||
)
|
||||
|
||||
|
||||
def vars_to_variables(vars, module):
|
||||
# transform old vars to new variables structure
|
||||
variables = list()
|
||||
for item, value in vars.items():
|
||||
if (isinstance(value, string_types) or
|
||||
isinstance(value, (integer_types, float))):
|
||||
variables.append(
|
||||
{
|
||||
"name": item,
|
||||
"value": str(value),
|
||||
"masked": False,
|
||||
"protected": False,
|
||||
"variable_type": "env_var",
|
||||
}
|
||||
)
|
||||
|
||||
elif isinstance(value, dict):
|
||||
|
||||
new_item = {
|
||||
"name": item,
|
||||
"value": value.get('value'),
|
||||
"masked": value.get('masked'),
|
||||
"protected": value.get('protected'),
|
||||
"variable_type": value.get('variable_type'),
|
||||
}
|
||||
|
||||
if value.get('environment_scope'):
|
||||
new_item['environment_scope'] = value.get('environment_scope')
|
||||
|
||||
variables.append(new_item)
|
||||
|
||||
else:
|
||||
module.fail_json(msg="value must be of type string, integer, float or dict")
|
||||
|
||||
return variables
|
||||
|
||||
|
||||
class GitlabProjectVariables(object):
|
||||
|
||||
def __init__(self, module, gitlab_instance):
|
||||
@@ -322,7 +283,7 @@ def compare(requested_variables, existing_variables, state):
|
||||
def native_python_main(this_gitlab, purge, requested_variables, state, module):
|
||||
|
||||
change = False
|
||||
return_value = dict(added=list(), updated=list(), removed=list(), untouched=list())
|
||||
return_value = dict(added=[], updated=[], removed=[], untouched=[])
|
||||
|
||||
gitlab_keys = this_gitlab.list_all_project_variables()
|
||||
before = [x.attributes for x in gitlab_keys]
|
||||
@@ -391,7 +352,7 @@ def native_python_main(this_gitlab, purge, requested_variables, state, module):
|
||||
if module.check_mode:
|
||||
return_value = dict(added=added, updated=updated, removed=return_value['removed'], untouched=untouched)
|
||||
|
||||
if return_value['added'] or return_value['removed'] or return_value['updated']:
|
||||
if any(return_value[x] for x in ['added', 'removed', 'updated']):
|
||||
change = True
|
||||
|
||||
gitlab_keys = this_gitlab.list_all_project_variables()
|
||||
@@ -452,7 +413,7 @@ def main():
|
||||
|
||||
if state == 'present':
|
||||
if any(x['value'] is None for x in variables):
|
||||
module.fail_json(msg='value parameter is required in state present')
|
||||
module.fail_json(msg='value parameter is required for all variables in state present')
|
||||
|
||||
gitlab_instance = gitlab_authentication(module)
|
||||
|
||||
|
||||
@@ -114,8 +114,9 @@ options:
|
||||
- Whether the runner should be registered with an access level or not.
|
||||
- If set to C(true), the value of I(access_level) is used for runner registration.
|
||||
- If set to C(false), GitLab registers the runner with the default access level.
|
||||
- The current default of this option is C(false). This default is deprecated and will change to C(true) in commuinty.general 7.0.0.
|
||||
- The default of this option changed to C(true) in community.general 7.0.0. Before, it was C(false).
|
||||
required: false
|
||||
default: true
|
||||
type: bool
|
||||
version_added: 6.3.0
|
||||
maximum_timeout:
|
||||
@@ -252,13 +253,6 @@ class GitLabRunner(object):
|
||||
arguments['token'] = options['registration_token']
|
||||
|
||||
access_level_on_creation = self._module.params['access_level_on_creation']
|
||||
if access_level_on_creation is None:
|
||||
message = "The option 'access_level_on_creation' is unspecified, so 'false' is assumed. "\
|
||||
"That means any value of 'access_level' is ignored and GitLab registers the runner with its default value. "\
|
||||
"The option 'access_level_on_creation' will switch to 'true' in community.general 7.0.0"
|
||||
self._module.deprecate(message, version='7.0.0', collection_name='community.general')
|
||||
access_level_on_creation = False
|
||||
|
||||
if not access_level_on_creation:
|
||||
arguments.pop('access_level', None)
|
||||
|
||||
@@ -366,7 +360,7 @@ def main():
|
||||
run_untagged=dict(type='bool', default=True),
|
||||
locked=dict(type='bool', default=False),
|
||||
access_level=dict(type='str', choices=["not_protected", "ref_protected"]),
|
||||
access_level_on_creation=dict(type='bool'),
|
||||
access_level_on_creation=dict(type='bool', default=True),
|
||||
maximum_timeout=dict(type='int', default=3600),
|
||||
registration_token=dict(type='str', no_log=True),
|
||||
project=dict(type='str'),
|
||||
|
||||
@@ -1,219 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (c) 2021, Rainer Leber <rainerleber@gmail.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'''
|
||||
---
|
||||
module: hana_query
|
||||
short_description: Execute SQL on HANA
|
||||
version_added: 3.2.0
|
||||
description: This module executes SQL statements on HANA with hdbsql.
|
||||
extends_documentation_fragment:
|
||||
- community.general.attributes
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
diff_mode:
|
||||
support: none
|
||||
options:
|
||||
sid:
|
||||
description: The system ID.
|
||||
type: str
|
||||
required: true
|
||||
instance:
|
||||
description: The instance number.
|
||||
type: str
|
||||
required: true
|
||||
user:
|
||||
description: A dedicated username. The user could be also in hdbuserstore. Defaults to C(SYSTEM).
|
||||
type: str
|
||||
default: SYSTEM
|
||||
userstore:
|
||||
description: If C(true) the user must be in hdbuserstore.
|
||||
type: bool
|
||||
default: false
|
||||
version_added: 3.5.0
|
||||
password:
|
||||
description:
|
||||
- The password to connect to the database.
|
||||
- "B(Note:) Since the passwords have to be passed as command line arguments, I(userstore=true) should
|
||||
be used whenever possible, as command line arguments can be seen by other users
|
||||
on the same machine."
|
||||
type: str
|
||||
autocommit:
|
||||
description: Autocommit the statement.
|
||||
type: bool
|
||||
default: true
|
||||
host:
|
||||
description: The Host IP address. The port can be defined as well.
|
||||
type: str
|
||||
database:
|
||||
description: Define the database on which to connect.
|
||||
type: str
|
||||
encrypted:
|
||||
description: Use encrypted connection. Defaults to C(false).
|
||||
type: bool
|
||||
default: false
|
||||
filepath:
|
||||
description:
|
||||
- One or more files each containing one SQL query to run.
|
||||
- Must be a string or list containing strings.
|
||||
type: list
|
||||
elements: path
|
||||
query:
|
||||
description:
|
||||
- SQL query to run.
|
||||
- Must be a string or list containing strings. Please note that if you supply a string, it will be split by commas (C(,)) to a list.
|
||||
It is better to supply a one-element list instead to avoid mangled input.
|
||||
type: list
|
||||
elements: str
|
||||
author:
|
||||
- Rainer Leber (@rainerleber)
|
||||
'''
|
||||
|
||||
EXAMPLES = r'''
|
||||
- name: Simple select query
|
||||
community.general.hana_query:
|
||||
sid: "hdb"
|
||||
instance: "01"
|
||||
password: "Test123"
|
||||
query: "select user_name from users"
|
||||
|
||||
- name: Run several queries
|
||||
community.general.hana_query:
|
||||
sid: "hdb"
|
||||
instance: "01"
|
||||
password: "Test123"
|
||||
query:
|
||||
- "select user_name from users;"
|
||||
- select * from SYSTEM;
|
||||
host: "localhost"
|
||||
autocommit: false
|
||||
|
||||
- name: Run several queries from file
|
||||
community.general.hana_query:
|
||||
sid: "hdb"
|
||||
instance: "01"
|
||||
password: "Test123"
|
||||
filepath:
|
||||
- /tmp/HANA_CPU_UtilizationPerCore_2.00.020+.txt
|
||||
- /tmp/HANA.txt
|
||||
host: "localhost"
|
||||
|
||||
- name: Run several queries from user store
|
||||
community.general.hana_query:
|
||||
sid: "hdb"
|
||||
instance: "01"
|
||||
user: hdbstoreuser
|
||||
userstore: true
|
||||
query:
|
||||
- "select user_name from users;"
|
||||
- select * from users;
|
||||
autocommit: false
|
||||
'''
|
||||
|
||||
RETURN = r'''
|
||||
query_result:
|
||||
description: List containing results of all queries executed (one sublist for every query).
|
||||
returned: on success
|
||||
type: list
|
||||
elements: list
|
||||
sample: [[{"Column": "Value1"}, {"Column": "Value2"}], [{"Column": "Value1"}, {"Column": "Value2"}]]
|
||||
'''
|
||||
|
||||
import csv
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.six import StringIO
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
|
||||
|
||||
def csv_to_list(rawcsv):
|
||||
reader_raw = csv.DictReader(StringIO(rawcsv))
|
||||
reader = [dict((k, v.strip()) for k, v in row.items()) for row in reader_raw]
|
||||
return list(reader)
|
||||
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
sid=dict(type='str', required=True),
|
||||
instance=dict(type='str', required=True),
|
||||
encrypted=dict(type='bool', default=False),
|
||||
host=dict(type='str', required=False),
|
||||
user=dict(type='str', default="SYSTEM"),
|
||||
userstore=dict(type='bool', default=False),
|
||||
password=dict(type='str', no_log=True),
|
||||
database=dict(type='str', required=False),
|
||||
query=dict(type='list', elements='str', required=False),
|
||||
filepath=dict(type='list', elements='path', required=False),
|
||||
autocommit=dict(type='bool', default=True),
|
||||
),
|
||||
required_one_of=[('query', 'filepath')],
|
||||
required_if=[('userstore', False, ['password'])],
|
||||
supports_check_mode=False,
|
||||
)
|
||||
rc, out, err, out_raw = [0, [], "", ""]
|
||||
|
||||
params = module.params
|
||||
|
||||
sid = (params['sid']).upper()
|
||||
instance = params['instance']
|
||||
user = params['user']
|
||||
userstore = params['userstore']
|
||||
password = params['password']
|
||||
autocommit = params['autocommit']
|
||||
host = params['host']
|
||||
database = params['database']
|
||||
encrypted = params['encrypted']
|
||||
|
||||
filepath = params['filepath']
|
||||
query = params['query']
|
||||
|
||||
bin_path = "/usr/sap/{sid}/HDB{instance}/exe/hdbsql".format(sid=sid, instance=instance)
|
||||
|
||||
try:
|
||||
command = [module.get_bin_path(bin_path, required=True)]
|
||||
except Exception as e:
|
||||
module.fail_json(msg='Failed to find hdbsql at the expected path "{0}". Please check SID and instance number: "{1}"'.format(bin_path, to_native(e)))
|
||||
|
||||
if encrypted is True:
|
||||
command.extend(['-attemptencrypt'])
|
||||
if autocommit is False:
|
||||
command.extend(['-z'])
|
||||
if host is not None:
|
||||
command.extend(['-n', host])
|
||||
if database is not None:
|
||||
command.extend(['-d', database])
|
||||
# -x Suppresses additional output, such as the number of selected rows in a result set.
|
||||
if userstore:
|
||||
command.extend(['-x', '-U', user])
|
||||
else:
|
||||
command.extend(['-x', '-i', instance, '-u', user, '-p', password])
|
||||
|
||||
if filepath is not None:
|
||||
command.extend(['-I'])
|
||||
for p in filepath:
|
||||
# makes a command like hdbsql -i 01 -u SYSTEM -p secret123# -I /tmp/HANA_CPU_UtilizationPerCore_2.00.020+.txt,
|
||||
# iterates through files and append the output to var out.
|
||||
query_command = command + [p]
|
||||
(rc, out_raw, err) = module.run_command(query_command)
|
||||
out.append(csv_to_list(out_raw))
|
||||
if query is not None:
|
||||
for q in query:
|
||||
# makes a command like hdbsql -i 01 -u SYSTEM -p secret123# "select user_name from users",
|
||||
# iterates through multiple commands and append the output to var out.
|
||||
query_command = command + [q]
|
||||
(rc, out_raw, err) = module.run_command(query_command)
|
||||
out.append(csv_to_list(out_raw))
|
||||
changed = True
|
||||
|
||||
module.exit_json(changed=changed, rc=rc, query_result=out, stderr=err)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -316,14 +316,14 @@ def do_ini(module, filename, section=None, option=None, values=None,
|
||||
# override option with no value to option with value if not allow_no_value
|
||||
if len(values) > 0:
|
||||
for index, line in enumerate(section_lines):
|
||||
if not changed_lines[index] and match_opt(option, line):
|
||||
if not changed_lines[index] and match_active_opt(option, line):
|
||||
newline = assignment_format % (option, values.pop(0))
|
||||
(changed, msg) = update_section_line(changed, section_lines, index, changed_lines, newline, msg)
|
||||
if len(values) == 0:
|
||||
break
|
||||
# remove all remaining option occurrences from the rest of the section
|
||||
for index in range(len(section_lines) - 1, 0, -1):
|
||||
if not changed_lines[index] and match_opt(option, section_lines[index]):
|
||||
if not changed_lines[index] and match_active_opt(option, section_lines[index]):
|
||||
del section_lines[index]
|
||||
del changed_lines[index]
|
||||
changed = True
|
||||
|
||||
@@ -59,7 +59,7 @@ options:
|
||||
record_values:
|
||||
description:
|
||||
- Manage DNS record name with this value.
|
||||
- Mutually exclusive with I(record_value), and exactly one of I(record_value) and I(record_values) has to be specified.
|
||||
- Mutually exclusive with I(record_values), and exactly one of I(record_value) and I(record_values) has to be specified.
|
||||
- In the case of 'A' or 'AAAA' record types, this will be the IP address.
|
||||
- In the case of 'A6' record type, this will be the A6 Record data.
|
||||
- In the case of 'CNAME' record type, this will be the hostname.
|
||||
|
||||
304
plugins/modules/ipbase_info.py
Normal file
304
plugins/modules/ipbase_info.py
Normal file
@@ -0,0 +1,304 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright (c) 2023, Dominik Kukacka <dominik.kukacka@gmail.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 = '''
|
||||
---
|
||||
module: "ipbase_info"
|
||||
version_added: "7.0.0"
|
||||
short_description: "Retrieve IP geolocation and other facts of a host's IP address using the ipbase.com API"
|
||||
description:
|
||||
- "Retrieve IP geolocation and other facts of a host's IP address using the ipbase.com API"
|
||||
author: "Dominik Kukacka (@dominikkukacka)"
|
||||
extends_documentation_fragment:
|
||||
- "community.general.attributes"
|
||||
- "community.general.attributes.info_module"
|
||||
options:
|
||||
ip:
|
||||
description:
|
||||
- "The IP you want to get the info for. If not specified the API will detect the IP automatically."
|
||||
required: false
|
||||
type: str
|
||||
apikey:
|
||||
description:
|
||||
- "The API key for the request if you need more requests."
|
||||
required: false
|
||||
type: str
|
||||
hostname:
|
||||
description:
|
||||
- "If the hostname parameter is set to C(true), the API response will contain the hostname of the IP."
|
||||
required: false
|
||||
type: bool
|
||||
default: false
|
||||
language:
|
||||
description:
|
||||
- "An ISO Alpha 2 Language Code for localizing the IP data"
|
||||
required: false
|
||||
type: str
|
||||
default: "en"
|
||||
notes:
|
||||
- "Check U(https://ipbase.com/) for more information."
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: "Get IP geolocation information of the primary outgoing IP"
|
||||
community.general.ipbase_info:
|
||||
register: my_ip_info
|
||||
|
||||
- name: "Get IP geolocation information of a specific IP"
|
||||
community.general.ipbase_info:
|
||||
ip: "8.8.8.8"
|
||||
register: my_ip_info
|
||||
|
||||
|
||||
- name: "Get IP geolocation information of a specific IP with all other possible parameters"
|
||||
community.general.ipbase_info:
|
||||
ip: "8.8.8.8"
|
||||
apikey: "xxxxxxxxxxxxxxxxxxxxxx"
|
||||
hostname: true
|
||||
language: "de"
|
||||
register: my_ip_info
|
||||
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
data:
|
||||
description: "JSON parsed response from ipbase.com. Please refer to U(https://ipbase.com/docs/info) for the detailled structure of the response."
|
||||
returned: success
|
||||
type: dict
|
||||
sample: {
|
||||
"ip": "1.1.1.1",
|
||||
"hostname": "one.one.one.one",
|
||||
"type": "v4",
|
||||
"range_type": {
|
||||
"type": "PUBLIC",
|
||||
"description": "Public address"
|
||||
},
|
||||
"connection": {
|
||||
"asn": 13335,
|
||||
"organization": "Cloudflare, Inc.",
|
||||
"isp": "APNIC Research and Development",
|
||||
"range": "1.1.1.1/32"
|
||||
},
|
||||
"location": {
|
||||
"geonames_id": 5332870,
|
||||
"latitude": 34.053611755371094,
|
||||
"longitude": -118.24549865722656,
|
||||
"zip": "90012",
|
||||
"continent": {
|
||||
"code": "NA",
|
||||
"name": "North America",
|
||||
"name_translated": "North America"
|
||||
},
|
||||
"country": {
|
||||
"alpha2": "US",
|
||||
"alpha3": "USA",
|
||||
"calling_codes": [
|
||||
"+1"
|
||||
],
|
||||
"currencies": [
|
||||
{
|
||||
"symbol": "$",
|
||||
"name": "US Dollar",
|
||||
"symbol_native": "$",
|
||||
"decimal_digits": 2,
|
||||
"rounding": 0,
|
||||
"code": "USD",
|
||||
"name_plural": "US dollars"
|
||||
}
|
||||
],
|
||||
"emoji": "...",
|
||||
"ioc": "USA",
|
||||
"languages": [
|
||||
{
|
||||
"name": "English",
|
||||
"name_native": "English"
|
||||
}
|
||||
],
|
||||
"name": "United States",
|
||||
"name_translated": "United States",
|
||||
"timezones": [
|
||||
"America/New_York",
|
||||
"America/Detroit",
|
||||
"America/Kentucky/Louisville",
|
||||
"America/Kentucky/Monticello",
|
||||
"America/Indiana/Indianapolis",
|
||||
"America/Indiana/Vincennes",
|
||||
"America/Indiana/Winamac",
|
||||
"America/Indiana/Marengo",
|
||||
"America/Indiana/Petersburg",
|
||||
"America/Indiana/Vevay",
|
||||
"America/Chicago",
|
||||
"America/Indiana/Tell_City",
|
||||
"America/Indiana/Knox",
|
||||
"America/Menominee",
|
||||
"America/North_Dakota/Center",
|
||||
"America/North_Dakota/New_Salem",
|
||||
"America/North_Dakota/Beulah",
|
||||
"America/Denver",
|
||||
"America/Boise",
|
||||
"America/Phoenix",
|
||||
"America/Los_Angeles",
|
||||
"America/Anchorage",
|
||||
"America/Juneau",
|
||||
"America/Sitka",
|
||||
"America/Metlakatla",
|
||||
"America/Yakutat",
|
||||
"America/Nome",
|
||||
"America/Adak",
|
||||
"Pacific/Honolulu"
|
||||
],
|
||||
"is_in_european_union": false,
|
||||
"fips": "US",
|
||||
"geonames_id": 6252001,
|
||||
"hasc_id": "US",
|
||||
"wikidata_id": "Q30"
|
||||
},
|
||||
"city": {
|
||||
"fips": "644000",
|
||||
"alpha2": null,
|
||||
"geonames_id": 5368753,
|
||||
"hasc_id": null,
|
||||
"wikidata_id": "Q65",
|
||||
"name": "Los Angeles",
|
||||
"name_translated": "Los Angeles"
|
||||
},
|
||||
"region": {
|
||||
"fips": "US06",
|
||||
"alpha2": "US-CA",
|
||||
"geonames_id": 5332921,
|
||||
"hasc_id": "US.CA",
|
||||
"wikidata_id": "Q99",
|
||||
"name": "California",
|
||||
"name_translated": "California"
|
||||
}
|
||||
},
|
||||
"tlds": [
|
||||
".us"
|
||||
],
|
||||
"timezone": {
|
||||
"id": "America/Los_Angeles",
|
||||
"current_time": "2023-05-04T04:30:28-07:00",
|
||||
"code": "PDT",
|
||||
"is_daylight_saving": true,
|
||||
"gmt_offset": -25200
|
||||
},
|
||||
"security": {
|
||||
"is_anonymous": false,
|
||||
"is_datacenter": false,
|
||||
"is_vpn": false,
|
||||
"is_bot": false,
|
||||
"is_abuser": true,
|
||||
"is_known_attacker": true,
|
||||
"is_proxy": false,
|
||||
"is_spam": false,
|
||||
"is_tor": false,
|
||||
"is_icloud_relay": false,
|
||||
"threat_score": 100
|
||||
},
|
||||
"domains": {
|
||||
"count": 10943,
|
||||
"domains": [
|
||||
"eliwise.academy",
|
||||
"accountingprose.academy",
|
||||
"pistola.academy",
|
||||
"1and1-test-ntlds-fr.accountant",
|
||||
"omnergy.africa"
|
||||
]
|
||||
}
|
||||
}
|
||||
'''
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
from ansible.module_utils.urls import fetch_url
|
||||
|
||||
from ansible.module_utils.six.moves.urllib.parse import urlencode
|
||||
|
||||
|
||||
USER_AGENT = 'ansible-community.general.ipbase_info/0.1.0'
|
||||
BASE_URL = 'https://api.ipbase.com/v2/info'
|
||||
|
||||
|
||||
class IpbaseInfo(object):
|
||||
|
||||
def __init__(self, module):
|
||||
self.module = module
|
||||
|
||||
def _get_url_data(self, url):
|
||||
response, info = fetch_url(
|
||||
self.module,
|
||||
url,
|
||||
force=True,
|
||||
timeout=10,
|
||||
headers={
|
||||
'Accept': 'application/json',
|
||||
'User-Agent': USER_AGENT,
|
||||
})
|
||||
|
||||
if info['status'] != 200:
|
||||
self.module.fail_json(msg='The API request to ipbase.com returned an error status code {0}'.format(info['status']))
|
||||
else:
|
||||
try:
|
||||
content = response.read()
|
||||
result = self.module.from_json(content.decode('utf8'))
|
||||
except ValueError:
|
||||
self.module.fail_json(
|
||||
msg='Failed to parse the ipbase.com response: '
|
||||
'{0} {1}'.format(url, content))
|
||||
else:
|
||||
return result
|
||||
|
||||
def info(self):
|
||||
|
||||
ip = self.module.params['ip']
|
||||
apikey = self.module.params['apikey']
|
||||
hostname = self.module.params['hostname']
|
||||
language = self.module.params['language']
|
||||
|
||||
url = BASE_URL
|
||||
|
||||
params = {}
|
||||
if ip:
|
||||
params['ip'] = ip
|
||||
|
||||
if apikey:
|
||||
params['apikey'] = apikey
|
||||
|
||||
if hostname:
|
||||
params['hostname'] = 1
|
||||
|
||||
if language:
|
||||
params['language'] = language
|
||||
|
||||
if params:
|
||||
url += '?' + urlencode(params)
|
||||
|
||||
return self._get_url_data(url)
|
||||
|
||||
|
||||
def main():
|
||||
module_args = dict(
|
||||
ip=dict(type='str', required=False, no_log=False),
|
||||
apikey=dict(type='str', required=False, no_log=True),
|
||||
hostname=dict(type='bool', required=False, no_log=False, default=False),
|
||||
language=dict(type='str', required=False, no_log=False, default='en'),
|
||||
)
|
||||
|
||||
module = AnsibleModule(
|
||||
argument_spec=module_args,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ipbase = IpbaseInfo(module)
|
||||
module.exit_json(**ipbase.info())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -61,6 +61,17 @@ options:
|
||||
description:
|
||||
- Set to C(true) to return the full attribute schema of entries, not
|
||||
their attribute values. Overrides I(attrs) when provided.
|
||||
base64_attributes:
|
||||
description:
|
||||
- If provided, all attribute values returned that are listed in this option
|
||||
will be Base64 encoded.
|
||||
- If the special value C(*) appears in this list, all attributes will be
|
||||
Base64 encoded.
|
||||
- All other attribute values will be converted to UTF-8 strings. If they
|
||||
contain binary data, please note that invalid UTF-8 bytes will be omitted.
|
||||
type: list
|
||||
elements: str
|
||||
version_added: 7.0.0
|
||||
extends_documentation_fragment:
|
||||
- community.general.ldap.documentation
|
||||
- community.general.attributes
|
||||
@@ -81,10 +92,27 @@ EXAMPLES = r"""
|
||||
register: ldap_group_gids
|
||||
"""
|
||||
|
||||
RESULTS = """
|
||||
results:
|
||||
description:
|
||||
- For every entry found, one dictionary will be returned.
|
||||
- Every dictionary contains a key C(dn) with the entry's DN as a value.
|
||||
- Every attribute of the entry found is added to the dictionary. If the key
|
||||
has precisely one value, that value is taken directly, otherwise the key's
|
||||
value is a list.
|
||||
- Note that all values (for single-element lists) and list elements (for multi-valued
|
||||
lists) will be UTF-8 strings. Some might contain Base64-encoded binary data; which
|
||||
ones is determined by the I(base64_attributes) option.
|
||||
type: list
|
||||
elements: dict
|
||||
"""
|
||||
|
||||
import base64
|
||||
import traceback
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
|
||||
from ansible.module_utils.six import string_types, text_type
|
||||
from ansible_collections.community.general.plugins.module_utils.ldap import LdapGeneric, gen_specs
|
||||
|
||||
LDAP_IMP_ERR = None
|
||||
@@ -105,6 +133,7 @@ def main():
|
||||
filter=dict(type='str', default='(objectClass=*)'),
|
||||
attrs=dict(type='list', elements='str'),
|
||||
schema=dict(type='bool', default=False),
|
||||
base64_attributes=dict(type='list', elements='str'),
|
||||
),
|
||||
supports_check_mode=True,
|
||||
)
|
||||
@@ -118,16 +147,30 @@ def main():
|
||||
except Exception as exception:
|
||||
module.fail_json(msg="Attribute action failed.", details=to_native(exception))
|
||||
|
||||
module.exit_json(changed=False)
|
||||
|
||||
def _normalize_string(val, convert_to_base64):
|
||||
if isinstance(val, string_types):
|
||||
if isinstance(val, text_type):
|
||||
val = to_bytes(val, encoding='utf-8')
|
||||
if convert_to_base64:
|
||||
val = to_text(base64.b64encode(val))
|
||||
else:
|
||||
# See https://github.com/ansible/ansible/issues/80258#issuecomment-1477038952 for details.
|
||||
# We want to make sure that all strings are properly UTF-8 encoded, even if they were not,
|
||||
# or happened to be byte strings.
|
||||
val = to_text(val, 'utf-8', errors='replace')
|
||||
# See also https://github.com/ansible-collections/community.general/issues/5704.
|
||||
return val
|
||||
|
||||
|
||||
def _extract_entry(dn, attrs):
|
||||
def _extract_entry(dn, attrs, base64_attributes):
|
||||
extracted = {'dn': dn}
|
||||
for attr, val in list(attrs.items()):
|
||||
convert_to_base64 = '*' in base64_attributes or attr in base64_attributes
|
||||
if len(val) == 1:
|
||||
extracted[attr] = val[0]
|
||||
extracted[attr] = _normalize_string(val[0], convert_to_base64)
|
||||
else:
|
||||
extracted[attr] = val
|
||||
extracted[attr] = [_normalize_string(v, convert_to_base64) for v in val]
|
||||
return extracted
|
||||
|
||||
|
||||
@@ -140,9 +183,10 @@ class LdapSearch(LdapGeneric):
|
||||
self._load_scope()
|
||||
self._load_attrs()
|
||||
self._load_schema()
|
||||
self._base64_attributes = set(self.module.params['base64_attributes'] or [])
|
||||
|
||||
def _load_schema(self):
|
||||
self.schema = self.module.boolean(self.module.params['schema'])
|
||||
self.schema = self.module.params['schema']
|
||||
if self.schema:
|
||||
self.attrsonly = 1
|
||||
else:
|
||||
@@ -179,7 +223,7 @@ class LdapSearch(LdapGeneric):
|
||||
if self.schema:
|
||||
ldap_entries.append(dict(dn=result[0], attrs=list(result[1].keys())))
|
||||
else:
|
||||
ldap_entries.append(_extract_entry(result[0], result[1]))
|
||||
ldap_entries.append(_extract_entry(result[0], result[1], self._base64_attributes))
|
||||
return ldap_entries
|
||||
except ldap.NO_SUCH_OBJECT:
|
||||
self.module.fail_json(msg="Base not found: {0}".format(self.dn))
|
||||
|
||||
@@ -92,17 +92,6 @@ EXAMPLES = '''
|
||||
username: 'admin'
|
||||
password: 'smartvm'
|
||||
validate_certs: false
|
||||
|
||||
- name: List current policy_profile and policies for a provider in ManageIQ
|
||||
community.general.manageiq_policies:
|
||||
state: list
|
||||
resource_name: 'EngLab'
|
||||
resource_type: 'provider'
|
||||
manageiq_connection:
|
||||
url: 'http://127.0.0.1:3000'
|
||||
username: 'admin'
|
||||
password: 'smartvm'
|
||||
validate_certs: false
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
||||
@@ -34,7 +34,10 @@ options:
|
||||
description:
|
||||
- C(absent) - tags should not exist.
|
||||
- C(present) - tags should exist.
|
||||
- C(list) - list current tags.
|
||||
- >
|
||||
C(list) - list current tags.
|
||||
This state is deprecated and will be removed 8.0.0.
|
||||
Please use the module M(community.general.manageiq_tags_info) instead.
|
||||
choices: ['absent', 'present', 'list']
|
||||
default: 'present'
|
||||
tags:
|
||||
@@ -110,17 +113,6 @@ EXAMPLES = '''
|
||||
username: 'admin'
|
||||
password: 'smartvm'
|
||||
validate_certs: false
|
||||
|
||||
- name: List current tags for a provider in ManageIQ.
|
||||
community.general.manageiq_tags:
|
||||
state: list
|
||||
resource_name: 'EngLab'
|
||||
resource_type: 'provider'
|
||||
manageiq_connection:
|
||||
url: 'http://127.0.0.1:3000'
|
||||
username: 'admin'
|
||||
password: 'smartvm'
|
||||
validate_certs: false
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
@@ -162,6 +154,13 @@ def main():
|
||||
resource_name = module.params['resource_name']
|
||||
state = module.params['state']
|
||||
|
||||
if state == "list":
|
||||
module.deprecate(
|
||||
'The value "list" for "state" is deprecated. Please use community.general.manageiq_tags_info instead.',
|
||||
version='8.0.0',
|
||||
collection_name='community.general'
|
||||
)
|
||||
|
||||
# get the action and resource type
|
||||
action = actions[state]
|
||||
resource_type = manageiq_entities()[resource_type_key]
|
||||
|
||||
@@ -280,14 +280,32 @@ def run_module():
|
||||
cursor = conn.cursor(as_dict=True)
|
||||
query_results_key = 'query_results_dict'
|
||||
|
||||
queries = script.split('\nGO\n')
|
||||
# Process the script into batches
|
||||
queries = []
|
||||
current_batch = []
|
||||
for statement in script.splitlines(keepends=True):
|
||||
# Ignore the Byte Order Mark, if found
|
||||
if statement.strip() == '\uFEFF':
|
||||
continue
|
||||
|
||||
# Assume each 'GO' is on its own line but may have leading/trailing whitespace
|
||||
# and be of mixed-case
|
||||
if statement.strip().upper() != 'GO':
|
||||
current_batch.append(statement)
|
||||
else:
|
||||
queries.append(''.join(current_batch))
|
||||
current_batch = []
|
||||
if len(current_batch) > 0:
|
||||
queries.append(''.join(current_batch))
|
||||
|
||||
result['changed'] = True
|
||||
if module.check_mode:
|
||||
module.exit_json(**result)
|
||||
|
||||
query_results = []
|
||||
try:
|
||||
for query in queries:
|
||||
for query in queries:
|
||||
# Catch and exit on any bad query errors
|
||||
try:
|
||||
cursor.execute(query, sql_params)
|
||||
qry_result = []
|
||||
rows = cursor.fetchall()
|
||||
@@ -295,8 +313,17 @@ def run_module():
|
||||
qry_result.append(rows)
|
||||
rows = cursor.fetchall()
|
||||
query_results.append(qry_result)
|
||||
except Exception as e:
|
||||
return module.fail_json(msg="query failed", query=query, error=str(e), **result)
|
||||
except Exception as e:
|
||||
# We know we executed the statement so this error just means we have no resultset
|
||||
# which is ok (eg UPDATE/INSERT)
|
||||
if (
|
||||
type(e).__name__ == 'OperationalError' and
|
||||
str(e) == 'Statement not executed or executed statement has no resultset'
|
||||
):
|
||||
query_results.append([])
|
||||
else:
|
||||
error_msg = '%s: %s' % (type(e).__name__, str(e))
|
||||
module.fail_json(msg="query failed", query=query, error=error_msg, **result)
|
||||
|
||||
# ensure that the result is json serializable
|
||||
qry_results = json.loads(json.dumps(query_results, default=clean_output))
|
||||
|
||||
@@ -61,18 +61,6 @@ options:
|
||||
description:
|
||||
- The name of the user/process that triggered this deployment
|
||||
required: false
|
||||
appname:
|
||||
type: str
|
||||
description:
|
||||
- Name of the application.
|
||||
- This option has been deprecated and will be removed in community.general 7.0.0. Please do not use.
|
||||
required: false
|
||||
environment:
|
||||
type: str
|
||||
description:
|
||||
- The environment for this deployment.
|
||||
- This option has been deprecated and will be removed community.general 7.0.0. Please do not use.
|
||||
required: false
|
||||
validate_certs:
|
||||
description:
|
||||
- If C(false), SSL certificates will not be validated. This should only be used
|
||||
@@ -113,8 +101,6 @@ def main():
|
||||
description=dict(required=False),
|
||||
revision=dict(required=True),
|
||||
user=dict(required=False),
|
||||
appname=dict(required=False, removed_in_version='7.0.0', removed_from_collection='community.general'),
|
||||
environment=dict(required=False, removed_in_version='7.0.0', removed_from_collection='community.general'),
|
||||
validate_certs=dict(default=True, type='bool'),
|
||||
),
|
||||
required_one_of=[['app_name', 'application_id']],
|
||||
|
||||
@@ -66,6 +66,8 @@ options:
|
||||
- Type C(macvlan) is added in community.general 6.6.0.
|
||||
- Type C(wireguard) is added in community.general 4.3.0.
|
||||
- Type C(vpn) is added in community.general 5.1.0.
|
||||
- Using C(bond-slave), C(bridge-slave) or C(team-slave) implies C(ethernet) connection type with corresponding I(slave_type) option.
|
||||
- If you want to control non-ethernet connection attached to C(bond), C(bridge) or C(team) consider using C(slave_type) option.
|
||||
type: str
|
||||
choices: [ bond, bond-slave, bridge, bridge-slave, dummy, ethernet, generic, gre, infiniband, ipip, macvlan, sit, team, team-slave, vlan, vxlan,
|
||||
wifi, gsm, wireguard, vpn ]
|
||||
@@ -81,9 +83,16 @@ options:
|
||||
type: str
|
||||
choices: [ datagram, connected ]
|
||||
version_added: 5.8.0
|
||||
slave_type:
|
||||
description:
|
||||
- Type of the device of this slave's master connection (for example C(bond)).
|
||||
type: str
|
||||
choices: [ 'bond', 'bridge', 'team' ]
|
||||
version_added: 7.0.0
|
||||
master:
|
||||
description:
|
||||
- Master <master (ifname, or connection UUID or conn_name) of bridge, team, bond master connection profile.
|
||||
- Mandatory if I(slave_type) is defined.
|
||||
type: str
|
||||
ip4:
|
||||
description:
|
||||
@@ -397,9 +406,9 @@ options:
|
||||
description:
|
||||
- This is only used with 'bridge-slave' - 'hairpin mode' for the slave, which allows frames to be sent back out through the slave the
|
||||
frame was received on.
|
||||
- The default value is C(true), but that is being deprecated
|
||||
and it will be changed to C(false) in community.general 7.0.0.
|
||||
- The default change to C(false) in community.general 7.0.0. It used to be C(true) before.
|
||||
type: bool
|
||||
default: false
|
||||
runner:
|
||||
description:
|
||||
- This is the type of device or network connection that you wish to create for a team.
|
||||
@@ -1429,6 +1438,39 @@ EXAMPLES = r'''
|
||||
autoconnect: false
|
||||
state: present
|
||||
|
||||
## Creating bond attached to bridge example
|
||||
- name: Create bond attached to bridge
|
||||
community.general.nmcli:
|
||||
type: bond
|
||||
conn_name: bond0
|
||||
slave_type: bridge
|
||||
master: br0
|
||||
state: present
|
||||
|
||||
- name: Create master bridge
|
||||
community.general.nmcli:
|
||||
type: bridge
|
||||
conn_name: br0
|
||||
method4: disabled
|
||||
method6: disabled
|
||||
state: present
|
||||
|
||||
## Creating vlan connection attached to bridge
|
||||
- name: Create master bridge
|
||||
community.general.nmcli:
|
||||
type: bridge
|
||||
conn_name: br0
|
||||
state: present
|
||||
|
||||
- name: Create VLAN 5
|
||||
community.general.nmcli:
|
||||
type: vlan
|
||||
conn_name: eth0.5
|
||||
slave_type: bridge
|
||||
master: br0
|
||||
vlandev: eth0
|
||||
vlanid: 5
|
||||
state: present
|
||||
'''
|
||||
|
||||
RETURN = r"""#
|
||||
@@ -1475,6 +1517,7 @@ class Nmcli(object):
|
||||
self.ignore_unsupported_suboptions = module.params['ignore_unsupported_suboptions']
|
||||
self.autoconnect = module.params['autoconnect']
|
||||
self.conn_name = module.params['conn_name']
|
||||
self.slave_type = module.params['slave_type']
|
||||
self.master = module.params['master']
|
||||
self.ifname = module.params['ifname']
|
||||
self.type = module.params['type']
|
||||
@@ -1519,8 +1562,7 @@ class Nmcli(object):
|
||||
self.hellotime = module.params['hellotime']
|
||||
self.maxage = module.params['maxage']
|
||||
self.ageingtime = module.params['ageingtime']
|
||||
# hairpin should be back to normal in 7.0.0
|
||||
self._hairpin = module.params['hairpin']
|
||||
self.hairpin = module.params['hairpin']
|
||||
self.path_cost = module.params['path_cost']
|
||||
self.mac = module.params['mac']
|
||||
self.runner = module.params['runner']
|
||||
@@ -1571,17 +1613,13 @@ class Nmcli(object):
|
||||
|
||||
self.edit_commands = []
|
||||
|
||||
@property
|
||||
def hairpin(self):
|
||||
if self._hairpin is None:
|
||||
self.module.deprecate(
|
||||
"Parameter 'hairpin' default value will change from true to false in community.general 7.0.0. "
|
||||
"Set the value explicitly to suppress this warning.",
|
||||
version='7.0.0', collection_name='community.general',
|
||||
)
|
||||
# Should be False in 7.0.0 but then that should be in argument_specs
|
||||
self._hairpin = True
|
||||
return self._hairpin
|
||||
self.extra_options_validation()
|
||||
|
||||
def extra_options_validation(self):
|
||||
""" Additional validation of options set passed to module that cannot be implemented in module's argspecs. """
|
||||
if self.type not in ("bridge-slave", "team-slave", "bond-slave"):
|
||||
if self.master is None and self.slave_type is not None:
|
||||
self.module.fail_json(msg="'master' option is required when 'slave_type' is specified.")
|
||||
|
||||
def execute_command(self, cmd, use_unsafe_shell=False, data=None):
|
||||
if isinstance(cmd, list):
|
||||
@@ -1647,6 +1685,7 @@ class Nmcli(object):
|
||||
if self.slave_conn_type:
|
||||
options.update({
|
||||
'connection.master': self.master,
|
||||
'connection.slave-type': self.slave_type,
|
||||
})
|
||||
|
||||
# Options specific to a connection type.
|
||||
@@ -1662,9 +1701,17 @@ class Nmcli(object):
|
||||
'xmit_hash_policy': self.xmit_hash_policy,
|
||||
})
|
||||
elif self.type == 'bond-slave':
|
||||
options.update({
|
||||
'connection.slave-type': 'bond',
|
||||
})
|
||||
if self.slave_type and self.slave_type != 'bond':
|
||||
self.module.fail_json(msg="Connection type '%s' cannot be combined with '%s' slave-type. "
|
||||
"Allowed slave-type for '%s' is 'bond'."
|
||||
% (self.type, self.slave_type, self.type)
|
||||
)
|
||||
if not self.slave_type:
|
||||
self.module.warn("Connection 'slave-type' property automatically set to 'bond' "
|
||||
"because of using 'bond-slave' connection type.")
|
||||
options.update({
|
||||
'connection.slave-type': 'bond',
|
||||
})
|
||||
elif self.type == 'bridge':
|
||||
options.update({
|
||||
'bridge.ageing-time': self.ageingtime,
|
||||
@@ -1688,16 +1735,36 @@ class Nmcli(object):
|
||||
'team.runner-fast-rate': self.runner_fast_rate,
|
||||
})
|
||||
elif self.type == 'bridge-slave':
|
||||
if self.slave_type and self.slave_type != 'bridge':
|
||||
self.module.fail_json(msg="Connection type '%s' cannot be combined with '%s' slave-type. "
|
||||
"Allowed slave-type for '%s' is 'bridge'."
|
||||
% (self.type, self.slave_type, self.type)
|
||||
)
|
||||
if not self.slave_type:
|
||||
self.module.warn("Connection 'slave-type' property automatically set to 'bridge' "
|
||||
"because of using 'bridge-slave' connection type.")
|
||||
options.update({'connection.slave-type': 'bridge'})
|
||||
self.module.warn(
|
||||
"Connection type as 'bridge-slave' implies 'ethernet' connection with 'bridge' slave-type. "
|
||||
"Consider using slave_type='bridge' with necessary type."
|
||||
)
|
||||
options.update({
|
||||
'connection.slave-type': 'bridge',
|
||||
'bridge-port.path-cost': self.path_cost,
|
||||
'bridge-port.hairpin-mode': self.hairpin,
|
||||
'bridge-port.priority': self.slavepriority,
|
||||
})
|
||||
elif self.type == 'team-slave':
|
||||
options.update({
|
||||
'connection.slave-type': 'team',
|
||||
})
|
||||
if self.slave_type and self.slave_type != 'team':
|
||||
self.module.fail_json(msg="Connection type '%s' cannot be combined with '%s' slave-type. "
|
||||
"Allowed slave-type for '%s' is 'team'."
|
||||
% (self.type, self.slave_type, self.type)
|
||||
)
|
||||
if not self.slave_type:
|
||||
self.module.warn("Connection 'slave-type' property automatically set to 'team' "
|
||||
"because of using 'team-slave' connection type.")
|
||||
options.update({
|
||||
'connection.slave-type': 'team',
|
||||
})
|
||||
elif self.tunnel_conn_type:
|
||||
options.update({
|
||||
'ip-tunnel.local': self.ip_tunnel_local,
|
||||
@@ -1882,6 +1949,12 @@ class Nmcli(object):
|
||||
@property
|
||||
def slave_conn_type(self):
|
||||
return self.type in (
|
||||
'ethernet',
|
||||
'bridge',
|
||||
'bond',
|
||||
'vlan',
|
||||
'team',
|
||||
'wifi',
|
||||
'bond-slave',
|
||||
'bridge-slave',
|
||||
'team-slave',
|
||||
@@ -2046,9 +2119,6 @@ class Nmcli(object):
|
||||
if key in self.SECRET_OPTIONS:
|
||||
self.edit_commands += ['set %s %s' % (key, value)]
|
||||
continue
|
||||
if key == 'xmit_hash_policy':
|
||||
cmd.extend(['+bond.options', 'xmit_hash_policy=%s' % value])
|
||||
continue
|
||||
cmd.extend([key, value])
|
||||
|
||||
return self.execute_command(cmd)
|
||||
@@ -2276,6 +2346,7 @@ def main():
|
||||
state=dict(type='str', required=True, choices=['absent', 'present']),
|
||||
conn_name=dict(type='str', required=True),
|
||||
master=dict(type='str'),
|
||||
slave_type=dict(type='str', choices=['bond', 'bridge', 'team']),
|
||||
ifname=dict(type='str'),
|
||||
type=dict(type='str',
|
||||
choices=[
|
||||
@@ -2369,7 +2440,7 @@ def main():
|
||||
hellotime=dict(type='int', default=2),
|
||||
maxage=dict(type='int', default=20),
|
||||
ageingtime=dict(type='int', default=300),
|
||||
hairpin=dict(type='bool'),
|
||||
hairpin=dict(type='bool', default=False),
|
||||
path_cost=dict(type='int', default=100),
|
||||
# team specific vars
|
||||
runner=dict(type='str', default='roundrobin',
|
||||
@@ -2432,7 +2503,7 @@ def main():
|
||||
if nmcli.runner_fast_rate is not None and nmcli.runner != "lacp":
|
||||
nmcli.module.fail_json(msg="runner-fast-rate is only allowed for runner lacp")
|
||||
# team-slave checks
|
||||
if nmcli.type == 'team-slave':
|
||||
if nmcli.type == 'team-slave' or nmcli.slave_type == 'team':
|
||||
if nmcli.master is None:
|
||||
nmcli.module.fail_json(msg="Please specify a name for the master when type is %s" % nmcli.type)
|
||||
if nmcli.ifname is None:
|
||||
|
||||
@@ -333,9 +333,9 @@ def emerge_packages(module, packages):
|
||||
"""Run emerge command against given list of atoms."""
|
||||
p = module.params
|
||||
|
||||
if p['noreplace'] and not p['changed_use'] and not p['newuse'] and not (p['update'] or p['state'] == 'latest'):
|
||||
if p['noreplace'] and not (p['update'] or p['state'] == 'latest'):
|
||||
for package in packages:
|
||||
if p['noreplace'] and not p['changed_use'] and not p['newuse'] and not query_package(module, package, 'emerge'):
|
||||
if p['noreplace'] and not query_package(module, package, 'emerge'):
|
||||
break
|
||||
else:
|
||||
module.exit_json(changed=False, msg='Packages already present.')
|
||||
|
||||
@@ -154,10 +154,9 @@ options:
|
||||
unprivileged:
|
||||
description:
|
||||
- Indicate if the container should be unprivileged.
|
||||
- >
|
||||
The default value for this parameter is C(false) but that is deprecated
|
||||
and it will be replaced with C(true) in community.general 7.0.0.
|
||||
- The default change to C(true) in community.general 7.0.0. It used to be C(false) before.
|
||||
type: bool
|
||||
default: true
|
||||
description:
|
||||
description:
|
||||
- Specify the description for the container. Only used on the configuration web interface.
|
||||
@@ -600,7 +599,7 @@ def main():
|
||||
purge=dict(type='bool', default=False),
|
||||
state=dict(default='present', choices=['present', 'absent', 'stopped', 'started', 'restarted']),
|
||||
pubkey=dict(type='str'),
|
||||
unprivileged=dict(type='bool'),
|
||||
unprivileged=dict(type='bool', default=True),
|
||||
description=dict(type='str'),
|
||||
hookscript=dict(type='str'),
|
||||
proxmox_default_behavior=dict(type='str', default='no_defaults', choices=['compatibility', 'no_defaults']),
|
||||
@@ -643,14 +642,6 @@ def main():
|
||||
timeout = module.params['timeout']
|
||||
clone = module.params['clone']
|
||||
|
||||
if module.params['unprivileged'] is None:
|
||||
module.params['unprivileged'] = False
|
||||
module.deprecate(
|
||||
'The default value `false` for the parameter "unprivileged" is deprecated and it will be replaced with `true`',
|
||||
version='7.0.0',
|
||||
collection_name='community.general'
|
||||
)
|
||||
|
||||
if module.params['proxmox_default_behavior'] == 'compatibility':
|
||||
old_default_values = dict(
|
||||
disk="3",
|
||||
|
||||
@@ -270,6 +270,12 @@ options:
|
||||
- Memory size in MB for instance.
|
||||
- This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(512).
|
||||
type: int
|
||||
migrate:
|
||||
description:
|
||||
- Migrate the VM to I(node) if it is on another node.
|
||||
type: bool
|
||||
default: false
|
||||
version_added: 7.0.0
|
||||
migrate_downtime:
|
||||
description:
|
||||
- Sets maximum tolerated downtime (in seconds) for migrations.
|
||||
@@ -791,6 +797,15 @@ EXAMPLES = '''
|
||||
name: spynal
|
||||
node: sabrewulf
|
||||
revert: 'template,cpulimit'
|
||||
|
||||
- name: Migrate VM on second node
|
||||
community.general.proxmox_kvm:
|
||||
api_user: root@pam
|
||||
api_password: secret
|
||||
api_host: helldorado
|
||||
name: spynal
|
||||
node: sabrewulf-2
|
||||
migrate: true
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
@@ -1053,6 +1068,16 @@ class ProxmoxKvmAnsible(ProxmoxAnsible):
|
||||
return False
|
||||
return True
|
||||
|
||||
def migrate_vm(self, vm, target_node):
|
||||
vmid = vm['vmid']
|
||||
proxmox_node = self.proxmox_api.nodes(vm['node'])
|
||||
taskid = proxmox_node.qemu(vmid).migrate.post(vmid=vmid, node=vm['node'], target=target_node, online=1)
|
||||
if not self.wait_for_task(vm['node'], taskid):
|
||||
self.module.fail_json(msg='Reached timeout while waiting for migrating VM. Last line in task before timeout: %s' %
|
||||
proxmox_node.tasks(taskid).log.get()[:1])
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def main():
|
||||
module_args = proxmox_auth_argument_spec()
|
||||
@@ -1100,6 +1125,7 @@ def main():
|
||||
lock=dict(choices=['migrate', 'backup', 'snapshot', 'rollback']),
|
||||
machine=dict(type='str'),
|
||||
memory=dict(type='int'),
|
||||
migrate=dict(type='bool', default=False),
|
||||
migrate_downtime=dict(type='int'),
|
||||
migrate_speed=dict(type='int'),
|
||||
name=dict(type='str'),
|
||||
@@ -1159,6 +1185,7 @@ def main():
|
||||
cpu = module.params['cpu']
|
||||
cores = module.params['cores']
|
||||
delete = module.params['delete']
|
||||
migrate = module.params['migrate']
|
||||
memory = module.params['memory']
|
||||
name = module.params['name']
|
||||
newid = module.params['newid']
|
||||
@@ -1200,7 +1227,7 @@ def main():
|
||||
# If vmid is not defined then retrieve its value from the vm name,
|
||||
# the cloned vm name or retrieve the next free VM id from ProxmoxAPI.
|
||||
if not vmid:
|
||||
if state == 'present' and not update and not clone and not delete and not revert:
|
||||
if state == 'present' and not update and not clone and not delete and not revert and not migrate:
|
||||
try:
|
||||
vmid = proxmox.get_nextvmid()
|
||||
except Exception:
|
||||
@@ -1247,6 +1274,18 @@ def main():
|
||||
except Exception as e:
|
||||
module.fail_json(vmid=vmid, msg='Unable to revert settings on VM {0} with vmid {1}: Maybe is not a pending task... '.format(name, vmid) + str(e))
|
||||
|
||||
if migrate:
|
||||
try:
|
||||
vm = proxmox.get_vm(vmid)
|
||||
vm_node = vm['node']
|
||||
if node != vm_node:
|
||||
proxmox.migrate_vm(vm, node)
|
||||
module.exit_json(changed=True, vmid=vmid, msg="VM {0} has been migrated from {1} to {2}".format(vmid, vm_node, node))
|
||||
else:
|
||||
module.exit_json(changed=False, vmid=vmid, msg="VM {0} is already on {1}".format(vmid, node))
|
||||
except Exception as e:
|
||||
module.fail_json(vmid=vmid, msg='Unable to migrate VM {0} from {1} to {2}: {3}'.format(vmid, vm_node, node, e))
|
||||
|
||||
if state == 'present':
|
||||
try:
|
||||
if proxmox.get_vm(vmid, ignore_missing=True) and not (update or clone):
|
||||
|
||||
@@ -160,7 +160,8 @@ def main():
|
||||
|
||||
module = AnsibleModule(
|
||||
argument_spec=module_args,
|
||||
required_together=[('api_token_id', 'api_token_secret')],
|
||||
required_together=[('api_token_id', 'api_token_secret'),
|
||||
('api_user', 'api_password')],
|
||||
required_one_of=[('api_password', 'api_token_id')],
|
||||
supports_check_mode=True)
|
||||
result = dict(changed=False)
|
||||
|
||||
@@ -114,8 +114,6 @@ options:
|
||||
show_diff:
|
||||
description:
|
||||
- Whether to print file changes details
|
||||
- Alias C(show-diff) has been deprecated and will be removed in community.general 7.0.0.
|
||||
aliases: ['show-diff']
|
||||
type: bool
|
||||
default: false
|
||||
requirements:
|
||||
@@ -198,9 +196,7 @@ def main():
|
||||
noop=dict(type='bool'),
|
||||
logdest=dict(type='str', default='stdout', choices=['all', 'stdout', 'syslog']),
|
||||
# The following is not related to Ansible's diff; see https://github.com/ansible-collections/community.general/pull/3980#issuecomment-1005666154
|
||||
show_diff=dict(
|
||||
type='bool', default=False, aliases=['show-diff'],
|
||||
deprecated_aliases=[dict(name='show-diff', version='7.0.0', collection_name='community.general')]),
|
||||
show_diff=dict(type='bool', default=False),
|
||||
facts=dict(type='dict'),
|
||||
facter_basename=dict(type='str', default='ansible'),
|
||||
environment=dict(type='str'),
|
||||
|
||||
@@ -13,9 +13,7 @@ DOCUMENTATION = '''
|
||||
module: rax_cbs
|
||||
short_description: Manipulate Rackspace Cloud Block Storage Volumes
|
||||
description:
|
||||
- Manipulate Rackspace Cloud Block Storage Volumes
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Manipulate Rackspace Cloud Block Storage Volumes
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -13,9 +13,7 @@ DOCUMENTATION = '''
|
||||
module: rax_cbs_attachments
|
||||
short_description: Manipulate Rackspace Cloud Block Storage Volume Attachments
|
||||
description:
|
||||
- Manipulate Rackspace Cloud Block Storage Volume Attachments
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Manipulate Rackspace Cloud Block Storage Volume Attachments
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -16,8 +16,6 @@ description:
|
||||
- creates / deletes or resize a Rackspace Cloud Databases instance
|
||||
and optionally waits for it to be 'running'. The name option needs to be
|
||||
unique since it's used to identify the instance.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -13,8 +13,6 @@ module: rax_cdb_database
|
||||
short_description: Create / delete a database in the Cloud Databases
|
||||
description:
|
||||
- create / delete a database in the Cloud Databases.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -14,8 +14,6 @@ module: rax_cdb_user
|
||||
short_description: Create / delete a Rackspace Cloud Database
|
||||
description:
|
||||
- create / delete a database in the Cloud Databases.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -13,9 +13,7 @@ DOCUMENTATION = '''
|
||||
module: rax_clb
|
||||
short_description: Create / delete a load balancer in Rackspace Public Cloud
|
||||
description:
|
||||
- creates / deletes a Rackspace Public Cloud load balancer.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- creates / deletes a Rackspace Public Cloud load balancer.
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -13,9 +13,7 @@ DOCUMENTATION = '''
|
||||
module: rax_clb_nodes
|
||||
short_description: Add, modify and remove nodes from a Rackspace Cloud Load Balancer
|
||||
description:
|
||||
- Adds, modifies and removes nodes from a Rackspace Cloud Load Balancer.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Adds, modifies and removes nodes from a Rackspace Cloud Load Balancer
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -12,9 +12,7 @@ DOCUMENTATION = '''
|
||||
module: rax_clb_ssl
|
||||
short_description: Manage SSL termination for a Rackspace Cloud Load Balancer
|
||||
description:
|
||||
- Set up, reconfigure, or remove SSL termination for an existing load balancer.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Set up, reconfigure, or remove SSL termination for an existing load balancer.
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -13,9 +13,7 @@ DOCUMENTATION = '''
|
||||
module: rax_dns
|
||||
short_description: Manage domains on Rackspace Cloud DNS
|
||||
description:
|
||||
- Manage domains on Rackspace Cloud DNS.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Manage domains on Rackspace Cloud DNS
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -13,9 +13,7 @@ DOCUMENTATION = '''
|
||||
module: rax_dns_record
|
||||
short_description: Manage DNS records on Rackspace Cloud DNS
|
||||
description:
|
||||
- Manage DNS records on Rackspace Cloud DNS.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Manage DNS records on Rackspace Cloud DNS
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -14,8 +14,6 @@ module: rax_facts
|
||||
short_description: Gather facts for Rackspace Cloud Servers
|
||||
description:
|
||||
- Gather facts for Rackspace Cloud Servers.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
attributes:
|
||||
check_mode:
|
||||
version_added: 3.3.0
|
||||
|
||||
@@ -13,9 +13,7 @@ DOCUMENTATION = '''
|
||||
module: rax_files
|
||||
short_description: Manipulate Rackspace Cloud Files Containers
|
||||
description:
|
||||
- Manipulate Rackspace Cloud Files Containers.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Manipulate Rackspace Cloud Files Containers
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -14,8 +14,6 @@ module: rax_files_objects
|
||||
short_description: Upload, download, and delete objects in Rackspace Cloud Files
|
||||
description:
|
||||
- Upload, download, and delete objects in Rackspace Cloud Files.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -13,9 +13,7 @@ DOCUMENTATION = '''
|
||||
module: rax_identity
|
||||
short_description: Load Rackspace Cloud Identity
|
||||
description:
|
||||
- Verifies Rackspace Cloud credentials and returns identity information.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Verifies Rackspace Cloud credentials and returns identity information
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -13,9 +13,7 @@ DOCUMENTATION = '''
|
||||
module: rax_keypair
|
||||
short_description: Create a keypair for use with Rackspace Cloud Servers
|
||||
description:
|
||||
- Create a keypair for use with Rackspace Cloud Servers.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Create a keypair for use with Rackspace Cloud Servers
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -13,9 +13,7 @@ DOCUMENTATION = '''
|
||||
module: rax_meta
|
||||
short_description: Manipulate metadata for Rackspace Cloud Servers
|
||||
description:
|
||||
- Manipulate metadata for Rackspace Cloud Servers.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Manipulate metadata for Rackspace Cloud Servers
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -13,14 +13,12 @@ DOCUMENTATION = '''
|
||||
module: rax_mon_alarm
|
||||
short_description: Create or delete a Rackspace Cloud Monitoring alarm
|
||||
description:
|
||||
- Create or delete a Rackspace Cloud Monitoring alarm that associates an
|
||||
existing rax_mon_entity, rax_mon_check, and rax_mon_notification_plan with
|
||||
criteria that specify what conditions will trigger which levels of
|
||||
notifications. Rackspace monitoring module flow | rax_mon_entity ->
|
||||
rax_mon_check -> rax_mon_notification -> rax_mon_notification_plan ->
|
||||
*rax_mon_alarm*.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Create or delete a Rackspace Cloud Monitoring alarm that associates an
|
||||
existing rax_mon_entity, rax_mon_check, and rax_mon_notification_plan with
|
||||
criteria that specify what conditions will trigger which levels of
|
||||
notifications. Rackspace monitoring module flow | rax_mon_entity ->
|
||||
rax_mon_check -> rax_mon_notification -> rax_mon_notification_plan ->
|
||||
*rax_mon_alarm*
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -14,14 +14,12 @@ module: rax_mon_check
|
||||
short_description: Create or delete a Rackspace Cloud Monitoring check for an
|
||||
existing entity.
|
||||
description:
|
||||
- Create or delete a Rackspace Cloud Monitoring check associated with an
|
||||
existing rax_mon_entity. A check is a specific test or measurement that is
|
||||
performed, possibly from different monitoring zones, on the systems you
|
||||
monitor. Rackspace monitoring module flow | rax_mon_entity ->
|
||||
*rax_mon_check* -> rax_mon_notification -> rax_mon_notification_plan ->
|
||||
rax_mon_alarm
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Create or delete a Rackspace Cloud Monitoring check associated with an
|
||||
existing rax_mon_entity. A check is a specific test or measurement that is
|
||||
performed, possibly from different monitoring zones, on the systems you
|
||||
monitor. Rackspace monitoring module flow | rax_mon_entity ->
|
||||
*rax_mon_check* -> rax_mon_notification -> rax_mon_notification_plan ->
|
||||
rax_mon_alarm
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -13,13 +13,11 @@ DOCUMENTATION = '''
|
||||
module: rax_mon_entity
|
||||
short_description: Create or delete a Rackspace Cloud Monitoring entity
|
||||
description:
|
||||
- Create or delete a Rackspace Cloud Monitoring entity, which represents a device
|
||||
to monitor. Entities associate checks and alarms with a target system and
|
||||
provide a convenient, centralized place to store IP addresses. Rackspace
|
||||
monitoring module flow | *rax_mon_entity* -> rax_mon_check ->
|
||||
rax_mon_notification -> rax_mon_notification_plan -> rax_mon_alarm.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Create or delete a Rackspace Cloud Monitoring entity, which represents a device
|
||||
to monitor. Entities associate checks and alarms with a target system and
|
||||
provide a convenient, centralized place to store IP addresses. Rackspace
|
||||
monitoring module flow | *rax_mon_entity* -> rax_mon_check ->
|
||||
rax_mon_notification -> rax_mon_notification_plan -> rax_mon_alarm
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -14,12 +14,10 @@ module: rax_mon_notification_plan
|
||||
short_description: Create or delete a Rackspace Cloud Monitoring notification
|
||||
plan.
|
||||
description:
|
||||
- Create or delete a Rackspace Cloud Monitoring notification plan by
|
||||
associating existing rax_mon_notifications with severity levels. Rackspace
|
||||
monitoring module flow | rax_mon_entity -> rax_mon_check ->
|
||||
rax_mon_notification -> *rax_mon_notification_plan* -> rax_mon_alarm.
|
||||
- This module relies on the C(pyrax) package which is deprecated in favour of using Openstack API.
|
||||
- Unless maintainers step up to work on the module, it will be marked as deprecated in community.general 7.0.0 and removed in version 9.0.0.
|
||||
- Create or delete a Rackspace Cloud Monitoring notification plan by
|
||||
associating existing rax_mon_notifications with severity levels. Rackspace
|
||||
monitoring module flow | rax_mon_entity -> rax_mon_check ->
|
||||
rax_mon_notification -> *rax_mon_notification_plan* -> rax_mon_alarm
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
|
||||
@@ -67,6 +67,16 @@ options:
|
||||
type: bool
|
||||
default: true
|
||||
version_added: '0.2.0'
|
||||
deprecated:
|
||||
removed_in: 10.0.0
|
||||
why: |
|
||||
RHN hosted at redhat.com was discontinued years ago, and Spacewalk 5
|
||||
(which uses RHN) is EOL since 2020, May 31st; while this module could
|
||||
work on Uyuni / SUSE Manager (fork of Spacewalk 5), we have not heard
|
||||
about anyone using it in those setups.
|
||||
alternative: |
|
||||
Contact the community.general maintainers to report the usage of this
|
||||
module, and potentially step up to maintain it.
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
||||
@@ -88,6 +88,16 @@ options:
|
||||
- If C(true), the registered node will not upload its installed packages information to Satellite server.
|
||||
type: bool
|
||||
default: false
|
||||
deprecated:
|
||||
removed_in: 10.0.0
|
||||
why: |
|
||||
RHN hosted at redhat.com was discontinued years ago, and Spacewalk 5
|
||||
(which uses RHN) is EOL since 2020, May 31st; while this module could
|
||||
work on Uyuni / SUSE Manager (fork of Spacewalk 5), we have not heard
|
||||
about anyone using it in those setups.
|
||||
alternative: |
|
||||
Contact the community.general maintainers to report the usage of this
|
||||
module, and potentially step up to maintain it.
|
||||
'''
|
||||
|
||||
EXAMPLES = r'''
|
||||
|
||||
@@ -1,348 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (c) 2021, Rainer Leber <rainerleber@gmail.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'''
|
||||
---
|
||||
module: sap_task_list_execute
|
||||
short_description: Perform SAP Task list execution
|
||||
version_added: "3.5.0"
|
||||
description:
|
||||
- The C(sap_task_list_execute) module depends on C(pyrfc) Python library (version 2.4.0 and upwards).
|
||||
Depending on distribution you are using, you may need to install additional packages to
|
||||
have these available.
|
||||
- Tasks in the task list which requires manual activities will be confirmed automatically.
|
||||
- This module will use the RFC package C(STC_TM_API).
|
||||
extends_documentation_fragment:
|
||||
- community.general.attributes
|
||||
attributes:
|
||||
check_mode:
|
||||
support: none
|
||||
diff_mode:
|
||||
support: none
|
||||
|
||||
requirements:
|
||||
- pyrfc >= 2.4.0
|
||||
- xmltodict
|
||||
|
||||
options:
|
||||
conn_username:
|
||||
description: The required username for the SAP system.
|
||||
required: true
|
||||
type: str
|
||||
conn_password:
|
||||
description: The required password for the SAP system.
|
||||
required: true
|
||||
type: str
|
||||
host:
|
||||
description: The required host for the SAP system. Can be either an FQDN or IP Address.
|
||||
required: true
|
||||
type: str
|
||||
sysnr:
|
||||
description:
|
||||
- The system number of the SAP system.
|
||||
- You must quote the value to ensure retaining the leading zeros.
|
||||
default: '00'
|
||||
type: str
|
||||
client:
|
||||
description:
|
||||
- The client number to connect to.
|
||||
- You must quote the value to ensure retaining the leading zeros.
|
||||
default: '000'
|
||||
type: str
|
||||
task_to_execute:
|
||||
description: The task list which will be executed.
|
||||
required: true
|
||||
type: str
|
||||
task_parameters:
|
||||
description:
|
||||
- The tasks and the parameters for execution.
|
||||
- If the task list do not need any parameters. This could be empty.
|
||||
- If only specific tasks from the task list should be executed.
|
||||
The tasks even when no parameter is needed must be provided.
|
||||
Alongside with the module parameter I(task_skip=true).
|
||||
type: list
|
||||
elements: dict
|
||||
suboptions:
|
||||
TASKNAME:
|
||||
description: The name of the task in the task list.
|
||||
type: str
|
||||
required: true
|
||||
FIELDNAME:
|
||||
description: The name of the field of the task.
|
||||
type: str
|
||||
VALUE:
|
||||
description: The value which have to be set.
|
||||
type: raw
|
||||
task_settings:
|
||||
description:
|
||||
- Setting for the execution of the task list. This can be the following as in TCODE SE80 described.
|
||||
Check Mode C(CHECKRUN), Background Processing Active C(BATCH) (this is the default value),
|
||||
Asynchronous Execution C(ASYNC), Trace Mode C(TRACE), Server Name C(BATCH_TARGET).
|
||||
default: ['BATCH']
|
||||
type: list
|
||||
elements: str
|
||||
task_skip:
|
||||
description:
|
||||
- If this parameter is C(true) not defined tasks in I(task_parameters) are skipped.
|
||||
- This could be the case when only certain tasks should run from the task list.
|
||||
default: false
|
||||
type: bool
|
||||
|
||||
author:
|
||||
- Rainer Leber (@rainerleber)
|
||||
'''
|
||||
|
||||
EXAMPLES = r'''
|
||||
# Pass in a message
|
||||
- name: Test task execution
|
||||
community.general.sap_task_list_execute:
|
||||
conn_username: DDIC
|
||||
conn_password: Passwd1234
|
||||
host: 10.1.8.10
|
||||
sysnr: '01'
|
||||
client: '000'
|
||||
task_to_execute: SAP_BASIS_SSL_CHECK
|
||||
task_settings: batch
|
||||
|
||||
- name: Pass in input parameters
|
||||
community.general.sap_task_list_execute:
|
||||
conn_username: DDIC
|
||||
conn_password: Passwd1234
|
||||
host: 10.1.8.10
|
||||
sysnr: '00'
|
||||
client: '000'
|
||||
task_to_execute: SAP_BASIS_SSL_CHECK
|
||||
task_parameters :
|
||||
- { 'TASKNAME': 'CL_STCT_CHECK_SEC_CRYPTO', 'FIELDNAME': 'P_OPT2', 'VALUE': 'X' }
|
||||
- TASKNAME: CL_STCT_CHECK_SEC_CRYPTO
|
||||
FIELDNAME: P_OPT3
|
||||
VALUE: X
|
||||
task_settings: batch
|
||||
|
||||
# Exported environement variables.
|
||||
- name: Hint if module will fail with error message like ImportError libsapnwrfc.so...
|
||||
community.general.sap_task_list_execute:
|
||||
conn_username: DDIC
|
||||
conn_password: Passwd1234
|
||||
host: 10.1.8.10
|
||||
sysnr: '00'
|
||||
client: '000'
|
||||
task_to_execute: SAP_BASIS_SSL_CHECK
|
||||
task_settings: batch
|
||||
environment:
|
||||
SAPNWRFC_HOME: /usr/local/sap/nwrfcsdk
|
||||
LD_LIBRARY_PATH: /usr/local/sap/nwrfcsdk/lib
|
||||
'''
|
||||
|
||||
RETURN = r'''
|
||||
msg:
|
||||
description: A small execution description.
|
||||
type: str
|
||||
returned: always
|
||||
sample: 'Successful'
|
||||
out:
|
||||
description: A complete description of the executed tasks. If this is available.
|
||||
type: list
|
||||
elements: dict
|
||||
returned: on success
|
||||
sample: [...,{
|
||||
"LOG": {
|
||||
"STCTM_S_LOG": [
|
||||
{
|
||||
"ACTIVITY": "U_CONFIG",
|
||||
"ACTIVITY_DESCR": "Configuration changed",
|
||||
"DETAILS": null,
|
||||
"EXEC_ID": "20210728184903.815739",
|
||||
"FIELD": null,
|
||||
"ID": "STC_TASK",
|
||||
"LOG_MSG_NO": "000000",
|
||||
"LOG_NO": null,
|
||||
"MESSAGE": "For radiobutton group ICM too many options are set; choose only one option",
|
||||
"MESSAGE_V1": "ICM",
|
||||
"MESSAGE_V2": null,
|
||||
"MESSAGE_V3": null,
|
||||
"MESSAGE_V4": null,
|
||||
"NUMBER": "048",
|
||||
"PARAMETER": null,
|
||||
"PERIOD": "M",
|
||||
"PERIOD_DESCR": "Maintenance",
|
||||
"ROW": "0",
|
||||
"SRC_LINE": "170",
|
||||
"SRC_OBJECT": "CL_STCTM_REPORT_UI IF_STCTM_UI_TASK~SET_PARAMETERS",
|
||||
"SYSTEM": null,
|
||||
"TIMESTMP": "20210728184903",
|
||||
"TSTPNM": "DDIC",
|
||||
"TYPE": "E"
|
||||
},...
|
||||
]}}]
|
||||
'''
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||
import traceback
|
||||
try:
|
||||
from pyrfc import Connection
|
||||
except ImportError:
|
||||
HAS_PYRFC_LIBRARY = False
|
||||
PYRFC_LIBRARY_IMPORT_ERROR = traceback.format_exc()
|
||||
else:
|
||||
HAS_PYRFC_LIBRARY = True
|
||||
PYRFC_LIBRARY_IMPORT_ERROR = None
|
||||
try:
|
||||
import xmltodict
|
||||
except ImportError:
|
||||
HAS_XMLTODICT_LIBRARY = False
|
||||
XMLTODICT_LIBRARY_IMPORT_ERROR = traceback.format_exc()
|
||||
else:
|
||||
HAS_XMLTODICT_LIBRARY = True
|
||||
XMLTODICT_LIBRARY_IMPORT_ERROR = None
|
||||
|
||||
|
||||
def call_rfc_method(connection, method_name, kwargs):
|
||||
# PyRFC call function
|
||||
return connection.call(method_name, **kwargs)
|
||||
|
||||
|
||||
def process_exec_settings(task_settings):
|
||||
# processes task settings to objects
|
||||
exec_settings = {}
|
||||
for settings in task_settings:
|
||||
temp_dict = {settings.upper(): 'X'}
|
||||
for key, value in temp_dict.items():
|
||||
exec_settings[key] = value
|
||||
return exec_settings
|
||||
|
||||
|
||||
def xml_to_dict(xml_raw):
|
||||
try:
|
||||
xml_parsed = xmltodict.parse(xml_raw, dict_constructor=dict)
|
||||
xml_dict = xml_parsed['asx:abap']['asx:values']['SESSION']['TASKLIST']
|
||||
except KeyError:
|
||||
xml_dict = "No logs available."
|
||||
return xml_dict
|
||||
|
||||
|
||||
def run_module():
|
||||
|
||||
params_spec = dict(
|
||||
TASKNAME=dict(type='str', required=True),
|
||||
FIELDNAME=dict(type='str'),
|
||||
VALUE=dict(type='raw'),
|
||||
)
|
||||
|
||||
# define available arguments/parameters a user can pass to the module
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
# values for connection
|
||||
conn_username=dict(type='str', required=True),
|
||||
conn_password=dict(type='str', required=True, no_log=True),
|
||||
host=dict(type='str', required=True),
|
||||
sysnr=dict(type='str', default="00"),
|
||||
client=dict(type='str', default="000"),
|
||||
# values for execution tasks
|
||||
task_to_execute=dict(type='str', required=True),
|
||||
task_parameters=dict(type='list', elements='dict', options=params_spec),
|
||||
task_settings=dict(type='list', elements='str', default=['BATCH']),
|
||||
task_skip=dict(type='bool', default=False),
|
||||
),
|
||||
supports_check_mode=False,
|
||||
)
|
||||
result = dict(changed=False, msg='', out={})
|
||||
|
||||
params = module.params
|
||||
|
||||
username = params['conn_username'].upper()
|
||||
password = params['conn_password']
|
||||
host = params['host']
|
||||
sysnr = params['sysnr']
|
||||
client = params['client']
|
||||
|
||||
task_parameters = params['task_parameters']
|
||||
task_to_execute = params['task_to_execute']
|
||||
task_settings = params['task_settings']
|
||||
task_skip = params['task_skip']
|
||||
|
||||
if not HAS_PYRFC_LIBRARY:
|
||||
module.fail_json(
|
||||
msg=missing_required_lib('pyrfc'),
|
||||
exception=PYRFC_LIBRARY_IMPORT_ERROR)
|
||||
|
||||
if not HAS_XMLTODICT_LIBRARY:
|
||||
module.fail_json(
|
||||
msg=missing_required_lib('xmltodict'),
|
||||
exception=XMLTODICT_LIBRARY_IMPORT_ERROR)
|
||||
|
||||
# basic RFC connection with pyrfc
|
||||
try:
|
||||
conn = Connection(user=username, passwd=password, ashost=host, sysnr=sysnr, client=client)
|
||||
except Exception as err:
|
||||
result['error'] = str(err)
|
||||
result['msg'] = 'Something went wrong connecting to the SAP system.'
|
||||
module.fail_json(**result)
|
||||
|
||||
try:
|
||||
raw_params = call_rfc_method(conn, 'STC_TM_SCENARIO_GET_PARAMETERS',
|
||||
{'I_SCENARIO_ID': task_to_execute})
|
||||
except Exception as err:
|
||||
result['error'] = str(err)
|
||||
result['msg'] = 'The task list does not exsist.'
|
||||
module.fail_json(**result)
|
||||
exec_settings = process_exec_settings(task_settings)
|
||||
# initialize session task
|
||||
session_init = call_rfc_method(conn, 'STC_TM_SESSION_BEGIN',
|
||||
{'I_SCENARIO_ID': task_to_execute,
|
||||
'I_INIT_ONLY': 'X'})
|
||||
# Confirm Tasks which requires manual activities from Task List Run
|
||||
for task in raw_params['ET_PARAMETER']:
|
||||
call_rfc_method(conn, 'STC_TM_TASK_CONFIRM',
|
||||
{'I_SESSION_ID': session_init['E_SESSION_ID'],
|
||||
'I_TASKNAME': task['TASKNAME']})
|
||||
if task_skip:
|
||||
for task in raw_params['ET_PARAMETER']:
|
||||
call_rfc_method(conn, 'STC_TM_TASK_SKIP',
|
||||
{'I_SESSION_ID': session_init['E_SESSION_ID'],
|
||||
'I_TASKNAME': task['TASKNAME'], 'I_SKIP_DEP_TASKS': 'X'})
|
||||
# unskip defined tasks and set parameters
|
||||
if task_parameters is not None:
|
||||
for task in task_parameters:
|
||||
call_rfc_method(conn, 'STC_TM_TASK_UNSKIP',
|
||||
{'I_SESSION_ID': session_init['E_SESSION_ID'],
|
||||
'I_TASKNAME': task['TASKNAME'], 'I_UNSKIP_DEP_TASKS': 'X'})
|
||||
|
||||
call_rfc_method(conn, 'STC_TM_SESSION_SET_PARAMETERS',
|
||||
{'I_SESSION_ID': session_init['E_SESSION_ID'],
|
||||
'IT_PARAMETER': task_parameters})
|
||||
# start the task
|
||||
try:
|
||||
session_start = call_rfc_method(conn, 'STC_TM_SESSION_RESUME',
|
||||
{'I_SESSION_ID': session_init['E_SESSION_ID'],
|
||||
'IS_EXEC_SETTINGS': exec_settings})
|
||||
except Exception as err:
|
||||
result['error'] = str(err)
|
||||
result['msg'] = 'Something went wrong. See error.'
|
||||
module.fail_json(**result)
|
||||
# get task logs because the execution may successfully but the tasks shows errors or warnings
|
||||
# returned value is ABAPXML https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/abenabap_xslt_asxml_general.htm
|
||||
session_log = call_rfc_method(conn, 'STC_TM_SESSION_GET_LOG',
|
||||
{'I_SESSION_ID': session_init['E_SESSION_ID']})
|
||||
|
||||
task_list = xml_to_dict(session_log['E_LOG'])
|
||||
|
||||
result['changed'] = True
|
||||
result['msg'] = session_start['E_STATUS_DESCR']
|
||||
result['out'] = task_list
|
||||
|
||||
module.exit_json(**result)
|
||||
|
||||
|
||||
def main():
|
||||
run_module()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,228 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (c) 2021, Rainer Leber <rainerleber@gmail.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 = '''
|
||||
---
|
||||
module: sapcar_extract
|
||||
short_description: Manages SAP SAPCAR archives
|
||||
version_added: "3.2.0"
|
||||
description:
|
||||
- Provides support for unpacking C(sar)/C(car) files with the SAPCAR binary from SAP and pulling
|
||||
information back into Ansible.
|
||||
extends_documentation_fragment:
|
||||
- community.general.attributes
|
||||
attributes:
|
||||
check_mode:
|
||||
support: partial
|
||||
details:
|
||||
- Always returns C(changed=true) in check mode.
|
||||
diff_mode:
|
||||
support: none
|
||||
options:
|
||||
path:
|
||||
description: The path to the SAR/CAR file.
|
||||
type: path
|
||||
required: true
|
||||
dest:
|
||||
description:
|
||||
- The destination where SAPCAR extracts the SAR file. Missing folders will be created.
|
||||
If this parameter is not provided it will unpack in the same folder as the SAR file.
|
||||
type: path
|
||||
binary_path:
|
||||
description:
|
||||
- The path to the SAPCAR binary, for example, C(/home/dummy/sapcar) or C(https://myserver/SAPCAR).
|
||||
If this parameter is not provided the module will look in C(PATH).
|
||||
type: path
|
||||
signature:
|
||||
description:
|
||||
- If C(true) the signature will be extracted.
|
||||
default: false
|
||||
type: bool
|
||||
security_library:
|
||||
description:
|
||||
- The path to the security library, for example, C(/usr/sap/hostctrl/exe/libsapcrytp.so), for signature operations.
|
||||
type: path
|
||||
manifest:
|
||||
description:
|
||||
- The name of the manifest.
|
||||
default: "SIGNATURE.SMF"
|
||||
type: str
|
||||
remove:
|
||||
description:
|
||||
- If C(true) the SAR/CAR file will be removed. B(This should be used with caution!)
|
||||
default: false
|
||||
type: bool
|
||||
author:
|
||||
- Rainer Leber (@RainerLeber)
|
||||
'''
|
||||
|
||||
EXAMPLES = """
|
||||
- name: Extract SAR file
|
||||
community.general.sapcar_extract:
|
||||
path: "~/source/hana.sar"
|
||||
|
||||
- name: Extract SAR file with destination
|
||||
community.general.sapcar_extract:
|
||||
path: "~/source/hana.sar"
|
||||
dest: "~/test/"
|
||||
|
||||
- name: Extract SAR file with destination and download from webserver can be a fileshare as well
|
||||
community.general.sapcar_extract:
|
||||
path: "~/source/hana.sar"
|
||||
dest: "~/dest/"
|
||||
binary_path: "https://myserver/SAPCAR"
|
||||
|
||||
- name: Extract SAR file and delete SAR after extract
|
||||
community.general.sapcar_extract:
|
||||
path: "~/source/hana.sar"
|
||||
remove: true
|
||||
|
||||
- name: Extract SAR file with manifest
|
||||
community.general.sapcar_extract:
|
||||
path: "~/source/hana.sar"
|
||||
signature: true
|
||||
|
||||
- name: Extract SAR file with manifest and rename it
|
||||
community.general.sapcar_extract:
|
||||
path: "~/source/hana.sar"
|
||||
manifest: "MyNewSignature.SMF"
|
||||
signature: true
|
||||
"""
|
||||
|
||||
import os
|
||||
from tempfile import NamedTemporaryFile
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.urls import open_url
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
|
||||
|
||||
def get_list_of_files(dir_name):
|
||||
# create a list of file and directories
|
||||
# names in the given directory
|
||||
list_of_file = os.listdir(dir_name)
|
||||
allFiles = list()
|
||||
# Iterate over all the entries
|
||||
for entry in list_of_file:
|
||||
# Create full path
|
||||
fullPath = os.path.join(dir_name, entry)
|
||||
# If entry is a directory then get the list of files in this directory
|
||||
if os.path.isdir(fullPath):
|
||||
allFiles = allFiles + [fullPath]
|
||||
allFiles = allFiles + get_list_of_files(fullPath)
|
||||
else:
|
||||
allFiles.append(fullPath)
|
||||
return allFiles
|
||||
|
||||
|
||||
def download_SAPCAR(binary_path, module):
|
||||
bin_path = None
|
||||
# download sapcar binary if url is provided otherwise path is returned
|
||||
if binary_path is not None:
|
||||
if binary_path.startswith('https://') or binary_path.startswith('http://'):
|
||||
random_file = NamedTemporaryFile(delete=False)
|
||||
with open_url(binary_path) as response:
|
||||
with random_file as out_file:
|
||||
data = response.read()
|
||||
out_file.write(data)
|
||||
os.chmod(out_file.name, 0o700)
|
||||
bin_path = out_file.name
|
||||
module.add_cleanup_file(bin_path)
|
||||
else:
|
||||
bin_path = binary_path
|
||||
return bin_path
|
||||
|
||||
|
||||
def check_if_present(command, path, dest, signature, manifest, module):
|
||||
# manipuliating output from SAR file for compare with already extracted files
|
||||
iter_command = [command, '-tvf', path]
|
||||
sar_out = module.run_command(iter_command)[1]
|
||||
sar_raw = sar_out.split("\n")[1:]
|
||||
if dest[-1] != "/":
|
||||
dest = dest + "/"
|
||||
sar_files = [dest + x.split(" ")[-1] for x in sar_raw if x]
|
||||
# remove any SIGNATURE.SMF from list because it will not unpacked if signature is false
|
||||
if not signature:
|
||||
sar_files = [item for item in sar_files if '.SMF' not in item]
|
||||
# if signature is renamed manipulate files in list of sar file for compare.
|
||||
if manifest != "SIGNATURE.SMF":
|
||||
sar_files = [item for item in sar_files if '.SMF' not in item]
|
||||
sar_files = sar_files + [manifest]
|
||||
# get extracted files if present
|
||||
files_extracted = get_list_of_files(dest)
|
||||
# compare extracted files with files in sar file
|
||||
present = all(elem in files_extracted for elem in sar_files)
|
||||
return present
|
||||
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
path=dict(type='path', required=True),
|
||||
dest=dict(type='path'),
|
||||
binary_path=dict(type='path'),
|
||||
signature=dict(type='bool', default=False),
|
||||
security_library=dict(type='path'),
|
||||
manifest=dict(type='str', default="SIGNATURE.SMF"),
|
||||
remove=dict(type='bool', default=False),
|
||||
),
|
||||
supports_check_mode=True,
|
||||
)
|
||||
rc, out, err = [0, "", ""]
|
||||
params = module.params
|
||||
check_mode = module.check_mode
|
||||
|
||||
path = params['path']
|
||||
dest = params['dest']
|
||||
signature = params['signature']
|
||||
security_library = params['security_library']
|
||||
manifest = params['manifest']
|
||||
remove = params['remove']
|
||||
|
||||
bin_path = download_SAPCAR(params['binary_path'], module)
|
||||
|
||||
if dest is None:
|
||||
dest_head_tail = os.path.split(path)
|
||||
dest = dest_head_tail[0] + '/'
|
||||
else:
|
||||
if not os.path.exists(dest):
|
||||
os.makedirs(dest, 0o755)
|
||||
|
||||
if bin_path is not None:
|
||||
command = [module.get_bin_path(bin_path, required=True)]
|
||||
else:
|
||||
try:
|
||||
command = [module.get_bin_path('sapcar', required=True)]
|
||||
except Exception as e:
|
||||
module.fail_json(msg='Failed to find SAPCAR at the expected path or URL "{0}". Please check whether it is available: {1}'
|
||||
.format(bin_path, to_native(e)))
|
||||
|
||||
present = check_if_present(command[0], path, dest, signature, manifest, module)
|
||||
|
||||
if not present:
|
||||
command.extend(['-xvf', path, '-R', dest])
|
||||
if security_library:
|
||||
command.extend(['-L', security_library])
|
||||
if signature:
|
||||
command.extend(['-manifest', manifest])
|
||||
if not check_mode:
|
||||
(rc, out, err) = module.run_command(command, check_rc=True)
|
||||
changed = True
|
||||
else:
|
||||
changed = False
|
||||
out = "already unpacked"
|
||||
|
||||
if remove:
|
||||
os.remove(path)
|
||||
|
||||
module.exit_json(changed=changed, message=rc, stdout=out,
|
||||
stderr=err, command=' '.join(command))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -14,6 +14,8 @@ short_description: Shut down a machine
|
||||
notes:
|
||||
- C(PATH) is ignored on the remote node when searching for the C(shutdown) command. Use I(search_paths)
|
||||
to specify locations to search if the default paths do not work.
|
||||
- The I(msg) and I(delay) options are not supported when a shutdown command is not found in I(search_paths), instead
|
||||
the module will attempt to shutdown the system by calling C(systemctl shutdown).
|
||||
description:
|
||||
- Shut downs a machine.
|
||||
version_added: "1.1.0"
|
||||
|
||||
@@ -154,28 +154,11 @@ import numbers
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import (
|
||||
CmdStateModuleHelper, ArgFormat
|
||||
)
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import StateModuleHelper
|
||||
from ansible_collections.community.general.plugins.module_utils.snap import snap_runner
|
||||
|
||||
|
||||
__state_map = dict(
|
||||
present='install',
|
||||
absent='remove',
|
||||
enabled='enable',
|
||||
disabled='disable',
|
||||
info='info', # not public
|
||||
list='list', # not public
|
||||
set='set', # not public
|
||||
get='get', # not public
|
||||
)
|
||||
|
||||
|
||||
def _state_map(value):
|
||||
return [__state_map[value]]
|
||||
|
||||
|
||||
class Snap(CmdStateModuleHelper):
|
||||
class Snap(StateModuleHelper):
|
||||
__disable_re = re.compile(r'(?:\S+\s+){5}(?P<notes>\S+)')
|
||||
__set_param_re = re.compile(r'(?P<snap_prefix>\S+:)?(?P<key>\S+)\s*=\s*(?P<value>.+)')
|
||||
module = dict(
|
||||
@@ -189,16 +172,6 @@ class Snap(CmdStateModuleHelper):
|
||||
},
|
||||
supports_check_mode=True,
|
||||
)
|
||||
command = "snap"
|
||||
command_args_formats = dict(
|
||||
actionable_snaps=dict(fmt=lambda v: v),
|
||||
state=dict(fmt=_state_map),
|
||||
classic=dict(fmt="--classic", style=ArgFormat.BOOLEAN),
|
||||
channel=dict(fmt=lambda v: [] if v == 'stable' else ['--channel', '{0}'.format(v)]),
|
||||
options=dict(fmt=list),
|
||||
json_format=dict(fmt="-d", style=ArgFormat.BOOLEAN),
|
||||
)
|
||||
check_rc = False
|
||||
|
||||
@staticmethod
|
||||
def _first_non_zero(a):
|
||||
@@ -208,18 +181,35 @@ class Snap(CmdStateModuleHelper):
|
||||
|
||||
return 0
|
||||
|
||||
def _run_multiple_commands(self, commands):
|
||||
outputs = [(c,) + self.run_command(params=c) for c in commands]
|
||||
results = ([], [], [], [])
|
||||
for output in outputs:
|
||||
for i in range(4):
|
||||
results[i].append(output[i])
|
||||
def __init_module__(self):
|
||||
self.runner = snap_runner(self.module)
|
||||
|
||||
def _run_multiple_commands(self, commands, actionable_names, bundle=True):
|
||||
results_cmd = []
|
||||
results_rc = []
|
||||
results_out = []
|
||||
results_err = []
|
||||
|
||||
with self.runner(commands + ["name"]) as ctx:
|
||||
if bundle:
|
||||
rc, out, err = ctx.run(name=actionable_names)
|
||||
results_cmd.append(commands + actionable_names)
|
||||
results_rc.append(rc)
|
||||
results_out.append(out)
|
||||
results_err.append(err)
|
||||
else:
|
||||
for name in actionable_names:
|
||||
rc, out, err = ctx.run(name=name)
|
||||
results_cmd.append(commands + [name])
|
||||
results_rc.append(rc)
|
||||
results_out.append(out)
|
||||
results_err.append(err)
|
||||
|
||||
return [
|
||||
'; '.join([to_native(x) for x in results[0]]),
|
||||
self._first_non_zero(results[1]),
|
||||
'\n'.join(results[2]),
|
||||
'\n'.join(results[3]),
|
||||
'; '.join([to_native(x) for x in results_cmd]),
|
||||
self._first_non_zero(results_rc),
|
||||
'\n'.join(results_out),
|
||||
'\n'.join(results_err),
|
||||
]
|
||||
|
||||
def convert_json_subtree_to_map(self, json_subtree, prefix=None):
|
||||
@@ -245,8 +235,8 @@ class Snap(CmdStateModuleHelper):
|
||||
return self.convert_json_subtree_to_map(json_object)
|
||||
|
||||
def retrieve_option_map(self, snap_name):
|
||||
params = [{'state': 'get'}, {'name': snap_name}, {'json_format': True}]
|
||||
rc, out, err = self.run_command(params=params)
|
||||
with self.runner("get name") as ctx:
|
||||
rc, out, err = ctx.run(name=snap_name)
|
||||
|
||||
if rc != 0:
|
||||
return {}
|
||||
@@ -266,10 +256,12 @@ class Snap(CmdStateModuleHelper):
|
||||
return option_map
|
||||
|
||||
def is_snap_installed(self, snap_name):
|
||||
return 0 == self.run_command(params=[{'state': 'list'}, {'name': snap_name}])[0]
|
||||
rc, dummy, dummy = self.runner("_list name").run(name=snap_name)
|
||||
return rc == 0
|
||||
|
||||
def is_snap_enabled(self, snap_name):
|
||||
rc, out, err = self.run_command(params=[{'state': 'list'}, {'name': snap_name}])
|
||||
with self.runner("_list name") as ctx:
|
||||
rc, out, err = ctx.run(name=snap_name)
|
||||
if rc != 0:
|
||||
return None
|
||||
result = out.splitlines()[1]
|
||||
@@ -283,7 +275,7 @@ class Snap(CmdStateModuleHelper):
|
||||
self.changed = True
|
||||
self.vars.snaps_installed = actionable_snaps
|
||||
|
||||
if self.module.check_mode:
|
||||
if self.check_mode:
|
||||
return
|
||||
|
||||
params = ['state', 'classic', 'channel'] # get base cmd parts
|
||||
@@ -291,10 +283,9 @@ class Snap(CmdStateModuleHelper):
|
||||
has_multiple_snaps = len(actionable_snaps) > 1
|
||||
|
||||
if has_one_pkg_params and has_multiple_snaps:
|
||||
commands = [params + [{'actionable_snaps': [s]}] for s in actionable_snaps]
|
||||
self.vars.cmd, rc, out, err = self._run_multiple_commands(params, actionable_snaps, bundle=False)
|
||||
else:
|
||||
commands = [params + [{'actionable_snaps': actionable_snaps}]]
|
||||
self.vars.cmd, rc, out, err = self._run_multiple_commands(commands)
|
||||
self.vars.cmd, rc, out, err = self._run_multiple_commands(params, actionable_snaps)
|
||||
|
||||
if rc == 0:
|
||||
return
|
||||
@@ -360,11 +351,9 @@ class Snap(CmdStateModuleHelper):
|
||||
if options_changed:
|
||||
self.changed = True
|
||||
|
||||
if not self.module.check_mode:
|
||||
params = [{'state': 'set'}, {'name': snap_name}, {'options': options_changed}]
|
||||
|
||||
rc, out, err = self.run_command(params=params)
|
||||
|
||||
if not self.check_mode:
|
||||
with self.runner("_set name options") as ctx:
|
||||
rc, out, err = ctx.run(name=snap_name, options=options_changed)
|
||||
if rc != 0:
|
||||
if 'has no "configure" hook' in err:
|
||||
msg = "Snap '{snap}' does not have any configurable options".format(snap=snap_name)
|
||||
@@ -383,12 +372,11 @@ class Snap(CmdStateModuleHelper):
|
||||
return
|
||||
self.changed = True
|
||||
self.vars[actionable_var] = actionable_snaps
|
||||
if self.module.check_mode:
|
||||
if self.check_mode:
|
||||
return
|
||||
if params is None:
|
||||
params = ['state']
|
||||
commands = [params + [{'actionable_snaps': actionable_snaps}]]
|
||||
self.vars.cmd, rc, out, err = self._run_multiple_commands(commands)
|
||||
self.vars.cmd, rc, out, err = self._run_multiple_commands(params, actionable_snaps)
|
||||
if rc == 0:
|
||||
return
|
||||
msg = "Ooops! Snap operation failed while executing '{cmd}', please examine logs and " \
|
||||
|
||||
@@ -86,15 +86,8 @@ snap_aliases:
|
||||
|
||||
import re
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import StateModuleHelper
|
||||
|
||||
|
||||
_state_map = dict(
|
||||
present='alias',
|
||||
absent='unalias',
|
||||
info='aliases',
|
||||
)
|
||||
from ansible_collections.community.general.plugins.module_utils.snap import snap_runner
|
||||
|
||||
|
||||
class SnapAlias(StateModuleHelper):
|
||||
@@ -113,18 +106,12 @@ class SnapAlias(StateModuleHelper):
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
command_args_formats = {
|
||||
"state": cmd_runner_fmt.as_map(_state_map),
|
||||
"name": cmd_runner_fmt.as_list(),
|
||||
"alias": cmd_runner_fmt.as_list(),
|
||||
}
|
||||
|
||||
def _aliases(self):
|
||||
n = self.vars.name
|
||||
return {n: self._get_aliases_for(n)} if n else self._get_aliases()
|
||||
|
||||
def __init_module__(self):
|
||||
self.runner = CmdRunner(self.module, "snap", self.command_args_formats, check_rc=False)
|
||||
self.runner = snap_runner(self.module)
|
||||
self.vars.set("snap_aliases", self._aliases(), change=True, diff=True)
|
||||
|
||||
def __quit_module__(self):
|
||||
@@ -141,8 +128,8 @@ class SnapAlias(StateModuleHelper):
|
||||
results[snap] = results.get(snap, []) + [alias]
|
||||
return results
|
||||
|
||||
with self.runner("state name", check_rc=True, output_process=process) as ctx:
|
||||
aliases = ctx.run(state="info")
|
||||
with self.runner("state_alias name", check_rc=True, output_process=process) as ctx:
|
||||
aliases = ctx.run(state_alias="info")
|
||||
if self.verbosity >= 4:
|
||||
self.vars.get_aliases_run_info = ctx.run_info
|
||||
return aliases
|
||||
@@ -164,8 +151,8 @@ class SnapAlias(StateModuleHelper):
|
||||
for _alias in self.vars.alias:
|
||||
if not self._has_alias(self.vars.name, _alias):
|
||||
self.changed = True
|
||||
with self.runner("state name alias", check_mode_skip=True) as ctx:
|
||||
ctx.run(alias=_alias)
|
||||
with self.runner("state_alias name alias", check_mode_skip=True) as ctx:
|
||||
ctx.run(state_alias=self.vars.state, alias=_alias)
|
||||
if self.verbosity >= 4:
|
||||
self.vars.run_info = ctx.run_info
|
||||
|
||||
@@ -173,16 +160,16 @@ class SnapAlias(StateModuleHelper):
|
||||
if not self.vars.alias:
|
||||
if self._has_alias(self.vars.name):
|
||||
self.changed = True
|
||||
with self.runner("state name", check_mode_skip=True) as ctx:
|
||||
ctx.run()
|
||||
with self.runner("state_alias name", check_mode_skip=True) as ctx:
|
||||
ctx.run(state_alias=self.vars.state)
|
||||
if self.verbosity >= 4:
|
||||
self.vars.run_info = ctx.run_info
|
||||
else:
|
||||
for _alias in self.vars.alias:
|
||||
if self._has_alias(self.vars.name, _alias):
|
||||
self.changed = True
|
||||
with self.runner("state alias", check_mode_skip=True) as ctx:
|
||||
ctx.run(alias=_alias)
|
||||
with self.runner("state_alias alias", check_mode_skip=True) as ctx:
|
||||
ctx.run(state_alias=self.vars.state, alias=_alias)
|
||||
if self.verbosity >= 4:
|
||||
self.vars.run_info = ctx.run_info
|
||||
|
||||
|
||||
@@ -181,7 +181,6 @@ class XFConfProperty(StateModuleHelper):
|
||||
change_params = ('value', )
|
||||
diff_params = ('value', )
|
||||
output_params = ('property', 'channel', 'value')
|
||||
facts_params = ('property', 'channel', 'value')
|
||||
module = dict(
|
||||
argument_spec=dict(
|
||||
state=dict(type='str', choices=("present", "absent"), default="present"),
|
||||
@@ -204,15 +203,12 @@ class XFConfProperty(StateModuleHelper):
|
||||
|
||||
default_state = 'present'
|
||||
|
||||
def update_xfconf_output(self, **kwargs):
|
||||
self.update_vars(meta={"output": True, "fact": True}, **kwargs)
|
||||
|
||||
def __init_module__(self):
|
||||
self.runner = xfconf_runner(self.module)
|
||||
self.does_not = 'Property "{0}" does not exist on channel "{1}".'.format(self.vars.property,
|
||||
self.vars.channel)
|
||||
self.vars.set('previous_value', self._get(), fact=True)
|
||||
self.vars.set('type', self.vars.value_type, fact=True)
|
||||
self.vars.set('previous_value', self._get())
|
||||
self.vars.set('type', self.vars.value_type)
|
||||
self.vars.meta('value').set(initial_value=self.vars.previous_value)
|
||||
|
||||
if self.vars.disable_facts is False:
|
||||
|
||||
@@ -324,11 +324,10 @@ def parse_zypper_xml(m, cmd, fail_not_found=True, packages=None):
|
||||
m.fail_json(msg=errmsg, rc=rc, stdout=stdout, stderr=stderr, cmd=cmd)
|
||||
else:
|
||||
return {}, rc, stdout, stderr
|
||||
elif rc in [0, 102, 103, 106]:
|
||||
elif rc in [0, 106, 103]:
|
||||
# zypper exit codes
|
||||
# 0: success
|
||||
# 106: signature verification failed
|
||||
# 102: ZYPPER_EXIT_INF_REBOOT_NEEDED - Returned after a successful installation of a patch which requires reboot of computer.
|
||||
# 103: zypper was upgraded, run same command again
|
||||
if packages is None:
|
||||
firstrun = True
|
||||
@@ -588,12 +587,12 @@ def main():
|
||||
elif state in ['installed', 'present', 'latest']:
|
||||
packages_changed, retvals = package_present(module, name, state == 'latest')
|
||||
|
||||
retvals['changed'] = retvals['rc'] in [0, 102] and bool(packages_changed)
|
||||
retvals['changed'] = retvals['rc'] == 0 and bool(packages_changed)
|
||||
|
||||
if module._diff:
|
||||
set_diff(module, retvals, packages_changed)
|
||||
|
||||
if retvals['rc'] not in [0, 102]:
|
||||
if retvals['rc'] != 0:
|
||||
module.fail_json(msg="Zypper run failed.", **retvals)
|
||||
|
||||
if not retvals['changed']:
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
shell: apache2ctl -M | sort
|
||||
register: modules_before
|
||||
- name: include only on supported systems
|
||||
include_tasks: actualtest.yml
|
||||
include: actualtest.yml
|
||||
always:
|
||||
- name: get list of enabled modules
|
||||
shell: apache2ctl -M | sort
|
||||
@@ -47,6 +47,6 @@
|
||||
# centos/RHEL does not have a2enmod/a2dismod
|
||||
|
||||
- name: include misleading warning test
|
||||
include_tasks: 635-apache2-misleading-warning.yml
|
||||
include: 635-apache2-misleading-warning.yml
|
||||
when: ansible_os_family in ['Debian']
|
||||
# Suse has mpm_event module compiled within the base apache2
|
||||
@@ -8,5 +8,5 @@
|
||||
# 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
|
||||
|
||||
- include_tasks: tests.yml
|
||||
- include: tests.yml
|
||||
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty'
|
||||
|
||||
@@ -453,7 +453,7 @@
|
||||
- content17 == expected17
|
||||
|
||||
|
||||
- name: "test-values 18 - Ensure 'beverage=coke' is 'absent' in section '[drinks]'"
|
||||
- name: "test-values 18 - Ensure 'beverage=coke' is 'abesent' in section '[drinks]'"
|
||||
ini_file:
|
||||
path: "{{ output_file }}"
|
||||
section: drinks
|
||||
@@ -483,7 +483,7 @@
|
||||
- content18 == expected18
|
||||
|
||||
|
||||
- name: "test-values 19 - Ensure non-existent 'beverage=coke' is 'absent' in section '[drinks]'"
|
||||
- name: "test-values 19 - Ensure non-existant 'beverage=coke' is 'abesent' in section '[drinks]'"
|
||||
ini_file:
|
||||
path: "{{ output_file }}"
|
||||
section: drinks
|
||||
@@ -579,8 +579,8 @@
|
||||
[section1]
|
||||
var1 = aaa
|
||||
# comment in section
|
||||
# var2 = some value
|
||||
# comment after section
|
||||
var2 = foo
|
||||
# var2 = bar
|
||||
|
||||
[section2]
|
||||
var3 = ccc
|
||||
@@ -613,8 +613,8 @@
|
||||
[section1]
|
||||
var1 = aaa
|
||||
# comment in section
|
||||
# var2 = some value
|
||||
# comment after section
|
||||
var2 = foo
|
||||
# var2 = bar
|
||||
|
||||
[section2]
|
||||
var3 = ccc
|
||||
@@ -629,13 +629,14 @@
|
||||
- content22 == expected22
|
||||
|
||||
|
||||
- name: "test-values 23 - Ensure 'var2=foo' is 'present' in section '[section1]', replacing commented option 'var2=some value'"
|
||||
- name: "test-values 23 - Ensure 'var2=[foo, foobar]' is 'present' in section '[section1]'"
|
||||
ini_file:
|
||||
path: "{{ output_file }}"
|
||||
section: section1
|
||||
option: var2
|
||||
values:
|
||||
- foo
|
||||
- foobar
|
||||
state: present
|
||||
register: result23
|
||||
|
||||
@@ -646,6 +647,7 @@
|
||||
|
||||
- name: test-values 23 - set expected content and get current ini file content
|
||||
set_fact:
|
||||
content23: "{{ output_content.content | b64decode }}"
|
||||
expected23: |
|
||||
|
||||
# Some comment to test
|
||||
@@ -657,28 +659,28 @@
|
||||
var1 = aaa
|
||||
# comment in section
|
||||
var2 = foo
|
||||
# comment after section
|
||||
var2 = foobar
|
||||
# var2 = bar
|
||||
|
||||
[section2]
|
||||
var3 = ccc
|
||||
# comment after section
|
||||
content23: "{{ output_content.content | b64decode }}"
|
||||
|
||||
- name: test-values 23 - assert 'changed' and msg 'option changed' and content is as expected
|
||||
- name: test-values 23 - assert 'changed' and msg 'option added' and content is as expected
|
||||
assert:
|
||||
that:
|
||||
- result23 is changed
|
||||
- result23.msg == 'option changed'
|
||||
- result23.msg == 'option added'
|
||||
- content23 == expected23
|
||||
|
||||
|
||||
- name: "test-values 24 - Ensure 'var2=[foo, foobar]' is 'present' in section '[section1]'"
|
||||
- name: "test-values 24 - Ensure 'var2=[foo, foobar, bar]' is 'present' in section '[section1]' replacing commented option 'var2=bar'"
|
||||
ini_file:
|
||||
path: "{{ output_file }}"
|
||||
section: section1
|
||||
option: var2
|
||||
values:
|
||||
values:
|
||||
- foo
|
||||
- bar
|
||||
- foobar
|
||||
state: present
|
||||
register: result24
|
||||
@@ -690,6 +692,7 @@
|
||||
|
||||
- name: test-values 24 - set expected content and get current ini file content
|
||||
set_fact:
|
||||
content24: "{{ output_content.content | b64decode }}"
|
||||
expected24: |
|
||||
|
||||
# Some comment to test
|
||||
@@ -702,18 +705,16 @@
|
||||
# comment in section
|
||||
var2 = foo
|
||||
var2 = foobar
|
||||
# comment after section
|
||||
var2 = bar
|
||||
|
||||
[section2]
|
||||
var3 = ccc
|
||||
# comment after section
|
||||
content24: "{{ output_content.content | b64decode }}"
|
||||
|
||||
- name: test-values 24 - assert 'changed' and msg 'option added' and content is as expected
|
||||
- name: test-values 24 - assert 'added' and msg 'option changed' and content is as expected
|
||||
assert:
|
||||
that:
|
||||
- result24 is changed
|
||||
- result24.msg == 'option added'
|
||||
- result24.msg == 'option changed'
|
||||
- content24 == expected24
|
||||
|
||||
|
||||
|
||||
@@ -8,5 +8,5 @@
|
||||
# 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
|
||||
|
||||
- include_tasks: 'locale_gen.yml'
|
||||
- include: 'locale_gen.yml'
|
||||
when: ansible_distribution in ('Ubuntu', 'Debian')
|
||||
|
||||
@@ -8,7 +8,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
|
||||
|
||||
- include_tasks: ubuntu.yml
|
||||
- include: ubuntu.yml
|
||||
when:
|
||||
- ansible_distribution == 'Ubuntu'
|
||||
- ansible_distribution_release not in ['focal', 'jammy']
|
||||
|
||||
@@ -49,6 +49,19 @@
|
||||
login_port: "{{ mssql_port }}"
|
||||
script: "SELECT 1"
|
||||
|
||||
- name: Execute a malformed query
|
||||
community.general.mssql_script:
|
||||
login_user: "{{ mssql_login_user }}"
|
||||
login_password: "{{ mssql_login_password }}"
|
||||
login_host: "{{ mssql_host }}"
|
||||
login_port: "{{ mssql_port }}"
|
||||
script: "SELCT 1"
|
||||
failed_when: false
|
||||
register: bad_query
|
||||
- assert:
|
||||
that:
|
||||
- bad_query.error.startswith('ProgrammingError')
|
||||
|
||||
- name: two batches with default output
|
||||
community.general.mssql_script:
|
||||
login_user: "{{ mssql_login_user }}"
|
||||
@@ -135,6 +148,30 @@
|
||||
- result_batches_dict.query_results_dict[0][0] | length == 1 # one row in first select
|
||||
- result_batches_dict.query_results_dict[0][0][0]['b0s0'] == 'Batch 0 - Select 0' # column 'b0s0' of first row
|
||||
|
||||
- name: Multiple batches with no resultsets and mixed-case GO
|
||||
community.general.mssql_script:
|
||||
login_user: "{{ mssql_login_user }}"
|
||||
login_password: "{{ mssql_login_password }}"
|
||||
login_host: "{{ mssql_host }}"
|
||||
login_port: "{{ mssql_port }}"
|
||||
script: |
|
||||
CREATE TABLE #integration56yH2 (c1 VARCHAR(10), c2 VARCHAR(10))
|
||||
Go
|
||||
INSERT INTO #integration56yH2 VALUES ('C1_VALUE1', 'C2_VALUE1')
|
||||
gO
|
||||
UPDATE #integration56yH2 SET c2 = 'C2_VALUE2' WHERE c1 = 'C1_VALUE1'
|
||||
go
|
||||
SELECT * from #integration56yH2
|
||||
GO
|
||||
DROP TABLE #integration56yH2
|
||||
register: empty_batches
|
||||
- assert:
|
||||
that:
|
||||
- empty_batches.query_results | length == 5 # five batch results
|
||||
- empty_batches.query_results[3][0] | length == 1 # one row in select
|
||||
- empty_batches.query_results[3][0][0] | length == 2 # two columns in row
|
||||
- empty_batches.query_results[3][0][0][1] == 'C2_VALUE2' # value has been updated
|
||||
|
||||
- name: Stored procedure may return multiple result sets
|
||||
community.general.mssql_script:
|
||||
login_user: "{{ mssql_login_user }}"
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
- when: ansible_os_family == 'Archlinux'
|
||||
block:
|
||||
# Add more tests here by including more task files:
|
||||
- include_tasks: 'basic.yml'
|
||||
- include_tasks: 'package_urls.yml'
|
||||
- include_tasks: 'remove_nosave.yml'
|
||||
- include_tasks: 'update_cache.yml'
|
||||
- include_tasks: 'locally_installed_package.yml'
|
||||
- include_tasks: 'reason.yml'
|
||||
- include: 'basic.yml'
|
||||
- include: 'package_urls.yml'
|
||||
- include: 'remove_nosave.yml'
|
||||
- include: 'update_cache.yml'
|
||||
- include: 'locally_installed_package.yml'
|
||||
- include: 'reason.yml'
|
||||
|
||||
@@ -522,7 +522,7 @@
|
||||
or ansible_distribution_version is version('13.3', '>=')
|
||||
block:
|
||||
- name: Setup testjail
|
||||
include_tasks: setup-testjail.yml
|
||||
include: setup-testjail.yml
|
||||
|
||||
- name: Install package in jail as rootdir
|
||||
include_tasks: install_single_package.yml
|
||||
|
||||
@@ -1,7 +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
|
||||
|
||||
dependencies:
|
||||
- setup_remote_tmp_dir
|
||||
@@ -11,16 +11,16 @@
|
||||
# Create basic CSV file
|
||||
- name: Create unique CSV file
|
||||
copy:
|
||||
content: &users_content |
|
||||
content: |
|
||||
name,uid,gid,gecos
|
||||
dag,500,500,Dag Wieërs
|
||||
jeroen,501,500,Jeroen Hoekx
|
||||
dest: "{{ remote_tmp_dir }}/users_unique.csv"
|
||||
dest: users_unique.csv
|
||||
|
||||
# Read a CSV file and access user 'dag'
|
||||
- name: Read users from CSV file and return a dictionary
|
||||
read_csv:
|
||||
path: "{{ remote_tmp_dir }}/users_unique.csv"
|
||||
path: users_unique.csv
|
||||
key: name
|
||||
register: users_unique
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
- users_unique.dict.jeroen.uid == '501'
|
||||
- users_unique.dict.jeroen.gid == '500'
|
||||
|
||||
# Read a CSV file and access the first item
|
||||
# Read a CSV file and access the first item
|
||||
- name: Read users from CSV file and return a list
|
||||
read_csv:
|
||||
path: "{{ remote_tmp_dir }}/users_unique.csv"
|
||||
path: users_unique.csv
|
||||
register: users_unique
|
||||
|
||||
- assert:
|
||||
@@ -61,12 +61,12 @@
|
||||
dag;500;500;Dag Wieërs
|
||||
jeroen;501;500;Jeroen Hoekx
|
||||
dag;502;500;Dag Wieers
|
||||
dest: "{{ remote_tmp_dir }}/users_nonunique.csv"
|
||||
dest: users_nonunique.csv
|
||||
|
||||
# Read a CSV file and access user 'dag'
|
||||
- name: Read users from CSV file and return a dictionary
|
||||
read_csv:
|
||||
path: "{{ remote_tmp_dir }}/users_nonunique.csv"
|
||||
path: users_nonunique.csv
|
||||
key: name
|
||||
unique: false
|
||||
delimiter: ';'
|
||||
@@ -87,7 +87,7 @@
|
||||
# Read a CSV file using an non-existing dialect
|
||||
- name: Read users from CSV file and return a dictionary
|
||||
read_csv:
|
||||
path: "{{ remote_tmp_dir }}/users_nonunique.csv"
|
||||
path: users_nonunique.csv
|
||||
dialect: placebo
|
||||
register: users_placebo
|
||||
ignore_errors: true
|
||||
@@ -104,12 +104,12 @@
|
||||
content: |
|
||||
dag,500,500,Dag Wieërs
|
||||
jeroen,501,500,Jeroen Hoekx
|
||||
dest: "{{ remote_tmp_dir }}/users_noheader.csv"
|
||||
dest: users_noheader.csv
|
||||
|
||||
# Read a CSV file and access user 'dag'
|
||||
- name: Read users from CSV file and return a dictionary
|
||||
read_csv:
|
||||
path: "{{ remote_tmp_dir }}/users_noheader.csv"
|
||||
path: users_noheader.csv
|
||||
key: name
|
||||
fieldnames: name,uid,gid,gecos
|
||||
register: users_noheader
|
||||
@@ -133,12 +133,12 @@
|
||||
name,uid,gid,gecos
|
||||
dag,500,500,Dag Wieërs
|
||||
jeroen,501,500,"Jeroen"Hoekx"
|
||||
dest: "{{ remote_tmp_dir }}/users_broken.csv"
|
||||
dest: users_broken.csv
|
||||
|
||||
# Read a broken CSV file using strict
|
||||
- name: Read users from a broken CSV file
|
||||
read_csv:
|
||||
path: "{{ remote_tmp_dir }}/users_broken.csv"
|
||||
path: users_broken.csv
|
||||
key: name
|
||||
strict: true
|
||||
register: users_broken
|
||||
@@ -148,29 +148,3 @@
|
||||
that:
|
||||
- users_broken is failed
|
||||
- "'Unable to process file' in users_broken.msg"
|
||||
|
||||
# Create basic CSV file with BOM
|
||||
- name: Create unique CSV file with BOM
|
||||
copy:
|
||||
content: "{{ bom + content }}"
|
||||
dest: "{{ remote_tmp_dir }}/users_bom.csv"
|
||||
vars:
|
||||
content: *users_content
|
||||
bom: "{{ '\ufeff' }}"
|
||||
|
||||
# Read a CSV file and access the first item
|
||||
- name: Read users from CSV file and return a list
|
||||
read_csv:
|
||||
path: "{{ remote_tmp_dir }}/users_bom.csv"
|
||||
register: users_bom
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- users_bom.list.0.name == 'dag'
|
||||
- users_bom.list.0.gecos == 'Dag Wieërs'
|
||||
- users_bom.list.0.uid == '500'
|
||||
- users_bom.list.0.gid == '500'
|
||||
- users_bom.list.1.name == 'jeroen'
|
||||
- users_bom.list.1.gecos == 'Jeroen Hoekx'
|
||||
- users_bom.list.1.uid == '501'
|
||||
- users_bom.list.1.gid == '500'
|
||||
|
||||
@@ -17,5 +17,5 @@
|
||||
msg: SELinux is {{ ansible_selinux.status }}
|
||||
when: ansible_selinux is defined and ansible_selinux != False
|
||||
|
||||
- include_tasks: sefcontext.yml
|
||||
- include: sefcontext.yml
|
||||
when: ansible_selinux is defined and ansible_selinux != False and ansible_selinux.status == 'enabled'
|
||||
|
||||
@@ -122,8 +122,8 @@
|
||||
- failure is failed
|
||||
- "'the following are missing: type' in failure['msg']"
|
||||
|
||||
- include_tasks: pipe.yml
|
||||
- include_tasks: tcp.yml
|
||||
- include_tasks: udp.yml
|
||||
- include_tasks: set.yml
|
||||
- include_tasks: transport.yml
|
||||
- include: pipe.yml
|
||||
- include: tcp.yml
|
||||
- include: udp.yml
|
||||
- include: set.yml
|
||||
- include: transport.yml
|
||||
|
||||
@@ -8,5 +8,5 @@
|
||||
# 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
|
||||
|
||||
- include_tasks: setup.yml
|
||||
- include: setup.yml
|
||||
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty'
|
||||
|
||||
@@ -8,5 +8,5 @@
|
||||
# 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
|
||||
|
||||
- include_tasks: ubuntu.yml
|
||||
- include: ubuntu.yml
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
|
||||
@@ -36,4 +36,4 @@
|
||||
- when: ansible_os_family == "Archlinux"
|
||||
block:
|
||||
- name: ArchLinux specific setup
|
||||
include_tasks: archlinux.yml
|
||||
include: archlinux.yml
|
||||
|
||||
@@ -3,3 +3,4 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
azp/posix/1
|
||||
destructive
|
||||
|
||||
@@ -7,13 +7,7 @@
|
||||
# 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
|
||||
|
||||
- name: Install systemd-sysv on Ubuntu 18 and Debian
|
||||
apt:
|
||||
name: systemd-sysv
|
||||
state: present
|
||||
when: (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version is version('18', '>=')) or (ansible_distribution == 'Debian')
|
||||
register: systemd_sysv_install
|
||||
#
|
||||
|
||||
- name: Execute shutdown with custom message and delay
|
||||
community.general.shutdown:
|
||||
@@ -34,29 +28,44 @@
|
||||
- '"Custom Message" in shutdown_result["shutdown_command"]'
|
||||
- '"Shut down initiated by Ansible" in shutdown_result_minus["shutdown_command"]'
|
||||
- '"Custom Message" not in shutdown_result_minus["shutdown_command"]'
|
||||
when: ansible_os_family not in ['Alpine', 'AIX']
|
||||
when:
|
||||
- 'ansible_os_family not in ["Alpine", "AIX"]'
|
||||
- '"systemctl" not in shutdown_result["shutdown_command"]'
|
||||
- '"systemctl" not in shutdown_result_minus["shutdown_command"]'
|
||||
|
||||
- name: Verify shutdown command is present except Alpine, VMKernel
|
||||
- name: Verify shutdown command is present except Alpine or AIX or systemd
|
||||
assert:
|
||||
that: '"shutdown" in shutdown_result["shutdown_command"]'
|
||||
when: ansible_os_family != 'Alpine' and ansible_system != 'VMKernel'
|
||||
when:
|
||||
- "ansible_os_family != 'Alpine'"
|
||||
- "ansible_system != 'VMKernel'"
|
||||
- '"systemctl" not in shutdown_result["shutdown_command"]'
|
||||
|
||||
- name: Verify shutdown command is present in Alpine
|
||||
- name: Verify shutdown command is present in Alpine except systemd
|
||||
assert:
|
||||
that: '"poweroff" in shutdown_result["shutdown_command"]'
|
||||
when: ansible_os_family == 'Alpine'
|
||||
when:
|
||||
- "ansible_os_family == 'Alpine'"
|
||||
- '"systemctl" not in shutdown_result["shutdown_command"]'
|
||||
|
||||
- name: Verify shutdown command is present in VMKernel
|
||||
|
||||
- name: Verify shutdown command is present in VMKernel except systemd
|
||||
assert:
|
||||
that: '"halt" in shutdown_result["shutdown_command"]'
|
||||
when: ansible_system == 'VMKernel'
|
||||
when:
|
||||
- "ansible_system == 'VMKernel'"
|
||||
- '"systemctl" not in shutdown_result["shutdown_command"]'
|
||||
|
||||
- name: Verify shutdown delay is present in minutes in Linux
|
||||
- name: Verify shutdown delay is present in minutes in Linux except systemd
|
||||
assert:
|
||||
that:
|
||||
- '"-h 1" in shutdown_result["shutdown_command"]'
|
||||
- '"-h 0" in shutdown_result_minus["shutdown_command"]'
|
||||
when: ansible_system == 'Linux' and ansible_os_family != 'Alpine'
|
||||
when:
|
||||
- "ansible_system == 'Linux'"
|
||||
- "ansible_os_family != 'Alpine'"
|
||||
- '"systemctl" not in shutdown_result["shutdown_command"]'
|
||||
- '"systemctl" not in shutdown_result_minus["shutdown_command"]'
|
||||
|
||||
- name: Verify shutdown delay is present in minutes in Void, MacOSX, OpenBSD
|
||||
assert:
|
||||
@@ -86,8 +95,30 @@
|
||||
- '"-d 0" in shutdown_result_minus["shutdown_command"]'
|
||||
when: ansible_system == 'VMKernel'
|
||||
|
||||
- name: Remove systemd-sysv in ubuntu 18 in case it has been installed in test
|
||||
- name: Ensure that systemd-sysv is absent in Ubuntu 18 and Debian
|
||||
apt:
|
||||
name: sytemd-sysv
|
||||
state: absent
|
||||
when: (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version is version('18', '>=')) or (ansible_distribution == 'Debian')
|
||||
register: systemd_sysv_install
|
||||
|
||||
- name: Gather package facts
|
||||
package_facts:
|
||||
manager: apt
|
||||
when: (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version is version('18', '>=')) or (ansible_distribution == 'Debian')
|
||||
|
||||
- name: Execute shutdown if no systemd-sysv
|
||||
community.general.shutdown:
|
||||
register: shutdown_result
|
||||
check_mode: true
|
||||
when:
|
||||
- "(ansible_distribution == 'Ubuntu' and ansible_distribution_major_version is version('18', '>=')) or (ansible_distribution == 'Debian')"
|
||||
- '"systemd-sysv" not in ansible_facts.packages'
|
||||
|
||||
- name: Install systemd_sysv in case it has been removed in test
|
||||
apt:
|
||||
name: systemd-sysv
|
||||
state: absent
|
||||
when: systemd_sysv_install is changed
|
||||
state: present
|
||||
when:
|
||||
- "(ansible_distribution == 'Ubuntu' and ansible_distribution_major_version is version('18', '>=')) or (ansible_distribution == 'Debian')"
|
||||
- "systemd_sysv_install is changed"
|
||||
|
||||
@@ -242,4 +242,4 @@
|
||||
- short_name.hosts_removed == []
|
||||
|
||||
- name: Include integration tests for additional options (e.g. proxycommand, proxyjump)
|
||||
include_tasks: 'options.yml'
|
||||
include: 'options.yml'
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
or ansible_distribution_version is version('13.1', '>=')
|
||||
block:
|
||||
- name: Setup testjail
|
||||
include_tasks: setup-testjail.yml
|
||||
include: setup-testjail.yml
|
||||
|
||||
- name: Enable nginx in test jail
|
||||
sysrc:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
- name: Setup
|
||||
include_tasks: setup.yml
|
||||
include: setup.yml
|
||||
|
||||
- name: Check availability of xattr support
|
||||
command: setfattr -n user.foo {{ test_file }}
|
||||
@@ -17,5 +17,5 @@
|
||||
register: xattr
|
||||
|
||||
- name: Test
|
||||
include_tasks: test.yml
|
||||
include: test.yml
|
||||
when: xattr is not failed
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
# ============================================================
|
||||
|
||||
- include_tasks: run.yml
|
||||
- include: run.yml
|
||||
vars:
|
||||
nodejs_version: '{{ item.node_version }}'
|
||||
nodejs_path: 'node-v{{ nodejs_version }}-{{ ansible_system|lower }}-x{{ ansible_userspace_bits }}'
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user