mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Compare commits
153 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
945bb91e04 | ||
|
|
b48a5c264f | ||
|
|
5bae017de9 | ||
|
|
e568a760ac | ||
|
|
8132568d2f | ||
|
|
0e320641b8 | ||
|
|
8679d59376 | ||
|
|
2554b4b0f4 | ||
|
|
379b6d3523 | ||
|
|
fe4f4198af | ||
|
|
db84ea4ab6 | ||
|
|
de5970d17a | ||
|
|
433d0571b4 | ||
|
|
53b95fd182 | ||
|
|
ad1f25e576 | ||
|
|
49eda7270e | ||
|
|
9c4799c903 | ||
|
|
88bf99b272 | ||
|
|
3ca6e8525e | ||
|
|
0169cb8358 | ||
|
|
499f4b4066 | ||
|
|
ff08c20f12 | ||
|
|
d27c06faeb | ||
|
|
0f98b63944 | ||
|
|
55c70dfb72 | ||
|
|
f78993ba12 | ||
|
|
b97ce10156 | ||
|
|
9250430d7d | ||
|
|
d61305d267 | ||
|
|
198b813b55 | ||
|
|
9e6df4f1c9 | ||
|
|
a477044fb7 | ||
|
|
2a97812856 | ||
|
|
c85bb8713e | ||
|
|
5cdc8f4b07 | ||
|
|
50131f5dfa | ||
|
|
c734e7c2e5 | ||
|
|
7e6e8f7749 | ||
|
|
687acdc961 | ||
|
|
16092feaab | ||
|
|
6676fb8fb4 | ||
|
|
a860f537dd | ||
|
|
f1a9c2f00a | ||
|
|
f8de068e32 | ||
|
|
70b4bacf0f | ||
|
|
41f5d1741c | ||
|
|
54ede7dd7f | ||
|
|
7f0702b786 | ||
|
|
89a3abe64a | ||
|
|
59eff2e3e0 | ||
|
|
1115b463fe | ||
|
|
77bf1fedf5 | ||
|
|
89560ea2e7 | ||
|
|
f9919d28d4 | ||
|
|
7b4660d28a | ||
|
|
29496be80e | ||
|
|
991c96615c | ||
|
|
fe5ad997c1 | ||
|
|
468b28bbb8 | ||
|
|
9b57221d9a | ||
|
|
cd1a92d417 | ||
|
|
7486e3a074 | ||
|
|
6661917370 | ||
|
|
ec0bd3143a | ||
|
|
cce68def8b | ||
|
|
6f5ad22d28 | ||
|
|
6c53a09eef | ||
|
|
9b6e75f7f4 | ||
|
|
e09650140d | ||
|
|
67388be1a9 | ||
|
|
130d07948a | ||
|
|
5d6fcaef53 | ||
|
|
f044a83c49 | ||
|
|
e3f7e8dadf | ||
|
|
8d1a028dbd | ||
|
|
8823e5c061 | ||
|
|
102456d033 | ||
|
|
aad4c55d3d | ||
|
|
e31c98f17f | ||
|
|
6a5dfc5579 | ||
|
|
ab7efef9df | ||
|
|
ca9c763b57 | ||
|
|
cfeb40ed23 | ||
|
|
c495d136fa | ||
|
|
d9e2d6682b | ||
|
|
d7fe288ffd | ||
|
|
7de89699f7 | ||
|
|
b0a9cceeb5 | ||
|
|
b08f0b2f82 | ||
|
|
f23f409bd6 | ||
|
|
cfea62793f | ||
|
|
62bda91466 | ||
|
|
473d5fa2af | ||
|
|
cc76d684d5 | ||
|
|
7a6770c731 | ||
|
|
d2214af6e8 | ||
|
|
fad1220869 | ||
|
|
fe09516235 | ||
|
|
78cd8886f4 | ||
|
|
6b99d48f06 | ||
|
|
6e0e17a7e3 | ||
|
|
90de95c7b2 | ||
|
|
07c6b8b24e | ||
|
|
d106de6d51 | ||
|
|
e96101fb3f | ||
|
|
a60d55f03c | ||
|
|
d6a09ada98 | ||
|
|
9ddb75a3a2 | ||
|
|
b85ff2a997 | ||
|
|
3d1ca5638b | ||
|
|
35fd4700bf | ||
|
|
9add9df7d6 | ||
|
|
cdb747b41d | ||
|
|
7a70fda784 | ||
|
|
13d1b9569e | ||
|
|
c8c5021773 | ||
|
|
206ac72bd8 | ||
|
|
1ee123bb1e | ||
|
|
aa0bcad9df | ||
|
|
6e51690a95 | ||
|
|
3eab4faf0b | ||
|
|
c6589a772b | ||
|
|
cb06c4ff77 | ||
|
|
78316fbb75 | ||
|
|
c7df82652f | ||
|
|
342a1a7faa | ||
|
|
17431bd42c | ||
|
|
eacf663999 | ||
|
|
84a806be08 | ||
|
|
7db5c86dc8 | ||
|
|
1e82b5c580 | ||
|
|
7f6be665f9 | ||
|
|
174b00cd29 | ||
|
|
a7c92f491d | ||
|
|
592cd3747b | ||
|
|
4295ee0bb4 | ||
|
|
7e1ff300f8 | ||
|
|
b3ddec2b29 | ||
|
|
227f6e333e | ||
|
|
94711ca506 | ||
|
|
d53052f27a | ||
|
|
95d57c338a | ||
|
|
4fd7a65a52 | ||
|
|
0e3c1f867d | ||
|
|
fa24edf89c | ||
|
|
ac3e803a36 | ||
|
|
8168ddca4f | ||
|
|
cc264be644 | ||
|
|
9bd2d1ec90 | ||
|
|
01b2c48161 | ||
|
|
a26792418e | ||
|
|
485834526f | ||
|
|
5e68ea41e9 |
@@ -1,9 +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
|
|
||||||
-->
|
|
||||||
|
|
||||||
## Azure Pipelines Configuration
|
## Azure Pipelines Configuration
|
||||||
|
|
||||||
Please see the [Documentation](https://github.com/ansible/community/wiki/Testing:-Azure-Pipelines) for more information.
|
Please see the [Documentation](https://github.com/ansible/community/wiki/Testing:-Azure-Pipelines) for more information.
|
||||||
|
|||||||
@@ -1,8 +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
|
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
batch: true
|
batch: true
|
||||||
branches:
|
branches:
|
||||||
@@ -29,14 +24,15 @@ schedules:
|
|||||||
always: true
|
always: true
|
||||||
branches:
|
branches:
|
||||||
include:
|
include:
|
||||||
- stable-8
|
- stable-3
|
||||||
- stable-7
|
- stable-4
|
||||||
- cron: 0 11 * * 0
|
- cron: 0 11 * * 0
|
||||||
displayName: Weekly (old stable branches)
|
displayName: Weekly (old stable branches)
|
||||||
always: true
|
always: true
|
||||||
branches:
|
branches:
|
||||||
include:
|
include:
|
||||||
- stable-6
|
- stable-1
|
||||||
|
- stable-2
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
- name: checkoutPath
|
- name: checkoutPath
|
||||||
@@ -53,7 +49,7 @@ variables:
|
|||||||
resources:
|
resources:
|
||||||
containers:
|
containers:
|
||||||
- container: default
|
- container: default
|
||||||
image: quay.io/ansible/azure-pipelines-test-container:4.0.1
|
image: quay.io/ansible/azure-pipelines-test-container:1.9.0
|
||||||
|
|
||||||
pool: Standard
|
pool: Standard
|
||||||
|
|
||||||
@@ -73,40 +69,53 @@ stages:
|
|||||||
- test: 3
|
- test: 3
|
||||||
- test: 4
|
- test: 4
|
||||||
- test: extra
|
- test: extra
|
||||||
- stage: Sanity_2_16
|
- stage: Sanity_2_12
|
||||||
displayName: Sanity 2.16
|
displayName: Sanity 2.12
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
nameFormat: Test {0}
|
nameFormat: Test {0}
|
||||||
testFormat: 2.16/sanity/{0}
|
testFormat: 2.12/sanity/{0}
|
||||||
targets:
|
targets:
|
||||||
- test: 1
|
- test: 1
|
||||||
- test: 2
|
- test: 2
|
||||||
- test: 3
|
- test: 3
|
||||||
- test: 4
|
- test: 4
|
||||||
- stage: Sanity_2_15
|
- stage: Sanity_2_11
|
||||||
displayName: Sanity 2.15
|
displayName: Sanity 2.11
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
nameFormat: Test {0}
|
nameFormat: Test {0}
|
||||||
testFormat: 2.15/sanity/{0}
|
testFormat: 2.11/sanity/{0}
|
||||||
targets:
|
targets:
|
||||||
- test: 1
|
- test: 1
|
||||||
- test: 2
|
- test: 2
|
||||||
- test: 3
|
- test: 3
|
||||||
- test: 4
|
- test: 4
|
||||||
- stage: Sanity_2_14
|
- stage: Sanity_2_10
|
||||||
displayName: Sanity 2.14
|
displayName: Sanity 2.10
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
nameFormat: Test {0}
|
nameFormat: Test {0}
|
||||||
testFormat: 2.14/sanity/{0}
|
testFormat: 2.10/sanity/{0}
|
||||||
|
targets:
|
||||||
|
- test: 1
|
||||||
|
- test: 2
|
||||||
|
- test: 3
|
||||||
|
- test: 4
|
||||||
|
- stage: Sanity_2_9
|
||||||
|
displayName: Sanity 2.9
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
nameFormat: Test {0}
|
||||||
|
testFormat: 2.9/sanity/{0}
|
||||||
targets:
|
targets:
|
||||||
- test: 1
|
- test: 1
|
||||||
- test: 2
|
- test: 2
|
||||||
@@ -122,63 +131,73 @@ stages:
|
|||||||
nameFormat: Python {0}
|
nameFormat: Python {0}
|
||||||
testFormat: devel/units/{0}/1
|
testFormat: devel/units/{0}/1
|
||||||
targets:
|
targets:
|
||||||
|
- test: 2.7
|
||||||
|
- test: 3.5
|
||||||
|
- test: 3.6
|
||||||
- test: 3.7
|
- test: 3.7
|
||||||
- test: 3.8
|
- test: 3.8
|
||||||
- test: 3.9
|
- test: 3.9
|
||||||
- test: '3.10'
|
- test: '3.10'
|
||||||
- test: '3.11'
|
- stage: Units_2_12
|
||||||
- test: '3.12'
|
displayName: Units 2.12
|
||||||
- stage: Units_2_16
|
|
||||||
displayName: Units 2.16
|
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
nameFormat: Python {0}
|
nameFormat: Python {0}
|
||||||
testFormat: 2.16/units/{0}/1
|
testFormat: 2.12/units/{0}/1
|
||||||
|
targets:
|
||||||
|
- test: 2.6
|
||||||
|
- test: 2.7
|
||||||
|
- test: 3.5
|
||||||
|
- test: 3.6
|
||||||
|
- test: 3.7
|
||||||
|
- test: 3.8
|
||||||
|
- test: '3.10'
|
||||||
|
- stage: Units_2_11
|
||||||
|
displayName: Units 2.11
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
nameFormat: Python {0}
|
||||||
|
testFormat: 2.11/units/{0}/1
|
||||||
|
targets:
|
||||||
|
- test: 2.6
|
||||||
|
- test: 2.7
|
||||||
|
- test: 3.5
|
||||||
|
- test: 3.6
|
||||||
|
- test: 3.7
|
||||||
|
- test: 3.8
|
||||||
|
- test: 3.9
|
||||||
|
- stage: Units_2_10
|
||||||
|
displayName: Units 2.10
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
nameFormat: Python {0}
|
||||||
|
testFormat: 2.10/units/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- test: 2.7
|
- test: 2.7
|
||||||
- test: 3.6
|
- test: 3.6
|
||||||
- test: "3.11"
|
- stage: Units_2_9
|
||||||
- stage: Units_2_15
|
displayName: Units 2.9
|
||||||
displayName: Units 2.15
|
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
nameFormat: Python {0}
|
nameFormat: Python {0}
|
||||||
testFormat: 2.15/units/{0}/1
|
testFormat: 2.9/units/{0}/1
|
||||||
targets:
|
targets:
|
||||||
|
- test: 2.6
|
||||||
|
- test: 2.7
|
||||||
- test: 3.5
|
- test: 3.5
|
||||||
- test: "3.10"
|
- test: 3.6
|
||||||
- stage: Units_2_14
|
- test: 3.7
|
||||||
displayName: Units 2.14
|
- test: 3.8
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
nameFormat: Python {0}
|
|
||||||
testFormat: 2.14/units/{0}/1
|
|
||||||
targets:
|
|
||||||
- test: 3.9
|
|
||||||
|
|
||||||
## Remote
|
## Remote
|
||||||
- stage: Remote_devel_extra_vms
|
|
||||||
displayName: Remote devel extra VMs
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
testFormat: devel/{0}
|
|
||||||
targets:
|
|
||||||
- name: Alpine 3.18
|
|
||||||
test: alpine/3.18
|
|
||||||
# - name: Fedora 38
|
|
||||||
# test: fedora/38
|
|
||||||
- name: Ubuntu 22.04
|
|
||||||
test: ubuntu/22.04
|
|
||||||
groups:
|
|
||||||
- vm
|
|
||||||
- stage: Remote_devel
|
- stage: Remote_devel
|
||||||
displayName: Remote devel
|
displayName: Remote devel
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
@@ -187,74 +206,86 @@ stages:
|
|||||||
parameters:
|
parameters:
|
||||||
testFormat: devel/{0}
|
testFormat: devel/{0}
|
||||||
targets:
|
targets:
|
||||||
- name: macOS 13.2
|
- name: macOS 12.0
|
||||||
test: macos/13.2
|
test: macos/12.0
|
||||||
- name: RHEL 9.2
|
|
||||||
test: rhel/9.2
|
|
||||||
- name: FreeBSD 13.2
|
|
||||||
test: freebsd/13.2
|
|
||||||
groups:
|
|
||||||
- 1
|
|
||||||
- 2
|
|
||||||
- 3
|
|
||||||
- stage: Remote_2_16
|
|
||||||
displayName: Remote 2.16
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
testFormat: 2.16/{0}
|
|
||||||
targets:
|
|
||||||
#- name: macOS 13.2
|
|
||||||
# test: macos/13.2
|
|
||||||
- name: RHEL 8.8
|
|
||||||
test: rhel/8.8
|
|
||||||
#- name: FreeBSD 13.2
|
|
||||||
# test: freebsd/13.2
|
|
||||||
groups:
|
|
||||||
- 1
|
|
||||||
- 2
|
|
||||||
- 3
|
|
||||||
- stage: Remote_2_15
|
|
||||||
displayName: Remote 2.15
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
testFormat: 2.15/{0}
|
|
||||||
targets:
|
|
||||||
- name: RHEL 9.1
|
|
||||||
test: rhel/9.1
|
|
||||||
- name: RHEL 8.7
|
|
||||||
test: rhel/8.7
|
|
||||||
- name: RHEL 7.9
|
- name: RHEL 7.9
|
||||||
test: rhel/7.9
|
test: rhel/7.9
|
||||||
- name: FreeBSD 13.1
|
- name: RHEL 8.5
|
||||||
test: freebsd/13.1
|
test: rhel/8.5
|
||||||
- name: FreeBSD 12.4
|
- name: FreeBSD 12.3
|
||||||
test: freebsd/12.4
|
test: freebsd/12.3
|
||||||
|
- name: FreeBSD 13.0
|
||||||
|
test: freebsd/13.0
|
||||||
groups:
|
groups:
|
||||||
- 1
|
- 1
|
||||||
- 2
|
- 2
|
||||||
- 3
|
- 3
|
||||||
- stage: Remote_2_14
|
- stage: Remote_2_12
|
||||||
displayName: Remote 2.14
|
displayName: Remote 2.12
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: 2.14/{0}
|
testFormat: 2.12/{0}
|
||||||
targets:
|
targets:
|
||||||
- name: RHEL 9.0
|
- name: macOS 11.1
|
||||||
test: rhel/9.0
|
test: macos/11.1
|
||||||
#- name: macOS 12.0
|
- name: RHEL 8.4
|
||||||
# test: macos/12.0
|
test: rhel/8.4
|
||||||
#- name: FreeBSD 12.4
|
- name: FreeBSD 13.0
|
||||||
# test: freebsd/12.4
|
test: freebsd/13.0
|
||||||
|
groups:
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
- stage: Remote_2_11
|
||||||
|
displayName: Remote 2.11
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
testFormat: 2.11/{0}
|
||||||
|
targets:
|
||||||
|
- name: RHEL 7.9
|
||||||
|
test: rhel/7.9
|
||||||
|
- name: RHEL 8.3
|
||||||
|
test: rhel/8.3
|
||||||
|
- name: FreeBSD 12.2
|
||||||
|
test: freebsd/12.2
|
||||||
|
groups:
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
- stage: Remote_2_10
|
||||||
|
displayName: Remote 2.10
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
testFormat: 2.10/{0}
|
||||||
|
targets:
|
||||||
|
- name: OS X 10.11
|
||||||
|
test: osx/10.11
|
||||||
|
- name: macOS 10.15
|
||||||
|
test: macos/10.15
|
||||||
|
groups:
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
- stage: Remote_2_9
|
||||||
|
displayName: Remote 2.9
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
testFormat: 2.9/{0}
|
||||||
|
targets:
|
||||||
|
- name: RHEL 8.2
|
||||||
|
test: rhel/8.2
|
||||||
|
- name: RHEL 7.8
|
||||||
|
test: rhel/7.8
|
||||||
|
- name: FreeBSD 12.0
|
||||||
|
test: freebsd/12.0
|
||||||
groups:
|
groups:
|
||||||
- 1
|
- 1
|
||||||
- 2
|
- 2
|
||||||
- 3
|
|
||||||
|
|
||||||
### Docker
|
### Docker
|
||||||
- stage: Docker_devel
|
- stage: Docker_devel
|
||||||
@@ -265,153 +296,173 @@ stages:
|
|||||||
parameters:
|
parameters:
|
||||||
testFormat: devel/linux/{0}
|
testFormat: devel/linux/{0}
|
||||||
targets:
|
targets:
|
||||||
- name: Fedora 38
|
|
||||||
test: fedora38
|
|
||||||
- name: Ubuntu 20.04
|
|
||||||
test: ubuntu2004
|
|
||||||
- name: Ubuntu 22.04
|
|
||||||
test: ubuntu2204
|
|
||||||
- name: Alpine 3
|
|
||||||
test: alpine3
|
|
||||||
groups:
|
|
||||||
- 1
|
|
||||||
- 2
|
|
||||||
- 3
|
|
||||||
- stage: Docker_2_16
|
|
||||||
displayName: Docker 2.16
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
testFormat: 2.16/linux/{0}
|
|
||||||
targets:
|
|
||||||
- name: openSUSE 15
|
|
||||||
test: opensuse15
|
|
||||||
groups:
|
|
||||||
- 1
|
|
||||||
- 2
|
|
||||||
- 3
|
|
||||||
- stage: Docker_2_15
|
|
||||||
displayName: Docker 2.15
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
testFormat: 2.15/linux/{0}
|
|
||||||
targets:
|
|
||||||
- name: Fedora 37
|
|
||||||
test: fedora37
|
|
||||||
- name: CentOS 7
|
- name: CentOS 7
|
||||||
test: centos7
|
test: centos7
|
||||||
|
- name: Fedora 34
|
||||||
|
test: fedora34
|
||||||
|
- name: Fedora 35
|
||||||
|
test: fedora35
|
||||||
|
- name: openSUSE 15 py2
|
||||||
|
test: opensuse15py2
|
||||||
|
- name: openSUSE 15 py3
|
||||||
|
test: opensuse15
|
||||||
|
- name: Ubuntu 18.04
|
||||||
|
test: ubuntu1804
|
||||||
|
- name: Ubuntu 20.04
|
||||||
|
test: ubuntu2004
|
||||||
groups:
|
groups:
|
||||||
- 1
|
- 1
|
||||||
- 2
|
- 2
|
||||||
- 3
|
- 3
|
||||||
- stage: Docker_2_14
|
- stage: Docker_2_12
|
||||||
displayName: Docker 2.14
|
displayName: Docker 2.12
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: 2.14/linux/{0}
|
testFormat: 2.12/linux/{0}
|
||||||
targets:
|
targets:
|
||||||
- name: Fedora 36
|
- name: CentOS 6
|
||||||
test: fedora36
|
test: centos6
|
||||||
|
- name: CentOS 8
|
||||||
|
test: centos8
|
||||||
|
- name: Fedora 34
|
||||||
|
test: fedora34
|
||||||
|
- name: openSUSE 15 py3
|
||||||
|
test: opensuse15
|
||||||
|
- name: Ubuntu 20.04
|
||||||
|
test: ubuntu2004
|
||||||
groups:
|
groups:
|
||||||
- 1
|
- 1
|
||||||
- 2
|
- 2
|
||||||
- 3
|
- 3
|
||||||
|
- stage: Docker_2_11
|
||||||
### Community Docker
|
displayName: Docker 2.11
|
||||||
- stage: Docker_community_devel
|
|
||||||
displayName: Docker (community images) devel
|
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: devel/linux-community/{0}
|
testFormat: 2.11/linux/{0}
|
||||||
targets:
|
targets:
|
||||||
- name: Debian Bullseye
|
- name: CentOS 7
|
||||||
test: debian-bullseye/3.9
|
test: centos7
|
||||||
- name: Debian Bookworm
|
- name: Fedora 33
|
||||||
test: debian-bookworm/3.11
|
test: fedora33
|
||||||
- name: ArchLinux
|
- name: openSUSE 15 py2
|
||||||
test: archlinux/3.11
|
test: opensuse15py2
|
||||||
|
groups:
|
||||||
|
- 2
|
||||||
|
- 3
|
||||||
|
- stage: Docker_2_10
|
||||||
|
displayName: Docker 2.10
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
testFormat: 2.10/linux/{0}
|
||||||
|
targets:
|
||||||
|
- name: Fedora 32
|
||||||
|
test: fedora32
|
||||||
|
- name: Ubuntu 16.04
|
||||||
|
test: ubuntu1604
|
||||||
|
groups:
|
||||||
|
- 2
|
||||||
|
- 3
|
||||||
|
- stage: Docker_2_9
|
||||||
|
displayName: Docker 2.9
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
testFormat: 2.9/linux/{0}
|
||||||
|
targets:
|
||||||
|
- name: Fedora 31
|
||||||
|
test: fedora31
|
||||||
|
- name: openSUSE 15 py3
|
||||||
|
test: opensuse15
|
||||||
groups:
|
groups:
|
||||||
- 1
|
|
||||||
- 2
|
- 2
|
||||||
- 3
|
- 3
|
||||||
|
|
||||||
### Generic
|
### Cloud
|
||||||
- stage: Generic_devel
|
- stage: Cloud_devel
|
||||||
displayName: Generic devel
|
displayName: Cloud devel
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
nameFormat: Python {0}
|
nameFormat: Python {0}
|
||||||
testFormat: devel/generic/{0}/1
|
testFormat: devel/cloud/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- test: '3.7'
|
- test: 2.7
|
||||||
- test: '3.12'
|
- test: 3.9
|
||||||
- stage: Generic_2_16
|
- stage: Cloud_2_12
|
||||||
displayName: Generic 2.16
|
displayName: Cloud 2.12
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
nameFormat: Python {0}
|
nameFormat: Python {0}
|
||||||
testFormat: 2.16/generic/{0}/1
|
testFormat: 2.12/cloud/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- test: '2.7'
|
- test: 3.8
|
||||||
- test: '3.6'
|
- stage: Cloud_2_11
|
||||||
- test: '3.11'
|
displayName: Cloud 2.11
|
||||||
- stage: Generic_2_15
|
|
||||||
displayName: Generic 2.15
|
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
nameFormat: Python {0}
|
nameFormat: Python {0}
|
||||||
testFormat: 2.15/generic/{0}/1
|
testFormat: 2.11/cloud/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- test: '3.9'
|
- test: 3.6
|
||||||
- stage: Generic_2_14
|
- stage: Cloud_2_10
|
||||||
displayName: Generic 2.14
|
displayName: Cloud 2.10
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
nameFormat: Python {0}
|
nameFormat: Python {0}
|
||||||
testFormat: 2.14/generic/{0}/1
|
testFormat: 2.10/cloud/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- test: '3.10'
|
- test: 3.5
|
||||||
|
- stage: Cloud_2_9
|
||||||
|
displayName: Cloud 2.9
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
nameFormat: Python {0}
|
||||||
|
testFormat: 2.9/cloud/{0}/1
|
||||||
|
targets:
|
||||||
|
- test: 2.7
|
||||||
- stage: Summary
|
- stage: Summary
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- Sanity_devel
|
- Sanity_devel
|
||||||
- Sanity_2_16
|
- Sanity_2_9
|
||||||
- Sanity_2_15
|
- Sanity_2_10
|
||||||
- Sanity_2_14
|
- Sanity_2_11
|
||||||
|
- Sanity_2_12
|
||||||
- Units_devel
|
- Units_devel
|
||||||
- Units_2_16
|
- Units_2_9
|
||||||
- Units_2_15
|
- Units_2_10
|
||||||
- Units_2_14
|
- Units_2_11
|
||||||
- Remote_devel_extra_vms
|
- Units_2_12
|
||||||
- Remote_devel
|
- Remote_devel
|
||||||
- Remote_2_16
|
- Remote_2_9
|
||||||
- Remote_2_15
|
- Remote_2_10
|
||||||
- Remote_2_14
|
- Remote_2_11
|
||||||
|
- Remote_2_12
|
||||||
- Docker_devel
|
- Docker_devel
|
||||||
- Docker_2_16
|
- Docker_2_9
|
||||||
- Docker_2_15
|
- Docker_2_10
|
||||||
- Docker_2_14
|
- Docker_2_11
|
||||||
- Docker_community_devel
|
- Docker_2_12
|
||||||
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
|
- Cloud_devel
|
||||||
# - Generic_devel
|
- Cloud_2_9
|
||||||
# - Generic_2_16
|
- Cloud_2_10
|
||||||
# - Generic_2_15
|
- Cloud_2_11
|
||||||
# - Generic_2_14
|
- Cloud_2_12
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/coverage.yml
|
- template: templates/coverage.yml
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# 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
|
|
||||||
|
|
||||||
# Aggregate code coverage results for later processing.
|
# Aggregate code coverage results for later processing.
|
||||||
|
|
||||||
set -o pipefail -eu
|
set -o pipefail -eu
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# 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
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Combine coverage data from multiple jobs, keeping the data only from the most recent attempt from each job.
|
Combine coverage data from multiple jobs, keeping the data only from the most recent attempt from each job.
|
||||||
Coverage artifacts must be named using the format: "Coverage $(System.JobAttempt) {StableUniqueNameForEachJob}"
|
Coverage artifacts must be named using the format: "Coverage $(System.JobAttempt) {StableUniqueNameForEachJob}"
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# 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
|
|
||||||
|
|
||||||
# Check the test results and set variables for use in later steps.
|
# Check the test results and set variables for use in later steps.
|
||||||
|
|
||||||
set -o pipefail -eu
|
set -o pipefail -eu
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# 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
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Upload code coverage reports to codecov.io.
|
Upload code coverage reports to codecov.io.
|
||||||
Multiple coverage files from multiple languages are accepted and aggregated after upload.
|
Multiple coverage files from multiple languages are accepted and aggregated after upload.
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# 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
|
|
||||||
|
|
||||||
# Generate code coverage reports for uploading to Azure Pipelines and codecov.io.
|
# Generate code coverage reports for uploading to Azure Pipelines and codecov.io.
|
||||||
|
|
||||||
set -o pipefail -eu
|
set -o pipefail -eu
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# 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
|
|
||||||
|
|
||||||
# Configure the test environment and run the tests.
|
# Configure the test environment and run the tests.
|
||||||
|
|
||||||
set -o pipefail -eu
|
set -o pipefail -eu
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# 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
|
|
||||||
|
|
||||||
"""Prepends a relative timestamp to each input line from stdin and writes it to stdout."""
|
"""Prepends a relative timestamp to each input line from stdin and writes it to stdout."""
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
|||||||
@@ -1,8 +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
|
|
||||||
|
|
||||||
# This template adds a job for processing code coverage data.
|
# This template adds a job for processing code coverage data.
|
||||||
# It will upload results to Azure Pipelines and codecov.io.
|
# It will upload results to Azure Pipelines and codecov.io.
|
||||||
# Use it from a job stage that completes after all other jobs have completed.
|
# Use it from a job stage that completes after all other jobs have completed.
|
||||||
|
|||||||
@@ -1,8 +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
|
|
||||||
|
|
||||||
# This template uses the provided targets and optional groups to generate a matrix which is then passed to the test template.
|
# This template uses the provided targets and optional groups to generate a matrix which is then passed to the test template.
|
||||||
# If this matrix template does not provide the required functionality, consider using the test template directly instead.
|
# If this matrix template does not provide the required functionality, consider using the test template directly instead.
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +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
|
|
||||||
|
|
||||||
# This template uses the provided list of jobs to create test one or more test jobs.
|
# This template uses the provided list of jobs to create test one or more test jobs.
|
||||||
# It can be used directly if needed, or through the matrix template.
|
# It can be used directly if needed, or through the matrix template.
|
||||||
|
|
||||||
|
|||||||
2067
.github/BOTMETA.yml
vendored
2067
.github/BOTMETA.yml
vendored
File diff suppressed because it is too large
Load Diff
8
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
8
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -1,8 +1,4 @@
|
|||||||
---
|
---
|
||||||
# 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: Bug report
|
name: Bug report
|
||||||
description: Create a report to help us improve
|
description: Create a report to help us improve
|
||||||
|
|
||||||
@@ -47,7 +43,7 @@ body:
|
|||||||
label: Component Name
|
label: Component Name
|
||||||
description: >-
|
description: >-
|
||||||
Write the short name of the module, plugin, task or feature below,
|
Write the short name of the module, plugin, task or feature below,
|
||||||
*use your best guess if unsure*. Do not include `community.general.`!
|
*use your best guess if unsure*.
|
||||||
placeholder: dnf, apt, yum, pip, user etc.
|
placeholder: dnf, apt, yum, pip, user etc.
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
@@ -109,7 +105,7 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: Steps to Reproduce
|
label: Steps to Reproduce
|
||||||
description: |
|
description: |
|
||||||
Describe exactly how to reproduce the problem, using a minimal test-case. It would *really* help us understand your problem if you could also passed any playbooks, configs and commands you used.
|
Describe exactly how to reproduce the problem, using a minimal test-case. It would *really* help us understand your problem if you could also pased any playbooks, configs and commands you used.
|
||||||
|
|
||||||
**HINT:** You can paste https://gist.github.com links for larger files.
|
**HINT:** You can paste https://gist.github.com links for larger files.
|
||||||
value: |
|
value: |
|
||||||
|
|||||||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +1,4 @@
|
|||||||
---
|
---
|
||||||
# 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
|
|
||||||
|
|
||||||
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
|
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
|
||||||
blank_issues_enabled: false # default: true
|
blank_issues_enabled: false # default: true
|
||||||
contact_links:
|
contact_links:
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
---
|
---
|
||||||
# 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: Documentation Report
|
name: Documentation Report
|
||||||
description: Ask us about docs
|
description: Ask us about docs
|
||||||
# NOTE: issue body is enabled to allow screenshots
|
# NOTE: issue body is enabled to allow screenshots
|
||||||
@@ -46,8 +42,8 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: Component Name
|
label: Component Name
|
||||||
description: >-
|
description: >-
|
||||||
Write the short name of the file, module, plugin, task or feature below,
|
Write the short name of the rst file, module, plugin, task or
|
||||||
*use your best guess if unsure*. Do not include `community.general.`!
|
feature below, *use your best guess if unsure*.
|
||||||
placeholder: mysql_user
|
placeholder: mysql_user
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
8
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
8
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -1,8 +1,4 @@
|
|||||||
---
|
---
|
||||||
# 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: Feature request
|
name: Feature request
|
||||||
description: Suggest an idea for this project
|
description: Suggest an idea for this project
|
||||||
|
|
||||||
@@ -42,8 +38,8 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: Component Name
|
label: Component Name
|
||||||
description: >-
|
description: >-
|
||||||
Write the short name of the module or plugin, or which other part(s) of the collection this feature affects.
|
Write the short name of the module, plugin, task or feature below,
|
||||||
*use your best guess if unsure*. Do not include `community.general.`!
|
*use your best guess if unsure*.
|
||||||
placeholder: dnf, apt, yum, pip, user etc.
|
placeholder: dnf, apt, yum, pip, user etc.
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
9
.github/dependabot.yml
vendored
9
.github/dependabot.yml
vendored
@@ -1,11 +1,6 @@
|
|||||||
---
|
|
||||||
# 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
|
|
||||||
|
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
interval:
|
||||||
interval: "weekly"
|
schedule: "weekly"
|
||||||
|
|||||||
4
.github/patchback.yml
vendored
4
.github/patchback.yml
vendored
@@ -1,8 +1,4 @@
|
|||||||
---
|
---
|
||||||
# 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
|
|
||||||
|
|
||||||
backport_branch_prefix: patchback/backports/
|
backport_branch_prefix: patchback/backports/
|
||||||
backport_label_prefix: backport-
|
backport_label_prefix: backport-
|
||||||
target_branch_prefix: stable-
|
target_branch_prefix: stable-
|
||||||
|
|||||||
32
.github/pull_request_template.md
vendored
32
.github/pull_request_template.md
vendored
@@ -1,32 +0,0 @@
|
|||||||
##### 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
3
.github/pull_request_template.md.license
vendored
@@ -1,3 +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
|
|
||||||
5
.github/settings.yml
vendored
5
.github/settings.yml
vendored
@@ -1,8 +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
|
|
||||||
|
|
||||||
# DO NOT MODIFY
|
# DO NOT MODIFY
|
||||||
|
|
||||||
# Settings: https://probot.github.io/apps/settings/
|
# Settings: https://probot.github.io/apps/settings/
|
||||||
|
|||||||
287
.github/workflows/ansible-test.yml
vendored
287
.github/workflows/ansible-test.yml
vendored
@@ -1,287 +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
|
|
||||||
|
|
||||||
# For the comprehensive list of the inputs supported by the ansible-community/ansible-test-gh-action GitHub Action, see
|
|
||||||
# https://github.com/marketplace/actions/ansible-test
|
|
||||||
|
|
||||||
name: EOL CI
|
|
||||||
on:
|
|
||||||
# Run EOL CI against all pushes (direct commits, also merged PRs), Pull Requests
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- stable-*
|
|
||||||
pull_request:
|
|
||||||
# Run EOL CI once per day (at 10:00 UTC)
|
|
||||||
schedule:
|
|
||||||
- cron: '0 10 * * *'
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
# Make sure there is at most one active run per PR, but do not cancel any non-PR runs
|
|
||||||
group: ${{ github.workflow }}-${{ (github.head_ref && github.event.number) || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
sanity:
|
|
||||||
name: EOL Sanity (Ⓐ${{ matrix.ansible }})
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
ansible:
|
|
||||||
- '2.11'
|
|
||||||
- '2.12'
|
|
||||||
- '2.13'
|
|
||||||
# Ansible-test on various stable branches does not yet work well with cgroups v2.
|
|
||||||
# Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
|
|
||||||
# image for these stable branches. The list of branches where this is necessary will
|
|
||||||
# shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
|
|
||||||
# for the latest list.
|
|
||||||
runs-on: >-
|
|
||||||
${{ contains(fromJson(
|
|
||||||
'["2.9", "2.10", "2.11"]'
|
|
||||||
), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
|
|
||||||
steps:
|
|
||||||
- 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-version: stable-${{ matrix.ansible }}
|
|
||||||
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
|
|
||||||
pull-request-change-detection: 'true'
|
|
||||||
testing-type: sanity
|
|
||||||
|
|
||||||
units:
|
|
||||||
# Ansible-test on various stable branches does not yet work well with cgroups v2.
|
|
||||||
# Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
|
|
||||||
# image for these stable branches. The list of branches where this is necessary will
|
|
||||||
# shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
|
|
||||||
# for the latest list.
|
|
||||||
runs-on: >-
|
|
||||||
${{ contains(fromJson(
|
|
||||||
'["2.9", "2.10", "2.11"]'
|
|
||||||
), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
|
|
||||||
name: EOL Units (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})
|
|
||||||
strategy:
|
|
||||||
# As soon as the first unit test fails, cancel the others to free up the CI queue
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
ansible:
|
|
||||||
- ''
|
|
||||||
python:
|
|
||||||
- ''
|
|
||||||
exclude:
|
|
||||||
- ansible: ''
|
|
||||||
include:
|
|
||||||
- ansible: '2.11'
|
|
||||||
python: '2.7'
|
|
||||||
- ansible: '2.11'
|
|
||||||
python: '3.5'
|
|
||||||
- ansible: '2.12'
|
|
||||||
python: '2.6'
|
|
||||||
- ansible: '2.12'
|
|
||||||
python: '3.8'
|
|
||||||
- ansible: '2.13'
|
|
||||||
python: '2.7'
|
|
||||||
- ansible: '2.13'
|
|
||||||
python: '3.8'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: >-
|
|
||||||
Perform unit testing against
|
|
||||||
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-version: stable-${{ matrix.ansible }}
|
|
||||||
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
|
|
||||||
pre-test-cmd: >-
|
|
||||||
mkdir -p ../../ansible
|
|
||||||
;
|
|
||||||
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools
|
|
||||||
pull-request-change-detection: 'true'
|
|
||||||
target-python-version: ${{ matrix.python }}
|
|
||||||
testing-type: units
|
|
||||||
|
|
||||||
integration:
|
|
||||||
# Ansible-test on various stable branches does not yet work well with cgroups v2.
|
|
||||||
# Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
|
|
||||||
# image for these stable branches. The list of branches where this is necessary will
|
|
||||||
# shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
|
|
||||||
# for the latest list.
|
|
||||||
runs-on: >-
|
|
||||||
${{ contains(fromJson(
|
|
||||||
'["2.9", "2.10", "2.11"]'
|
|
||||||
), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
|
|
||||||
name: EOL I (Ⓐ${{ matrix.ansible }}+${{ matrix.docker }}+py${{ matrix.python }}:${{ matrix.target }})
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
ansible:
|
|
||||||
- ''
|
|
||||||
docker:
|
|
||||||
- ''
|
|
||||||
python:
|
|
||||||
- ''
|
|
||||||
target:
|
|
||||||
- ''
|
|
||||||
exclude:
|
|
||||||
- ansible: ''
|
|
||||||
include:
|
|
||||||
# 2.11
|
|
||||||
- ansible: '2.11'
|
|
||||||
docker: fedora32
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/1/
|
|
||||||
- ansible: '2.11'
|
|
||||||
docker: fedora32
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/2/
|
|
||||||
- ansible: '2.11'
|
|
||||||
docker: fedora32
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/3/
|
|
||||||
- ansible: '2.11'
|
|
||||||
docker: fedora33
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/1/
|
|
||||||
- ansible: '2.11'
|
|
||||||
docker: fedora33
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/2/
|
|
||||||
- ansible: '2.11'
|
|
||||||
docker: fedora33
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/3/
|
|
||||||
- ansible: '2.11'
|
|
||||||
docker: alpine3
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/1/
|
|
||||||
- ansible: '2.11'
|
|
||||||
docker: alpine3
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/2/
|
|
||||||
- ansible: '2.11'
|
|
||||||
docker: alpine3
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/3/
|
|
||||||
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
|
|
||||||
# - ansible: '2.11'
|
|
||||||
# docker: default
|
|
||||||
# python: '2.7'
|
|
||||||
# target: azp/generic/1/
|
|
||||||
# - 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/
|
|
||||||
# 2.13
|
|
||||||
- ansible: '2.13'
|
|
||||||
docker: fedora35
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/1/
|
|
||||||
- ansible: '2.13'
|
|
||||||
docker: fedora35
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/2/
|
|
||||||
- ansible: '2.13'
|
|
||||||
docker: fedora35
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/3/
|
|
||||||
- ansible: '2.13'
|
|
||||||
docker: opensuse15py2
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/1/
|
|
||||||
- ansible: '2.13'
|
|
||||||
docker: opensuse15py2
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/2/
|
|
||||||
- ansible: '2.13'
|
|
||||||
docker: opensuse15py2
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/3/
|
|
||||||
- ansible: '2.13'
|
|
||||||
docker: alpine3
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/1/
|
|
||||||
- ansible: '2.13'
|
|
||||||
docker: alpine3
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/2/
|
|
||||||
- ansible: '2.13'
|
|
||||||
docker: alpine3
|
|
||||||
python: ''
|
|
||||||
target: azp/posix/3/
|
|
||||||
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
|
|
||||||
# - ansible: '2.13'
|
|
||||||
# docker: default
|
|
||||||
# python: '3.9'
|
|
||||||
# target: azp/generic/1/
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: >-
|
|
||||||
Perform integration testing against
|
|
||||||
Ansible version ${{ matrix.ansible }}
|
|
||||||
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-version: stable-${{ matrix.ansible }}
|
|
||||||
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
|
|
||||||
docker-image: ${{ matrix.docker }}
|
|
||||||
integration-continue-on-error: 'false'
|
|
||||||
integration-diff: 'false'
|
|
||||||
integration-retry-on-error: 'true'
|
|
||||||
pre-test-cmd: >-
|
|
||||||
mkdir -p ../../ansible
|
|
||||||
;
|
|
||||||
git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.posix.git ../../ansible/posix
|
|
||||||
;
|
|
||||||
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.crypto.git ../../community/crypto
|
|
||||||
;
|
|
||||||
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools
|
|
||||||
pull-request-change-detection: 'true'
|
|
||||||
target: ${{ matrix.target }}
|
|
||||||
target-python-version: ${{ matrix.python }}
|
|
||||||
testing-type: integration
|
|
||||||
49
.github/workflows/codeql-analysis.yml
vendored
49
.github/workflows/codeql-analysis.yml
vendored
@@ -1,36 +1,49 @@
|
|||||||
---
|
|
||||||
# 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: "Code scanning - action"
|
name: "Code scanning - action"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '26 19 * * 1'
|
- cron: '26 19 * * 1'
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
CodeQL-Build:
|
CodeQL-Build:
|
||||||
|
|
||||||
permissions:
|
|
||||||
actions: read # for github/codeql-action/init to get workflow details
|
|
||||||
contents: read # for actions/checkout to fetch code
|
|
||||||
security-events: write # for github/codeql-action/autobuild to send a status report
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v2
|
||||||
|
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.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v1
|
||||||
with:
|
# Override language selection by uncommenting this and choosing your languages
|
||||||
languages: python
|
# 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@v1
|
||||||
|
|
||||||
|
# ℹ️ 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
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v2
|
uses: github/codeql-action/analyze@v1
|
||||||
|
|||||||
35
.github/workflows/reuse.yml
vendored
35
.github/workflows/reuse.yml
vendored
@@ -1,35 +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
|
|
||||||
|
|
||||||
name: Verify REUSE
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
pull_request_target:
|
|
||||||
types: [opened, synchronize, reopened]
|
|
||||||
branches: [main]
|
|
||||||
# Run CI once per day (at 07:30 UTC)
|
|
||||||
schedule:
|
|
||||||
- cron: '30 7 * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check:
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.pull_request.head.sha || '' }}
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
pip install reuse
|
|
||||||
|
|
||||||
- name: Check REUSE compliance
|
|
||||||
run: |
|
|
||||||
reuse lint
|
|
||||||
110
.gitignore
vendored
110
.gitignore
vendored
@@ -1,9 +1,6 @@
|
|||||||
# 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
|
|
||||||
|
|
||||||
# Created by https://www.toptal.com/developers/gitignore/api/vim,git,macos,linux,pydev,emacs,dotenv,python,windows,webstorm,pycharm+all,jupyternotebooks
|
# Created by https://www.toptal.com/developers/gitignore/api/git,linux,pydev,python,windows,pycharm+all,jupyternotebook,vim,webstorm,emacs,dotenv
|
||||||
# Edit at https://www.toptal.com/developers/gitignore?templates=vim,git,macos,linux,pydev,emacs,dotenv,python,windows,webstorm,pycharm+all,jupyternotebooks
|
# Edit at https://www.toptal.com/developers/gitignore?templates=git,linux,pydev,python,windows,pycharm+all,jupyternotebook,vim,webstorm,emacs,dotenv
|
||||||
|
|
||||||
### dotenv ###
|
### dotenv ###
|
||||||
.env
|
.env
|
||||||
@@ -74,19 +71,7 @@ flycheck_*.el
|
|||||||
*_LOCAL_*.txt
|
*_LOCAL_*.txt
|
||||||
*_REMOTE_*.txt
|
*_REMOTE_*.txt
|
||||||
|
|
||||||
### JupyterNotebooks ###
|
#!! ERROR: jupyternotebook is undefined. Use list command to see defined gitignore types !!#
|
||||||
# gitignore template for Jupyter Notebooks
|
|
||||||
# website: http://jupyter.org/
|
|
||||||
|
|
||||||
.ipynb_checkpoints
|
|
||||||
*/.ipynb_checkpoints/*
|
|
||||||
|
|
||||||
# IPython
|
|
||||||
profile_default/
|
|
||||||
ipython_config.py
|
|
||||||
|
|
||||||
# Remove previous ipynb_checkpoints
|
|
||||||
# git rm -r .ipynb_checkpoints/
|
|
||||||
|
|
||||||
### Linux ###
|
### Linux ###
|
||||||
|
|
||||||
@@ -102,39 +87,6 @@ ipython_config.py
|
|||||||
# .nfs files are created when an open file is removed but is still being accessed
|
# .nfs files are created when an open file is removed but is still being accessed
|
||||||
.nfs*
|
.nfs*
|
||||||
|
|
||||||
### macOS ###
|
|
||||||
# General
|
|
||||||
.DS_Store
|
|
||||||
.AppleDouble
|
|
||||||
.LSOverride
|
|
||||||
|
|
||||||
# Icon must end with two \r
|
|
||||||
Icon
|
|
||||||
|
|
||||||
|
|
||||||
# Thumbnails
|
|
||||||
._*
|
|
||||||
|
|
||||||
# Files that might appear in the root of a volume
|
|
||||||
.DocumentRevisions-V100
|
|
||||||
.fseventsd
|
|
||||||
.Spotlight-V100
|
|
||||||
.TemporaryItems
|
|
||||||
.Trashes
|
|
||||||
.VolumeIcon.icns
|
|
||||||
.com.apple.timemachine.donotpresent
|
|
||||||
|
|
||||||
# Directories potentially created on remote AFP share
|
|
||||||
.AppleDB
|
|
||||||
.AppleDesktop
|
|
||||||
Network Trash Folder
|
|
||||||
Temporary Items
|
|
||||||
.apdisk
|
|
||||||
|
|
||||||
### macOS Patch ###
|
|
||||||
# iCloud generated files
|
|
||||||
*.icloud
|
|
||||||
|
|
||||||
### PyCharm+all ###
|
### PyCharm+all ###
|
||||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
||||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||||
@@ -199,9 +151,6 @@ atlassian-ide-plugin.xml
|
|||||||
# Cursive Clojure plugin
|
# Cursive Clojure plugin
|
||||||
.idea/replstate.xml
|
.idea/replstate.xml
|
||||||
|
|
||||||
# SonarLint plugin
|
|
||||||
.idea/sonarlint/
|
|
||||||
|
|
||||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
com_crashlytics_export_strings.xml
|
com_crashlytics_export_strings.xml
|
||||||
crashlytics.properties
|
crashlytics.properties
|
||||||
@@ -215,13 +164,20 @@ fabric.properties
|
|||||||
.idea/caches/build_file_checksums.ser
|
.idea/caches/build_file_checksums.ser
|
||||||
|
|
||||||
### PyCharm+all Patch ###
|
### PyCharm+all Patch ###
|
||||||
# Ignore everything but code style settings and run configurations
|
# Ignores the whole .idea folder and all .iml files
|
||||||
# that are supposed to be shared within teams.
|
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
|
||||||
|
|
||||||
.idea/*
|
.idea/
|
||||||
|
|
||||||
!.idea/codeStyles
|
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
|
||||||
!.idea/runConfigurations
|
|
||||||
|
*.iml
|
||||||
|
modules.xml
|
||||||
|
.idea/misc.xml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
# Sonarlint plugin
|
||||||
|
.idea/sonarlint
|
||||||
|
|
||||||
### pydev ###
|
### pydev ###
|
||||||
.pydevproject
|
.pydevproject
|
||||||
@@ -304,13 +260,16 @@ docs/_build/
|
|||||||
target/
|
target/
|
||||||
|
|
||||||
# Jupyter Notebook
|
# Jupyter Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
# IPython
|
# IPython
|
||||||
|
profile_default/
|
||||||
|
ipython_config.py
|
||||||
|
|
||||||
# pyenv
|
# pyenv
|
||||||
# For a library or package, you might want to ignore these files since the code is
|
# For a library or package, you might want to ignore these files since the code is
|
||||||
# intended to run in multiple environments; otherwise, check them in:
|
# intended to run in multiple environments; otherwise, check them in:
|
||||||
# .python-version
|
.python-version
|
||||||
|
|
||||||
# pipenv
|
# pipenv
|
||||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||||
@@ -319,22 +278,7 @@ target/
|
|||||||
# install all needed dependencies.
|
# install all needed dependencies.
|
||||||
#Pipfile.lock
|
#Pipfile.lock
|
||||||
|
|
||||||
# poetry
|
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
||||||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
||||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
||||||
# commonly ignored for libraries.
|
|
||||||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
||||||
#poetry.lock
|
|
||||||
|
|
||||||
# pdm
|
|
||||||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
||||||
#pdm.lock
|
|
||||||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
||||||
# in version control.
|
|
||||||
# https://pdm.fming.dev/#use-with-ide
|
|
||||||
.pdm.toml
|
|
||||||
|
|
||||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
||||||
__pypackages__/
|
__pypackages__/
|
||||||
|
|
||||||
# Celery stuff
|
# Celery stuff
|
||||||
@@ -376,13 +320,6 @@ dmypy.json
|
|||||||
# Cython debug symbols
|
# Cython debug symbols
|
||||||
cython_debug/
|
cython_debug/
|
||||||
|
|
||||||
# PyCharm
|
|
||||||
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
||||||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
||||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
||||||
#.idea/
|
|
||||||
|
|
||||||
### Vim ###
|
### Vim ###
|
||||||
# Swap
|
# Swap
|
||||||
[._]*.s[a-v][a-z]
|
[._]*.s[a-v][a-z]
|
||||||
@@ -444,8 +381,6 @@ tags
|
|||||||
|
|
||||||
# Cursive Clojure plugin
|
# Cursive Clojure plugin
|
||||||
|
|
||||||
# SonarLint plugin
|
|
||||||
|
|
||||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
|
||||||
# Editor-based Rest Client
|
# Editor-based Rest Client
|
||||||
@@ -508,7 +443,4 @@ $RECYCLE.BIN/
|
|||||||
# Windows shortcuts
|
# Windows shortcuts
|
||||||
*.lnk
|
*.lnk
|
||||||
|
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/vim,git,macos,linux,pydev,emacs,dotenv,python,windows,webstorm,pycharm+all,jupyternotebooks
|
# End of https://www.toptal.com/developers/gitignore/api/git,linux,pydev,python,windows,pycharm+all,jupyternotebook,vim,webstorm,emacs,dotenv
|
||||||
|
|
||||||
# Integration tests cloud configs
|
|
||||||
tests/integration/cloud-config-*.ini
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
|
||||||
|
|
||||||
Files: changelogs/fragments/*
|
|
||||||
Copyright: Ansible Project
|
|
||||||
License: GPL-3.0-or-later
|
|
||||||
1329
CHANGELOG.rst
1329
CHANGELOG.rst
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
|||||||
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
|
|
||||||
SPDX-FileCopyrightText: Ansible Project
|
|
||||||
@@ -1,9 +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
|
|
||||||
-->
|
|
||||||
|
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
We follow [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) in all our contributions and interactions within this repository.
|
We follow [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) in all our contributions and interactions within this repository.
|
||||||
@@ -31,7 +25,7 @@ Also, consider taking up a valuable, reviewed, but abandoned pull request which
|
|||||||
* Try committing your changes with an informative but short commit message.
|
* 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 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.
|
* 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. 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#changelogs-how-to). (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 :) )
|
||||||
* 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.
|
* 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).
|
You can also read [our Quick-start development guide](https://github.com/ansible/community-docs/blob/main/create_pr_quick_start_guide.rst).
|
||||||
@@ -112,9 +106,13 @@ Creating new modules and plugins requires a bit more work than other Pull Reques
|
|||||||
- Make sure that new plugins and modules have tests (unit tests, integration tests, or both); it is preferable to have some tests
|
- Make sure that new plugins and modules have tests (unit tests, integration tests, or both); it is preferable to have some tests
|
||||||
which run in CI.
|
which run in CI.
|
||||||
|
|
||||||
4. Action plugins need to be accompanied by a module, even if the module file only contains documentation
|
4. For modules and action plugins, make sure to create your module/plugin in the correct subdirectory, and create a symbolic link
|
||||||
(`DOCUMENTATION`, `EXAMPLES` and `RETURN`). The module must have the same name and directory path in `plugins/modules/`
|
from `plugins/modules/` respectively `plugins/action/` to the actual module/plugin code. (Other plugin types should not use
|
||||||
than the action plugin has in `plugins/action/`.
|
subdirectories.)
|
||||||
|
|
||||||
|
- Action plugins need to be accompanied by a module, even if the module file only contains documentation
|
||||||
|
(`DOCUMENTATION`, `EXAMPLES` and `RETURN`). The module must have the same name and directory path in `plugins/modules/`
|
||||||
|
than the action plugin has in `plugins/action/`.
|
||||||
|
|
||||||
5. Make sure to add a BOTMETA entry for your new module/plugin in `.github/BOTMETA.yml`. Search for other plugins/modules in the
|
5. Make sure to add a BOTMETA entry for your new module/plugin in `.github/BOTMETA.yml`. Search for other plugins/modules in the
|
||||||
same directory to see how entries could look. You should list all authors either as `maintainers` or under `ignore`. People
|
same directory to see how entries could look. You should list all authors either as `maintainers` or under `ignore`. People
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../COPYING
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) <year> <copyright holders>
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
|
|
||||||
--------------------------------------------
|
|
||||||
|
|
||||||
1. This LICENSE AGREEMENT is between the Python Software Foundation
|
|
||||||
("PSF"), and the Individual or Organization ("Licensee") accessing and
|
|
||||||
otherwise using this software ("Python") in source or binary form and
|
|
||||||
its associated documentation.
|
|
||||||
|
|
||||||
2. Subject to the terms and conditions of this License Agreement, PSF hereby
|
|
||||||
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
|
|
||||||
analyze, test, perform and/or display publicly, prepare derivative works,
|
|
||||||
distribute, and otherwise use Python alone or in any derivative version,
|
|
||||||
provided, however, that PSF's License Agreement and PSF's notice of copyright,
|
|
||||||
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
|
||||||
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation;
|
|
||||||
All Rights Reserved" are retained in Python alone or in any derivative version
|
|
||||||
prepared by Licensee.
|
|
||||||
|
|
||||||
3. In the event Licensee prepares a derivative work that is based on
|
|
||||||
or incorporates Python or any part thereof, and wants to make
|
|
||||||
the derivative work available to others as provided herein, then
|
|
||||||
Licensee hereby agrees to include in any such work a brief summary of
|
|
||||||
the changes made to Python.
|
|
||||||
|
|
||||||
4. PSF is making Python available to Licensee on an "AS IS"
|
|
||||||
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
|
||||||
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
|
|
||||||
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
|
|
||||||
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
|
|
||||||
INFRINGE ANY THIRD PARTY RIGHTS.
|
|
||||||
|
|
||||||
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
|
|
||||||
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
|
|
||||||
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
|
|
||||||
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
|
|
||||||
|
|
||||||
6. This License Agreement will automatically terminate upon a material
|
|
||||||
breach of its terms and conditions.
|
|
||||||
|
|
||||||
7. Nothing in this License Agreement shall be deemed to create any
|
|
||||||
relationship of agency, partnership, or joint venture between PSF and
|
|
||||||
Licensee. This License Agreement does not grant permission to use PSF
|
|
||||||
trademarks or trade name in a trademark sense to endorse or promote
|
|
||||||
products or services of Licensee, or any third party.
|
|
||||||
|
|
||||||
8. By copying, installing or otherwise using Python, Licensee
|
|
||||||
agrees to be bound by the terms and conditions of this License
|
|
||||||
Agreement.
|
|
||||||
37
README.md
37
README.md
@@ -1,13 +1,6 @@
|
|||||||
<!--
|
|
||||||
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
|
|
||||||
-->
|
|
||||||
|
|
||||||
# Community General Collection
|
# 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)
|
[](https://codecov.io/gh/ansible-collections/community.general)
|
||||||
|
|
||||||
This repository contains the `community.general` Ansible Collection. The collection is a part of the Ansible package and includes many modules and plugins supported by Ansible community which are not part of more specialized community collections.
|
This repository contains the `community.general` Ansible Collection. The collection is a part of the Ansible package and includes many modules and plugins supported by Ansible community which are not part of more specialized community collections.
|
||||||
@@ -24,9 +17,7 @@ If you encounter abusive behavior violating the [Ansible Code of Conduct](https:
|
|||||||
|
|
||||||
## Tested with Ansible
|
## Tested with Ansible
|
||||||
|
|
||||||
Tested with the current ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, ansible-core 2.14, ansible-core 2.15, ansible-core 2.16 releases and the current development version of ansible-core. Ansible-core versions before 2.11.0 are not supported. This includes all ansible-base 2.10 and Ansible 2.9 releases.
|
Tested with the current Ansible 2.9, ansible-base 2.10, ansible-core 2.11, ansible-core 2.12 releases and the current development version of ansible-core. Ansible versions before 2.9.10 are not supported.
|
||||||
|
|
||||||
Parts of this collection will not work with ansible-core 2.11 on Python 3.12+.
|
|
||||||
|
|
||||||
## External requirements
|
## External requirements
|
||||||
|
|
||||||
@@ -34,13 +25,13 @@ Some modules and plugins require external libraries. Please check the requiremen
|
|||||||
|
|
||||||
## Included content
|
## Included content
|
||||||
|
|
||||||
Please check the included content on the [Ansible Galaxy page for this collection](https://galaxy.ansible.com/ui/repo/published/community/general/) or the [documentation on the Ansible docs site](https://docs.ansible.com/ansible/latest/collections/community/general/).
|
Please check the included content on the [Ansible Galaxy page for this collection](https://galaxy.ansible.com/community/general) or the [documentation on the Ansible docs site](https://docs.ansible.com/ansible/latest/collections/community/general/).
|
||||||
|
|
||||||
## Using this collection
|
## Using this collection
|
||||||
|
|
||||||
This collection is shipped with the Ansible package. So if you have it installed, no more action is required.
|
This collection is shipped with the Ansible package. So if you have it installed, no more action is required.
|
||||||
|
|
||||||
If you have a minimal installation (only Ansible Core installed) or you want to use the latest version of the collection along with the whole Ansible package, you need to install the collection from [Ansible Galaxy](https://galaxy.ansible.com/ui/repo/published/community/general/) manually with the `ansible-galaxy` command-line tool:
|
If you have a minimal installation (only Ansible Core installed) or you want to use the latest version of the collection along with the whole Ansible package, you need to install the collection from [Ansible Galaxy](https://galaxy.ansible.com/community/general) manually with the `ansible-galaxy` command-line tool:
|
||||||
|
|
||||||
ansible-galaxy collection install community.general
|
ansible-galaxy collection install community.general
|
||||||
|
|
||||||
@@ -57,7 +48,7 @@ Note that if you install the collection manually, it will not be upgraded automa
|
|||||||
ansible-galaxy collection install community.general --upgrade
|
ansible-galaxy collection install community.general --upgrade
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax where `X.Y.Z` can be any [available version](https://galaxy.ansible.com/ui/repo/published/community/general/):
|
You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax where `X.Y.Z` can be any [available version](https://galaxy.ansible.com/community/general):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ansible-galaxy collection install community.general:==X.Y.Z
|
ansible-galaxy collection install community.general:==X.Y.Z
|
||||||
@@ -73,13 +64,13 @@ We are actively accepting new contributors.
|
|||||||
|
|
||||||
All types of contributions are very welcome.
|
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-7/CONTRIBUTING.md)!
|
You don't know how to start? Refer to our [contribution guide](https://github.com/ansible-collections/community.general/blob/stable-4/CONTRIBUTING.md)!
|
||||||
|
|
||||||
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.
|
The current maintainers are listed in the [commit-rights.md](https://github.com/ansible-collections/community.general/blob/stable-4/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).
|
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-7/CONTRIBUTING.md).
|
Also for some notes specific to this collection see [our CONTRIBUTING documentation](https://github.com/ansible-collections/community.general/blob/stable-4/CONTRIBUTING.md).
|
||||||
|
|
||||||
### Running tests
|
### Running tests
|
||||||
|
|
||||||
@@ -89,7 +80,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:
|
To learn how to maintain / become a maintainer of this collection, refer to:
|
||||||
|
|
||||||
* [Committer guidelines](https://github.com/ansible-collections/community.general/blob/stable-7/commit-rights.md).
|
* [Committer guidelines](https://github.com/ansible-collections/community.general/blob/stable-4/commit-rights.md).
|
||||||
* [Maintainer guidelines](https://github.com/ansible/community-docs/blob/main/maintaining.rst).
|
* [Maintainer guidelines](https://github.com/ansible/community-docs/blob/main/maintaining.rst).
|
||||||
|
|
||||||
It is necessary for maintainers of this collection to be subscribed to:
|
It is necessary for maintainers of this collection to be subscribed to:
|
||||||
@@ -117,7 +108,7 @@ See the [Releasing guidelines](https://github.com/ansible/community-docs/blob/ma
|
|||||||
|
|
||||||
## Release notes
|
## Release notes
|
||||||
|
|
||||||
See the [changelog](https://github.com/ansible-collections/community.general/blob/stable-7/CHANGELOG.rst).
|
See the [changelog](https://github.com/ansible-collections/community.general/blob/stable-4/CHANGELOG.rst).
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
|
|
||||||
@@ -134,10 +125,6 @@ See [this issue](https://github.com/ansible-collections/community.general/issues
|
|||||||
|
|
||||||
## Licensing
|
## Licensing
|
||||||
|
|
||||||
This collection is primarily licensed and distributed as a whole under the GNU General Public License v3.0 or later.
|
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-7/COPYING) for the full text.
|
See [COPYING](https://www.gnu.org/licenses/gpl-3.0.txt) to see the full text.
|
||||||
|
|
||||||
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/).
|
|
||||||
|
|||||||
4
changelogs/.gitignore
vendored
4
changelogs/.gitignore
vendored
@@ -1,5 +1 @@
|
|||||||
# 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
|
|
||||||
|
|
||||||
/.plugin-cache.yaml
|
/.plugin-cache.yaml
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
|||||||
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
|
|
||||||
SPDX-FileCopyrightText: Ansible Project
|
|
||||||
@@ -1,8 +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
|
|
||||||
|
|
||||||
changelog_filename_template: ../CHANGELOG.rst
|
changelog_filename_template: ../CHANGELOG.rst
|
||||||
changelog_filename_version_depth: 0
|
changelog_filename_version_depth: 0
|
||||||
changes_file: changelog.yaml
|
changes_file: changelog.yaml
|
||||||
|
|||||||
@@ -1,9 +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
|
|
||||||
-->
|
|
||||||
|
|
||||||
Committers Guidelines for community.general
|
Committers Guidelines for community.general
|
||||||
===========================================
|
===========================================
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
---
|
---
|
||||||
# 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
|
|
||||||
|
|
||||||
sections:
|
sections:
|
||||||
- title: Guides
|
- title: Guides
|
||||||
toctree:
|
toctree:
|
||||||
|
|||||||
@@ -1,18 +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
|
|
||||||
|
|
||||||
list1:
|
|
||||||
- name: foo
|
|
||||||
extra: true
|
|
||||||
- name: bar
|
|
||||||
extra: false
|
|
||||||
- name: meh
|
|
||||||
extra: true
|
|
||||||
|
|
||||||
list2:
|
|
||||||
- name: foo
|
|
||||||
path: /foo
|
|
||||||
- name: baz
|
|
||||||
path: /baz
|
|
||||||
@@ -1,24 +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
|
|
||||||
|
|
||||||
list1:
|
|
||||||
- name: myname01
|
|
||||||
param01:
|
|
||||||
x: default_value
|
|
||||||
y: default_value
|
|
||||||
list:
|
|
||||||
- default_value
|
|
||||||
- name: myname02
|
|
||||||
param01: [1, 1, 2, 3]
|
|
||||||
|
|
||||||
list2:
|
|
||||||
- name: myname01
|
|
||||||
param01:
|
|
||||||
y: patch_value
|
|
||||||
z: patch_value
|
|
||||||
list:
|
|
||||||
- patch_value
|
|
||||||
- name: myname02
|
|
||||||
param01: [3, 4, 4, {key: value}]
|
|
||||||
@@ -1,14 +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
|
|
||||||
|
|
||||||
- name: 1. Merge two lists by common attribute 'name'
|
|
||||||
include_vars:
|
|
||||||
dir: example-001_vars
|
|
||||||
- debug:
|
|
||||||
var: list3
|
|
||||||
when: debug|d(false)|bool
|
|
||||||
- template:
|
|
||||||
src: list3.out.j2
|
|
||||||
dest: example-001.out
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../default-common.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
|
|
||||||
|
|
||||||
list3: "{{ list1|
|
|
||||||
community.general.lists_mergeby(list2, 'name') }}"
|
|
||||||
@@ -1,14 +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
|
|
||||||
|
|
||||||
- name: 2. Merge two lists by common attribute 'name'
|
|
||||||
include_vars:
|
|
||||||
dir: example-002_vars
|
|
||||||
- debug:
|
|
||||||
var: list3
|
|
||||||
when: debug|d(false)|bool
|
|
||||||
- template:
|
|
||||||
src: list3.out.j2
|
|
||||||
dest: example-002.out
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../default-common.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
|
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
|
||||||
community.general.lists_mergeby('name') }}"
|
|
||||||
@@ -1,14 +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
|
|
||||||
|
|
||||||
- name: 3. Merge recursive by 'name', replace lists (default)
|
|
||||||
include_vars:
|
|
||||||
dir: example-003_vars
|
|
||||||
- debug:
|
|
||||||
var: list3
|
|
||||||
when: debug|d(false)|bool
|
|
||||||
- template:
|
|
||||||
src: list3.out.j2
|
|
||||||
dest: example-003.out
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../default-recursive-true.yml
|
|
||||||
@@ -1,8 +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
|
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
|
||||||
community.general.lists_mergeby('name',
|
|
||||||
recursive=true) }}"
|
|
||||||
@@ -1,14 +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
|
|
||||||
|
|
||||||
- name: 4. Merge recursive by 'name', keep lists
|
|
||||||
include_vars:
|
|
||||||
dir: example-004_vars
|
|
||||||
- debug:
|
|
||||||
var: list3
|
|
||||||
when: debug|d(false)|bool
|
|
||||||
- template:
|
|
||||||
src: list3.out.j2
|
|
||||||
dest: example-004.out
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../default-recursive-true.yml
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright (c) Ansible Project
|
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
|
||||||
community.general.lists_mergeby('name',
|
|
||||||
recursive=true,
|
|
||||||
list_merge='keep') }}"
|
|
||||||
@@ -1,14 +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
|
|
||||||
|
|
||||||
- name: 5. Merge recursive by 'name', append lists
|
|
||||||
include_vars:
|
|
||||||
dir: example-005_vars
|
|
||||||
- debug:
|
|
||||||
var: list3
|
|
||||||
when: debug|d(false)|bool
|
|
||||||
- template:
|
|
||||||
src: list3.out.j2
|
|
||||||
dest: example-005.out
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../default-recursive-true.yml
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright (c) Ansible Project
|
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
|
||||||
community.general.lists_mergeby('name',
|
|
||||||
recursive=true,
|
|
||||||
list_merge='append') }}"
|
|
||||||
@@ -1,14 +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
|
|
||||||
|
|
||||||
- name: 6. Merge recursive by 'name', prepend lists
|
|
||||||
include_vars:
|
|
||||||
dir: example-006_vars
|
|
||||||
- debug:
|
|
||||||
var: list3
|
|
||||||
when: debug|d(false)|bool
|
|
||||||
- template:
|
|
||||||
src: list3.out.j2
|
|
||||||
dest: example-006.out
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../default-recursive-true.yml
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright (c) Ansible Project
|
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
|
||||||
community.general.lists_mergeby('name',
|
|
||||||
recursive=true,
|
|
||||||
list_merge='prepend') }}"
|
|
||||||
@@ -1,14 +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
|
|
||||||
|
|
||||||
- name: 7. Merge recursive by 'name', append lists 'remove present'
|
|
||||||
include_vars:
|
|
||||||
dir: example-007_vars
|
|
||||||
- debug:
|
|
||||||
var: list3
|
|
||||||
when: debug|d(false)|bool
|
|
||||||
- template:
|
|
||||||
src: list3.out.j2
|
|
||||||
dest: example-007.out
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../default-recursive-true.yml
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright (c) Ansible Project
|
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
|
||||||
community.general.lists_mergeby('name',
|
|
||||||
recursive=true,
|
|
||||||
list_merge='append_rp') }}"
|
|
||||||
@@ -1,14 +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
|
|
||||||
|
|
||||||
- name: 8. Merge recursive by 'name', prepend lists 'remove present'
|
|
||||||
include_vars:
|
|
||||||
dir: example-008_vars
|
|
||||||
- debug:
|
|
||||||
var: list3
|
|
||||||
when: debug|d(false)|bool
|
|
||||||
- template:
|
|
||||||
src: list3.out.j2
|
|
||||||
dest: example-008.out
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../default-recursive-true.yml
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright (c) Ansible Project
|
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
|
||||||
community.general.lists_mergeby('name',
|
|
||||||
recursive=true,
|
|
||||||
list_merge='prepend_rp') }}"
|
|
||||||
8
docs/docsite/helper/lists_mergeby/examples.rst.j2
Normal file
8
docs/docsite/helper/lists_mergeby/examples.rst.j2
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{% for i in examples %}
|
||||||
|
{{ i.label }}
|
||||||
|
|
||||||
|
.. code-block:: {{ i.lang }}
|
||||||
|
|
||||||
|
{{ lookup('file', source_path ~ i.file)|indent(2) }}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
@@ -1,53 +1,37 @@
|
|||||||
---
|
---
|
||||||
# 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
|
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
- label: 'In the example below the lists are merged by the attribute ``name``:'
|
|
||||||
file: example-001_vars/list3.yml
|
|
||||||
lang: 'yaml+jinja'
|
|
||||||
- label: 'This produces:'
|
|
||||||
file: example-001.out
|
|
||||||
lang: 'yaml'
|
|
||||||
- label: 'It is possible to use a list of lists as an input of the filter:'
|
|
||||||
file: example-002_vars/list3.yml
|
|
||||||
lang: 'yaml+jinja'
|
|
||||||
- label: 'This produces the same result as in the previous example:'
|
|
||||||
file: example-002.out
|
|
||||||
lang: 'yaml'
|
|
||||||
- label: 'Example ``list_merge=replace`` (default):'
|
- label: 'Example ``list_merge=replace`` (default):'
|
||||||
file: example-003_vars/list3.yml
|
file: example-003.yml
|
||||||
lang: 'yaml+jinja'
|
lang: 'yaml+jinja'
|
||||||
- label: 'This produces:'
|
- label: 'This produces:'
|
||||||
file: example-003.out
|
file: example-003.out
|
||||||
lang: 'yaml'
|
lang: 'yaml'
|
||||||
- label: 'Example ``list_merge=keep``:'
|
- label: 'Example ``list_merge=keep``:'
|
||||||
file: example-004_vars/list3.yml
|
file: example-004.yml
|
||||||
lang: 'yaml+jinja'
|
lang: 'yaml+jinja'
|
||||||
- label: 'This produces:'
|
- label: 'This produces:'
|
||||||
file: example-004.out
|
file: example-004.out
|
||||||
lang: 'yaml'
|
lang: 'yaml'
|
||||||
- label: 'Example ``list_merge=append``:'
|
- label: 'Example ``list_merge=append``:'
|
||||||
file: example-005_vars/list3.yml
|
file: example-005.yml
|
||||||
lang: 'yaml+jinja'
|
lang: 'yaml+jinja'
|
||||||
- label: 'This produces:'
|
- label: 'This produces:'
|
||||||
file: example-005.out
|
file: example-005.out
|
||||||
lang: 'yaml'
|
lang: 'yaml'
|
||||||
- label: 'Example ``list_merge=prepend``:'
|
- label: 'Example ``list_merge=prepend``:'
|
||||||
file: example-006_vars/list3.yml
|
file: example-006.yml
|
||||||
lang: 'yaml+jinja'
|
lang: 'yaml+jinja'
|
||||||
- label: 'This produces:'
|
- label: 'This produces:'
|
||||||
file: example-006.out
|
file: example-006.out
|
||||||
lang: 'yaml'
|
lang: 'yaml'
|
||||||
- label: 'Example ``list_merge=append_rp``:'
|
- label: 'Example ``list_merge=append_rp``:'
|
||||||
file: example-007_vars/list3.yml
|
file: example-007.yml
|
||||||
lang: 'yaml+jinja'
|
lang: 'yaml+jinja'
|
||||||
- label: 'This produces:'
|
- label: 'This produces:'
|
||||||
file: example-007.out
|
file: example-007.out
|
||||||
lang: 'yaml'
|
lang: 'yaml'
|
||||||
- label: 'Example ``list_merge=prepend_rp``:'
|
- label: 'Example ``list_merge=prepend_rp``:'
|
||||||
file: example-008_vars/list3.yml
|
file: example-008.yml
|
||||||
lang: 'yaml+jinja'
|
lang: 'yaml+jinja'
|
||||||
- label: 'This produces:'
|
- label: 'This produces:'
|
||||||
file: example-008.out
|
file: example-008.out
|
||||||
|
|||||||
@@ -1,13 +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
|
|
||||||
|
|
||||||
{% for i in examples %}
|
|
||||||
{{ i.label }}
|
|
||||||
|
|
||||||
.. code-block:: {{ i.lang }}
|
|
||||||
|
|
||||||
{{ lookup('file', i.file)|indent(2) }}
|
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
@@ -1,62 +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
|
|
||||||
|
|
||||||
Merging lists of dictionaries
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
If you have two or more lists of dictionaries and want to combine them into a list of merged dictionaries, where the dictionaries are merged by an attribute, you can use the ``lists_mergeby`` filter.
|
|
||||||
|
|
||||||
.. note:: The output of the examples in this section use the YAML callback plugin. Quoting: "Ansible output that can be quite a bit easier to read than the default JSON formatting." See :ref:`the documentation for the community.general.yaml callback plugin <ansible_collections.community.general.yaml_callback>`.
|
|
||||||
|
|
||||||
Let us use the lists below in the following examples:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
{{ lookup('file', 'default-common.yml')|indent(2) }}
|
|
||||||
|
|
||||||
{% for i in examples[0:2] %}
|
|
||||||
{{ i.label }}
|
|
||||||
|
|
||||||
.. code-block:: {{ i.lang }}
|
|
||||||
|
|
||||||
{{ lookup('file', i.file)|indent(2) }}
|
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
.. versionadded:: 2.0.0
|
|
||||||
|
|
||||||
{% for i in examples[2:4] %}
|
|
||||||
{{ i.label }}
|
|
||||||
|
|
||||||
.. code-block:: {{ i.lang }}
|
|
||||||
|
|
||||||
{{ lookup('file', i.file)|indent(2) }}
|
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
The filter also accepts two optional parameters: ``recursive`` and ``list_merge``. These parameters are only supported when used with ansible-base 2.10 or ansible-core, but not with Ansible 2.9. This is available since community.general 4.4.0.
|
|
||||||
|
|
||||||
**recursive**
|
|
||||||
Is a boolean, default to ``False``. Should the ``community.general.lists_mergeby`` recursively merge nested hashes. Note: It does not depend on the value of the ``hash_behaviour`` setting in ``ansible.cfg``.
|
|
||||||
|
|
||||||
**list_merge**
|
|
||||||
Is a string, its possible values are ``replace`` (default), ``keep``, ``append``, ``prepend``, ``append_rp`` or ``prepend_rp``. It modifies the behaviour of ``community.general.lists_mergeby`` when the hashes to merge contain arrays/lists.
|
|
||||||
|
|
||||||
The examples below set ``recursive=true`` and display the differences among all six options of ``list_merge``. Functionality of the parameters is exactly the same as in the filter ``combine``. See :ref:`Combining hashes/dictionaries <combine_filter>` to learn details about these options.
|
|
||||||
|
|
||||||
Let us use the lists below in the following examples
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
{{ lookup('file', 'default-recursive-true.yml')|indent(2) }}
|
|
||||||
|
|
||||||
{% for i in examples[4:16] %}
|
|
||||||
{{ i.label }}
|
|
||||||
|
|
||||||
.. code-block:: {{ i.lang }}
|
|
||||||
|
|
||||||
{{ lookup('file', i.file)|indent(2) }}
|
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
@@ -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
|
|
||||||
#}
|
|
||||||
list3:
|
|
||||||
{{ list3|to_nice_yaml(indent=0) }}
|
|
||||||
@@ -1,62 +1,41 @@
|
|||||||
---
|
---
|
||||||
# Copyright (c) Ansible Project
|
# The following runs all examples:
|
||||||
# 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
|
|
||||||
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
# 1) Run all examples and create example-XXX.out
|
|
||||||
# shell> ansible-playbook playbook.yml -e examples=true
|
|
||||||
#
|
#
|
||||||
# 2) Optionally, for testing, create examples_all.rst
|
# ANSIBLE_STDOUT_CALLBACK=community.general.yaml ansible-playbook playbook.yml -e examples=true
|
||||||
# shell> ansible-playbook playbook.yml -e examples_all=true
|
|
||||||
#
|
#
|
||||||
# 3) Create docs REST files
|
# You need to copy the YAML output of example-XXX.yml into example-XXX.out.
|
||||||
# shell> ansible-playbook playbook.yml -e merging_lists_of_dictionaries=true
|
|
||||||
#
|
#
|
||||||
# Notes:
|
# The following generates examples.rst out of the .out files:
|
||||||
# * Use YAML callback, e.g. set ANSIBLE_STDOUT_CALLBACK=community.general.yaml
|
|
||||||
# * Use sphinx-view to render and review the REST files
|
|
||||||
# shell> sphinx-view <path_to_helper>/examples_all.rst
|
|
||||||
# * Proofread and copy completed docs *.rst files into the directory rst.
|
|
||||||
# * Then delete the *.rst and *.out files from this directory. Do not
|
|
||||||
# add *.rst and *.out in this directory to the version control.
|
|
||||||
#
|
#
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# ansible-playbook playbook.yml -e template=true
|
||||||
# community.general/docs/docsite/helper/lists_mergeby/playbook.yml
|
|
||||||
|
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
|
vars:
|
||||||
|
source_path: ../../rst/examples/lists_mergeby/
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- import_tasks: example-001.yml
|
- import_tasks: '{{ source_path }}example-001.yml'
|
||||||
tags: t001
|
tags: t001
|
||||||
- import_tasks: example-002.yml
|
- import_tasks: '{{ source_path }}example-002.yml'
|
||||||
tags: t002
|
tags: t002
|
||||||
- import_tasks: example-003.yml
|
- import_tasks: '{{ source_path }}example-003.yml'
|
||||||
tags: t003
|
tags: t003
|
||||||
- import_tasks: example-004.yml
|
- import_tasks: '{{ source_path }}example-004.yml'
|
||||||
tags: t004
|
tags: t004
|
||||||
- import_tasks: example-005.yml
|
- import_tasks: '{{ source_path }}example-005.yml'
|
||||||
tags: t005
|
tags: t005
|
||||||
- import_tasks: example-006.yml
|
- import_tasks: '{{ source_path }}example-006.yml'
|
||||||
tags: t006
|
tags: t006
|
||||||
- import_tasks: example-007.yml
|
- import_tasks: '{{ source_path }}example-007.yml'
|
||||||
tags: t007
|
tags: t007
|
||||||
- import_tasks: example-008.yml
|
- import_tasks: '{{ source_path }}example-008.yml'
|
||||||
tags: t008
|
tags: t008
|
||||||
when: examples|d(false)|bool
|
when: examples|d(false)|bool
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- include_vars: examples.yml
|
- include_vars: examples.yml
|
||||||
- template:
|
- template:
|
||||||
src: examples_all.rst.j2
|
src: examples.rst.j2
|
||||||
dest: examples_all.rst
|
dest: examples.rst
|
||||||
when: examples_all|d(false)|bool
|
when: template|d(false)|bool
|
||||||
|
|
||||||
- block:
|
|
||||||
- include_vars: examples.yml
|
|
||||||
- template:
|
|
||||||
src: filter_guide_abstract_informations_merging_lists_of_dictionaries.rst.j2
|
|
||||||
dest: filter_guide_abstract_informations_merging_lists_of_dictionaries.rst
|
|
||||||
when: merging_lists_of_dictionaries|d(false)|bool
|
|
||||||
|
|||||||
@@ -1,27 +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
|
|
||||||
|
|
||||||
edit_on_github:
|
|
||||||
repository: ansible-collections/community.general
|
|
||||||
branch: main
|
|
||||||
path_prefix: ''
|
|
||||||
|
|
||||||
extra_links:
|
|
||||||
- description: Submit a bug report
|
|
||||||
url: https://github.com/ansible-collections/community.general/issues/new?assignees=&labels=&template=bug_report.yml
|
|
||||||
- description: Request a feature
|
|
||||||
url: https://github.com/ansible-collections/community.general/issues/new?assignees=&labels=&template=feature_request.yml
|
|
||||||
|
|
||||||
communication:
|
|
||||||
matrix_rooms:
|
|
||||||
- topic: General usage and support questions
|
|
||||||
room: '#users:ansible.im'
|
|
||||||
irc_channels:
|
|
||||||
- topic: General usage and support questions
|
|
||||||
network: Libera
|
|
||||||
channel: '#ansible'
|
|
||||||
mailing_lists:
|
|
||||||
- topic: Ansible Project List
|
|
||||||
url: https://groups.google.com/g/ansible-project
|
|
||||||
10
docs/docsite/rst/examples/lists_mergeby/example-001.out
Normal file
10
docs/docsite/rst/examples/lists_mergeby/example-001.out
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
list3:
|
||||||
|
- extra: false
|
||||||
|
name: bar
|
||||||
|
- name: baz
|
||||||
|
path: /baz
|
||||||
|
- extra: true
|
||||||
|
name: foo
|
||||||
|
path: /foo
|
||||||
|
- extra: true
|
||||||
|
name: meh
|
||||||
20
docs/docsite/rst/examples/lists_mergeby/example-001.yml
Normal file
20
docs/docsite/rst/examples/lists_mergeby/example-001.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
- name: Merge two lists by common attribute 'name'
|
||||||
|
set_fact:
|
||||||
|
list3: "{{ list1|
|
||||||
|
community.general.lists_mergeby(list2, 'name') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: foo
|
||||||
|
extra: true
|
||||||
|
- name: bar
|
||||||
|
extra: false
|
||||||
|
- name: meh
|
||||||
|
extra: true
|
||||||
|
list2:
|
||||||
|
- name: foo
|
||||||
|
path: /foo
|
||||||
|
- name: baz
|
||||||
|
path: /baz
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
10
docs/docsite/rst/examples/lists_mergeby/example-002.out
Normal file
10
docs/docsite/rst/examples/lists_mergeby/example-002.out
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
list3:
|
||||||
|
- extra: false
|
||||||
|
name: bar
|
||||||
|
- name: baz
|
||||||
|
path: /baz
|
||||||
|
- extra: true
|
||||||
|
name: foo
|
||||||
|
path: /foo
|
||||||
|
- extra: true
|
||||||
|
name: meh
|
||||||
20
docs/docsite/rst/examples/lists_mergeby/example-002.yml
Normal file
20
docs/docsite/rst/examples/lists_mergeby/example-002.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
- name: Merge two lists by common attribute 'name'
|
||||||
|
set_fact:
|
||||||
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: foo
|
||||||
|
extra: true
|
||||||
|
- name: bar
|
||||||
|
extra: false
|
||||||
|
- name: meh
|
||||||
|
extra: true
|
||||||
|
list2:
|
||||||
|
- name: foo
|
||||||
|
path: /foo
|
||||||
|
- name: baz
|
||||||
|
path: /baz
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
14
docs/docsite/rst/examples/lists_mergeby/example-003.out
Normal file
14
docs/docsite/rst/examples/lists_mergeby/example-003.out
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
list3:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
x: default_value
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01:
|
||||||
|
- 3
|
||||||
|
- 4
|
||||||
|
- 4
|
||||||
|
- key: value
|
||||||
28
docs/docsite/rst/examples/lists_mergeby/example-003.yml
Normal file
28
docs/docsite/rst/examples/lists_mergeby/example-003.yml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
- name: Merge recursive by 'name', replace lists (default)
|
||||||
|
set_fact:
|
||||||
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name',
|
||||||
|
recursive=true) }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
x: default_value
|
||||||
|
y: default_value
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [1, 1, 2, 3]
|
||||||
|
|
||||||
|
list2:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [3, 4, 4, {key: value}]
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
14
docs/docsite/rst/examples/lists_mergeby/example-004.out
Normal file
14
docs/docsite/rst/examples/lists_mergeby/example-004.out
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
list3:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
x: default_value
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01:
|
||||||
|
- 1
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
- 3
|
||||||
29
docs/docsite/rst/examples/lists_mergeby/example-004.yml
Normal file
29
docs/docsite/rst/examples/lists_mergeby/example-004.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
- name: Merge recursive by 'name', keep lists
|
||||||
|
set_fact:
|
||||||
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name',
|
||||||
|
recursive=true,
|
||||||
|
list_merge='keep') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
x: default_value
|
||||||
|
y: default_value
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [1, 1, 2, 3]
|
||||||
|
|
||||||
|
list2:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [3, 4, 4, {key: value}]
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
19
docs/docsite/rst/examples/lists_mergeby/example-005.out
Normal file
19
docs/docsite/rst/examples/lists_mergeby/example-005.out
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
list3:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- patch_value
|
||||||
|
x: default_value
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01:
|
||||||
|
- 1
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
- 3
|
||||||
|
- 3
|
||||||
|
- 4
|
||||||
|
- 4
|
||||||
|
- key: value
|
||||||
29
docs/docsite/rst/examples/lists_mergeby/example-005.yml
Normal file
29
docs/docsite/rst/examples/lists_mergeby/example-005.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
- name: Merge recursive by 'name', append lists
|
||||||
|
set_fact:
|
||||||
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name',
|
||||||
|
recursive=true,
|
||||||
|
list_merge='append') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
x: default_value
|
||||||
|
y: default_value
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [1, 1, 2, 3]
|
||||||
|
|
||||||
|
list2:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [3, 4, 4, {key: value}]
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
19
docs/docsite/rst/examples/lists_mergeby/example-006.out
Normal file
19
docs/docsite/rst/examples/lists_mergeby/example-006.out
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
list3:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- default_value
|
||||||
|
x: default_value
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01:
|
||||||
|
- 3
|
||||||
|
- 4
|
||||||
|
- 4
|
||||||
|
- key: value
|
||||||
|
- 1
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
- 3
|
||||||
29
docs/docsite/rst/examples/lists_mergeby/example-006.yml
Normal file
29
docs/docsite/rst/examples/lists_mergeby/example-006.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
- name: Merge recursive by 'name', prepend lists
|
||||||
|
set_fact:
|
||||||
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name',
|
||||||
|
recursive=true,
|
||||||
|
list_merge='prepend') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
x: default_value
|
||||||
|
y: default_value
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [1, 1, 2, 3]
|
||||||
|
|
||||||
|
list2:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [3, 4, 4, {key: value}]
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
18
docs/docsite/rst/examples/lists_mergeby/example-007.out
Normal file
18
docs/docsite/rst/examples/lists_mergeby/example-007.out
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
list3:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- patch_value
|
||||||
|
x: default_value
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01:
|
||||||
|
- 1
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
- 3
|
||||||
|
- 4
|
||||||
|
- 4
|
||||||
|
- key: value
|
||||||
29
docs/docsite/rst/examples/lists_mergeby/example-007.yml
Normal file
29
docs/docsite/rst/examples/lists_mergeby/example-007.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
- name: Merge recursive by 'name', append lists 'remove present'
|
||||||
|
set_fact:
|
||||||
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name',
|
||||||
|
recursive=true,
|
||||||
|
list_merge='append_rp') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
x: default_value
|
||||||
|
y: default_value
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [1, 1, 2, 3]
|
||||||
|
|
||||||
|
list2:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [3, 4, 4, {key: value}]
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
18
docs/docsite/rst/examples/lists_mergeby/example-008.out
Normal file
18
docs/docsite/rst/examples/lists_mergeby/example-008.out
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
list3:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- default_value
|
||||||
|
x: default_value
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01:
|
||||||
|
- 3
|
||||||
|
- 4
|
||||||
|
- 4
|
||||||
|
- key: value
|
||||||
|
- 1
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
29
docs/docsite/rst/examples/lists_mergeby/example-008.yml
Normal file
29
docs/docsite/rst/examples/lists_mergeby/example-008.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
- name: Merge recursive by 'name', prepend lists 'remove present'
|
||||||
|
set_fact:
|
||||||
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name',
|
||||||
|
recursive=true,
|
||||||
|
list_merge='prepend_rp') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
x: default_value
|
||||||
|
y: default_value
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [1, 1, 2, 3]
|
||||||
|
|
||||||
|
list2:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [3, 4, 4, {key: value}]
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
@@ -1,7 +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
|
|
||||||
|
|
||||||
.. _ansible_collections.community.general.docsite.filter_guide:
|
.. _ansible_collections.community.general.docsite.filter_guide:
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +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
|
|
||||||
|
|
||||||
Abstract transformations
|
Abstract transformations
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,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
|
|
||||||
|
|
||||||
Counting elements in a sequence
|
Counting elements in a sequence
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
The :ansplugin:`community.general.counter filter plugin <community.general.counter#filter>` allows you to count (hashable) elements in a sequence. Elements are returned as dictionary keys and their counts are stored as dictionary values.
|
The ``community.general.counter`` filter plugin allows you to count (hashable) elements in a sequence. Elements are returned as dictionary keys and their counts are stored as dictionary values.
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,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
|
|
||||||
|
|
||||||
Dictionaries
|
Dictionaries
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
You can use the :ansplugin:`community.general.dict_kv filter <community.general.dict_kv#filter>` to create a single-entry dictionary with ``value | community.general.dict_kv(key)``:
|
You can use the ``dict_kv`` filter to create a single-entry dictionary with ``value | community.general.dict_kv(key)``:
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
@@ -58,7 +53,7 @@ This produces:
|
|||||||
|
|
||||||
.. versionadded:: 2.0.0
|
.. versionadded:: 2.0.0
|
||||||
|
|
||||||
If you need to convert a list of key-value pairs to a dictionary, you can use the ``dict`` function. Unfortunately, this function cannot be used with ``map``. For this, the :ansplugin:`community.general.dict filter <community.general.dict#filter>` can be used:
|
If you need to convert a list of key-value pairs to a dictionary, you can use the ``dict`` function. Unfortunately, this function cannot be used with ``map``. For this, the ``community.general.dict`` filter can be used:
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,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
|
|
||||||
|
|
||||||
Grouping
|
Grouping
|
||||||
^^^^^^^^
|
^^^^^^^^
|
||||||
|
|
||||||
If you have a list of dictionaries, the Jinja2 ``groupby`` filter allows to group the list by an attribute. This results in a list of ``(grouper, list)`` namedtuples, where ``list`` contains all dictionaries where the selected attribute equals ``grouper``. If you know that for every ``grouper``, there will be a most one entry in that list, you can use the :ansplugin:`community.general.groupby_as_dict filter <community.general.groupby_as_dict#filter>` to convert the original list into a dictionary which maps ``grouper`` to the corresponding dictionary.
|
If you have a list of dictionaries, the Jinja2 ``groupby`` filter allows to group the list by an attribute. This results in a list of ``(grouper, list)`` namedtuples, where ``list`` contains all dictionaries where the selected attribute equals ``grouper``. If you know that for every ``grouper``, there will be a most one entry in that list, you can use the ``community.general.groupby_as_dict`` filter to convert the original list into a dictionary which maps ``grouper`` to the corresponding dictionary.
|
||||||
|
|
||||||
One example is ``ansible_facts.mounts``, which is a list of dictionaries where each has one ``device`` element to indicate the device which is mounted. Therefore, ``ansible_facts.mounts | community.general.groupby_as_dict('device')`` is a dictionary mapping a device to the mount information:
|
One example is ``ansible_facts.mounts``, which is a list of dictionaries where each has one ``device`` element to indicate the device which is mounted. Therefore, ``ansible_facts.mounts | community.general.groupby_as_dict('device')`` is a dictionary mapping a device to the mount information:
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +1,34 @@
|
|||||||
..
|
|
||||||
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
|
|
||||||
|
|
||||||
Merging lists of dictionaries
|
Merging lists of dictionaries
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
If you have two or more lists of dictionaries and want to combine them into a list of merged dictionaries, where the dictionaries are merged by an attribute, you can use the :ansplugin:`community.general.lists_mergeby filter <community.general.lists_mergeby#filter>`.
|
If you have two or more lists of dictionaries and want to combine them into a list of merged dictionaries, where the dictionaries are merged by an attribute, you can use the ``lists_mergeby`` filter.
|
||||||
|
|
||||||
.. note:: The output of the examples in this section use the YAML callback plugin. Quoting: "Ansible output that can be quite a bit easier to read than the default JSON formatting." See :ref:`the documentation for the community.general.yaml callback plugin <ansible_collections.community.general.yaml_callback>`.
|
.. note:: The output of the examples in this section use the YAML callback plugin. Quoting: "Ansible output that can be quite a bit easier to read than the default JSON formatting." See :ref:`the documentation for the community.general.yaml callback plugin <ansible_collections.community.general.yaml_callback>`.
|
||||||
|
|
||||||
Let us use the lists below in the following examples:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
list1:
|
|
||||||
- name: foo
|
|
||||||
extra: true
|
|
||||||
- name: bar
|
|
||||||
extra: false
|
|
||||||
- name: meh
|
|
||||||
extra: true
|
|
||||||
|
|
||||||
list2:
|
|
||||||
- name: foo
|
|
||||||
path: /foo
|
|
||||||
- name: baz
|
|
||||||
path: /baz
|
|
||||||
|
|
||||||
In the example below the lists are merged by the attribute ``name``:
|
In the example below the lists are merged by the attribute ``name``:
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
list3: "{{ list1|
|
---
|
||||||
community.general.lists_mergeby(list2, 'name') }}"
|
- name: Merge two lists by common attribute 'name'
|
||||||
|
set_fact:
|
||||||
|
list3: "{{ list1|
|
||||||
|
community.general.lists_mergeby(list2, 'name') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: foo
|
||||||
|
extra: true
|
||||||
|
- name: bar
|
||||||
|
extra: false
|
||||||
|
- name: meh
|
||||||
|
extra: true
|
||||||
|
list2:
|
||||||
|
- name: foo
|
||||||
|
path: /foo
|
||||||
|
- name: baz
|
||||||
|
path: /baz
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
|
|
||||||
This produces:
|
This produces:
|
||||||
|
|
||||||
@@ -50,15 +45,32 @@ This produces:
|
|||||||
- extra: true
|
- extra: true
|
||||||
name: meh
|
name: meh
|
||||||
|
|
||||||
|
|
||||||
.. versionadded:: 2.0.0
|
.. versionadded:: 2.0.0
|
||||||
|
|
||||||
It is possible to use a list of lists as an input of the filter:
|
It is possible to use a list of lists as an input of the filter:
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
---
|
||||||
community.general.lists_mergeby('name') }}"
|
- name: Merge two lists by common attribute 'name'
|
||||||
|
set_fact:
|
||||||
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: foo
|
||||||
|
extra: true
|
||||||
|
- name: bar
|
||||||
|
extra: false
|
||||||
|
- name: meh
|
||||||
|
extra: true
|
||||||
|
list2:
|
||||||
|
- name: foo
|
||||||
|
path: /foo
|
||||||
|
- name: baz
|
||||||
|
path: /baz
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
|
|
||||||
This produces the same result as in the previous example:
|
This produces the same result as in the previous example:
|
||||||
|
|
||||||
@@ -75,223 +87,347 @@ This produces the same result as in the previous example:
|
|||||||
- extra: true
|
- extra: true
|
||||||
name: meh
|
name: meh
|
||||||
|
|
||||||
|
The filter also accepts two optional parameters: ``recursive`` and ``list_merge``. These parameters are only supported when used with ansible-base 2.10 or ansible-core, but not with Ansible 2.9. This is available since community.general 4.4.0.
|
||||||
The filter also accepts two optional parameters: :ansopt:`community.general.lists_mergeby#filter:recursive` and :ansopt:`community.general.lists_mergeby#filter:list_merge`. This is available since community.general 4.4.0.
|
|
||||||
|
|
||||||
**recursive**
|
**recursive**
|
||||||
Is a boolean, default to ``false``. Should the :ansplugin:`community.general.lists_mergeby#filter` filter recursively merge nested hashes. Note: It does not depend on the value of the ``hash_behaviour`` setting in ``ansible.cfg``.
|
Is a boolean, default to ``False``. Should the ``community.general.lists_mergeby`` recursively merge nested hashes. Note: It does not depend on the value of the ``hash_behaviour`` setting in ``ansible.cfg``.
|
||||||
|
|
||||||
**list_merge**
|
**list_merge**
|
||||||
Is a string, its possible values are :ansval:`replace` (default), :ansval:`keep`, :ansval:`append`, :ansval:`prepend`, :ansval:`append_rp` or :ansval:`prepend_rp`. It modifies the behaviour of :ansplugin:`community.general.lists_mergeby#filter` when the hashes to merge contain arrays/lists.
|
Is a string, its possible values are ``replace`` (default), ``keep``, ``append``, ``prepend``, ``append_rp`` or ``prepend_rp``. It modifies the behaviour of ``community.general.lists_mergeby`` when the hashes to merge contain arrays/lists.
|
||||||
|
|
||||||
The examples below set :ansopt:`community.general.lists_mergeby#filter:recursive=true` and display the differences among all six options of :ansopt:`community.general.lists_mergeby#filter:list_merge`. Functionality of the parameters is exactly the same as in the filter :ansplugin:`ansible.builtin.combine#filter`. See :ref:`Combining hashes/dictionaries <combine_filter>` to learn details about these options.
|
The examples below set ``recursive=true`` and display the differences among all six options of ``list_merge``. Functionality of the parameters is exactly the same as in the filter ``combine``. See :ref:`Combining hashes/dictionaries <combine_filter>` to learn details about these options.
|
||||||
|
|
||||||
Let us use the lists below in the following examples
|
Example ``list_merge=replace`` (default):
|
||||||
|
|
||||||
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
|
---
|
||||||
|
- name: Merge recursive by 'name', replace lists (default)
|
||||||
|
set_fact:
|
||||||
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name',
|
||||||
|
recursive=true) }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
x: default_value
|
||||||
|
y: default_value
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [1, 1, 2, 3]
|
||||||
|
|
||||||
|
list2:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [3, 4, 4, {key: value}]
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
|
|
||||||
|
This produces:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
list1:
|
list3:
|
||||||
- name: myname01
|
- name: myname01
|
||||||
param01:
|
param01:
|
||||||
x: default_value
|
|
||||||
y: default_value
|
|
||||||
list:
|
list:
|
||||||
- default_value
|
- patch_value
|
||||||
- name: myname02
|
x: default_value
|
||||||
param01: [1, 1, 2, 3]
|
|
||||||
|
|
||||||
list2:
|
|
||||||
- name: myname01
|
|
||||||
param01:
|
|
||||||
y: patch_value
|
y: patch_value
|
||||||
z: patch_value
|
z: patch_value
|
||||||
list:
|
|
||||||
- patch_value
|
|
||||||
- name: myname02
|
- name: myname02
|
||||||
param01: [3, 4, 4, {key: value}]
|
param01:
|
||||||
|
- 3
|
||||||
|
- 4
|
||||||
|
- 4
|
||||||
|
- key: value
|
||||||
|
|
||||||
Example :ansopt:`community.general.lists_mergeby#filter:list_merge=replace` (default):
|
Example ``list_merge=keep``:
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
---
|
||||||
community.general.lists_mergeby('name',
|
- name: Merge recursive by 'name', keep lists
|
||||||
recursive=true) }}"
|
set_fact:
|
||||||
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name',
|
||||||
|
recursive=true,
|
||||||
|
list_merge='keep') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
x: default_value
|
||||||
|
y: default_value
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [1, 1, 2, 3]
|
||||||
|
|
||||||
|
list2:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [3, 4, 4, {key: value}]
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
|
|
||||||
This produces:
|
This produces:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
list3:
|
list3:
|
||||||
- name: myname01
|
- name: myname01
|
||||||
param01:
|
param01:
|
||||||
list:
|
list:
|
||||||
- patch_value
|
- default_value
|
||||||
x: default_value
|
x: default_value
|
||||||
y: patch_value
|
y: patch_value
|
||||||
z: patch_value
|
z: patch_value
|
||||||
- name: myname02
|
- name: myname02
|
||||||
param01:
|
param01:
|
||||||
- 3
|
- 1
|
||||||
- 4
|
- 1
|
||||||
- 4
|
- 2
|
||||||
- key: value
|
- 3
|
||||||
|
|
||||||
Example :ansopt:`community.general.lists_mergeby#filter:list_merge=keep`:
|
Example ``list_merge=append``:
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
---
|
||||||
community.general.lists_mergeby('name',
|
- name: Merge recursive by 'name', append lists
|
||||||
recursive=true,
|
set_fact:
|
||||||
list_merge='keep') }}"
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name',
|
||||||
|
recursive=true,
|
||||||
|
list_merge='append') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
x: default_value
|
||||||
|
y: default_value
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [1, 1, 2, 3]
|
||||||
|
|
||||||
|
list2:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [3, 4, 4, {key: value}]
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
|
|
||||||
This produces:
|
This produces:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
list3:
|
list3:
|
||||||
- name: myname01
|
- name: myname01
|
||||||
param01:
|
param01:
|
||||||
list:
|
list:
|
||||||
- default_value
|
- default_value
|
||||||
x: default_value
|
- patch_value
|
||||||
y: patch_value
|
x: default_value
|
||||||
z: patch_value
|
y: patch_value
|
||||||
- name: myname02
|
z: patch_value
|
||||||
param01:
|
- name: myname02
|
||||||
- 1
|
param01:
|
||||||
- 1
|
- 1
|
||||||
- 2
|
- 1
|
||||||
- 3
|
- 2
|
||||||
|
- 3
|
||||||
|
- 3
|
||||||
|
- 4
|
||||||
|
- 4
|
||||||
|
- key: value
|
||||||
|
|
||||||
Example :ansopt:`community.general.lists_mergeby#filter:list_merge=append`:
|
Example ``list_merge=prepend``:
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
---
|
||||||
community.general.lists_mergeby('name',
|
- name: Merge recursive by 'name', prepend lists
|
||||||
recursive=true,
|
set_fact:
|
||||||
list_merge='append') }}"
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name',
|
||||||
|
recursive=true,
|
||||||
|
list_merge='prepend') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
x: default_value
|
||||||
|
y: default_value
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [1, 1, 2, 3]
|
||||||
|
|
||||||
|
list2:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [3, 4, 4, {key: value}]
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
|
|
||||||
This produces:
|
This produces:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
list3:
|
list3:
|
||||||
- name: myname01
|
- name: myname01
|
||||||
param01:
|
param01:
|
||||||
list:
|
list:
|
||||||
- default_value
|
- patch_value
|
||||||
- patch_value
|
- default_value
|
||||||
x: default_value
|
x: default_value
|
||||||
y: patch_value
|
y: patch_value
|
||||||
z: patch_value
|
z: patch_value
|
||||||
- name: myname02
|
- name: myname02
|
||||||
param01:
|
param01:
|
||||||
- 1
|
- 3
|
||||||
- 1
|
- 4
|
||||||
- 2
|
- 4
|
||||||
- 3
|
- key: value
|
||||||
- 3
|
- 1
|
||||||
- 4
|
- 1
|
||||||
- 4
|
- 2
|
||||||
- key: value
|
- 3
|
||||||
|
|
||||||
Example :ansopt:`community.general.lists_mergeby#filter:list_merge=prepend`:
|
Example ``list_merge=append_rp``:
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
---
|
||||||
community.general.lists_mergeby('name',
|
- name: Merge recursive by 'name', append lists 'remove present'
|
||||||
recursive=true,
|
set_fact:
|
||||||
list_merge='prepend') }}"
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name',
|
||||||
|
recursive=true,
|
||||||
|
list_merge='append_rp') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
x: default_value
|
||||||
|
y: default_value
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [1, 1, 2, 3]
|
||||||
|
|
||||||
|
list2:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [3, 4, 4, {key: value}]
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
|
|
||||||
This produces:
|
This produces:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
list3:
|
list3:
|
||||||
- name: myname01
|
- name: myname01
|
||||||
param01:
|
param01:
|
||||||
list:
|
list:
|
||||||
- patch_value
|
- default_value
|
||||||
- default_value
|
- patch_value
|
||||||
x: default_value
|
x: default_value
|
||||||
y: patch_value
|
y: patch_value
|
||||||
z: patch_value
|
z: patch_value
|
||||||
- name: myname02
|
- name: myname02
|
||||||
param01:
|
param01:
|
||||||
- 3
|
- 1
|
||||||
- 4
|
- 1
|
||||||
- 4
|
- 2
|
||||||
- key: value
|
- 3
|
||||||
- 1
|
- 4
|
||||||
- 1
|
- 4
|
||||||
- 2
|
- key: value
|
||||||
- 3
|
|
||||||
|
|
||||||
Example :ansopt:`community.general.lists_mergeby#filter:list_merge=append_rp`:
|
Example ``list_merge=prepend_rp``:
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
---
|
||||||
community.general.lists_mergeby('name',
|
- name: Merge recursive by 'name', prepend lists 'remove present'
|
||||||
recursive=true,
|
set_fact:
|
||||||
list_merge='append_rp') }}"
|
list3: "{{ [list1, list2]|
|
||||||
|
community.general.lists_mergeby('name',
|
||||||
|
recursive=true,
|
||||||
|
list_merge='prepend_rp') }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
x: default_value
|
||||||
|
y: default_value
|
||||||
|
list:
|
||||||
|
- default_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [1, 1, 2, 3]
|
||||||
|
|
||||||
|
list2:
|
||||||
|
- name: myname01
|
||||||
|
param01:
|
||||||
|
y: patch_value
|
||||||
|
z: patch_value
|
||||||
|
list:
|
||||||
|
- patch_value
|
||||||
|
- name: myname02
|
||||||
|
param01: [3, 4, 4, {key: value}]
|
||||||
|
- debug:
|
||||||
|
var: list3
|
||||||
|
|
||||||
This produces:
|
This produces:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
list3:
|
list3:
|
||||||
- name: myname01
|
- name: myname01
|
||||||
param01:
|
param01:
|
||||||
list:
|
list:
|
||||||
- default_value
|
- patch_value
|
||||||
- patch_value
|
- default_value
|
||||||
x: default_value
|
x: default_value
|
||||||
y: patch_value
|
y: patch_value
|
||||||
z: patch_value
|
z: patch_value
|
||||||
- name: myname02
|
- name: myname02
|
||||||
param01:
|
param01:
|
||||||
- 1
|
- 3
|
||||||
- 1
|
- 4
|
||||||
- 2
|
- 4
|
||||||
- 3
|
- key: value
|
||||||
- 4
|
- 1
|
||||||
- 4
|
- 1
|
||||||
- key: value
|
- 2
|
||||||
|
|
||||||
Example :ansopt:`community.general.lists_mergeby#filter:list_merge=prepend_rp`:
|
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
|
||||||
|
|
||||||
list3: "{{ [list1, list2]|
|
|
||||||
community.general.lists_mergeby('name',
|
|
||||||
recursive=true,
|
|
||||||
list_merge='prepend_rp') }}"
|
|
||||||
|
|
||||||
This produces:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
list3:
|
|
||||||
- name: myname01
|
|
||||||
param01:
|
|
||||||
list:
|
|
||||||
- patch_value
|
|
||||||
- default_value
|
|
||||||
x: default_value
|
|
||||||
y: patch_value
|
|
||||||
z: patch_value
|
|
||||||
- name: myname02
|
|
||||||
param01:
|
|
||||||
- 3
|
|
||||||
- 4
|
|
||||||
- 4
|
|
||||||
- key: value
|
|
||||||
- 1
|
|
||||||
- 1
|
|
||||||
- 2
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,10 @@
|
|||||||
..
|
|
||||||
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
|
|
||||||
|
|
||||||
Conversions
|
Conversions
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
Parsing CSV files
|
Parsing CSV files
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Ansible offers the :ansplugin:`community.general.read_csv module <community.general.read_csv#module>` to read CSV files. Sometimes you need to convert strings to CSV files instead. For this, the :ansplugin:`community.general.from_csv filter <community.general.from_csv#filter>` exists.
|
Ansible offers the :ref:`community.general.read_csv module <ansible_collections.community.general.read_csv_module>` to read CSV files. Sometimes you need to convert strings to CSV files instead. For this, the ``from_csv`` filter exists.
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
@@ -42,7 +37,7 @@ This produces:
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
The :ansplugin:`community.general.from_csv filter <community.general.from_csv#filter>` has several keyword arguments to control its behavior:
|
The ``from_csv`` filter has several keyword arguments to control its behavior:
|
||||||
|
|
||||||
:dialect: Dialect of the CSV file. Default is ``excel``. Other possible choices are ``excel-tab`` and ``unix``. If one of ``delimiter``, ``skipinitialspace`` or ``strict`` is specified, ``dialect`` is ignored.
|
:dialect: Dialect of the CSV file. Default is ``excel``. Other possible choices are ``excel-tab`` and ``unix``. If one of ``delimiter``, ``skipinitialspace`` or ``strict`` is specified, ``dialect`` is ignored.
|
||||||
:fieldnames: A set of column names to use. If not provided, the first line of the CSV is assumed to contain the column names.
|
:fieldnames: A set of column names to use. If not provided, the first line of the CSV is assumed to contain the column names.
|
||||||
@@ -55,7 +50,7 @@ The :ansplugin:`community.general.from_csv filter <community.general.from_csv#fi
|
|||||||
Converting to JSON
|
Converting to JSON
|
||||||
^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
`JC <https://pypi.org/project/jc/>`_ is a CLI tool and Python library which allows to interpret output of various CLI programs as JSON. It is also available as a filter in community.general, called :ansplugin:`community.general.jc#filter`. This filter needs the `jc Python library <https://pypi.org/project/jc/>`_ installed on the controller.
|
`JC <https://pypi.org/project/jc/>`_ is a CLI tool and Python library which allows to interpret output of various CLI programs as JSON. It is also available as a filter in community.general. This filter needs the `jc Python library <https://pypi.org/project/jc/>`_ installed on the controller.
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +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
|
|
||||||
|
|
||||||
Creating identifiers
|
Creating identifiers
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
@@ -11,7 +6,7 @@ The following filters allow to create identifiers.
|
|||||||
Hashids
|
Hashids
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
|
|
||||||
`Hashids <https://hashids.org/>`_ allow to convert sequences of integers to short unique string identifiers. The :ansplugin:`community.general.hashids_encode#filter` and :ansplugin:`community.general.hashids_decode#filter` filters need the `hashids Python library <https://pypi.org/project/hashids/>`_ installed on the controller.
|
`Hashids <https://hashids.org/>`_ allow to convert sequences of integers to short unique string identifiers. This filter needs the `hashids Python library <https://pypi.org/project/hashids/>`_ installed on the controller.
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
@@ -52,7 +47,7 @@ The hashids filters accept keyword arguments to allow fine-tuning the hashids ge
|
|||||||
Random MACs
|
Random MACs
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
|
|
||||||
You can use the :ansplugin:`community.general.random_mac filter <community.general.random_mac#filter>` to complete a partial `MAC address <https://en.wikipedia.org/wiki/MAC_address>`_ to a random 6-byte MAC address.
|
You can use the ``random_mac`` filter to complete a partial `MAC address <https://en.wikipedia.org/wiki/MAC_address>`_ to a random 6-byte MAC address.
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
..
|
|
||||||
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
|
|
||||||
|
|
||||||
Paths
|
Paths
|
||||||
-----
|
-----
|
||||||
|
|
||||||
The :ansplugin:`ansible.builtin.path_join filter <ansible.builtin.path_join#filter>` has been added in ansible-base 2.10. Community.general 3.0.0 and newer contains an alias ``community.general.path_join`` for this filter that could be used on Ansible 2.9 as well. Since community.general no longer supports Ansible 2.9, this is now a simple redirect to :ansplugin:`ansible.builtin.path_join filter <ansible.builtin.path_join#filter>`.
|
The ``path_join`` filter has been added in ansible-base 2.10. If you want to use this filter, but also need to support Ansible 2.9, you can use ``community.general``'s ``path_join`` shim, ``community.general.path_join``. This filter redirects to ``path_join`` for ansible-base 2.10 and ansible-core 2.11 or newer, and re-implements the filter for Ansible 2.9.
|
||||||
|
|
||||||
|
.. code-block:: yaml+jinja
|
||||||
|
|
||||||
|
# ansible-base 2.10 or newer:
|
||||||
|
path: {{ ('/etc', path, 'subdir', file) | path_join }}
|
||||||
|
|
||||||
|
# Also works with Ansible 2.9:
|
||||||
|
path: {{ ('/etc', path, 'subdir', file) | community.general.path_join }}
|
||||||
|
|
||||||
|
.. versionadded:: 3.0.0
|
||||||
|
|||||||
@@ -1,14 +1,9 @@
|
|||||||
..
|
|
||||||
Copyright (c) Ansible Project
|
|
||||||
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
.. _ansible_collections.community.general.docsite.json_query_filter:
|
.. _ansible_collections.community.general.docsite.json_query_filter:
|
||||||
|
|
||||||
Selecting JSON data: JSON queries
|
Selecting JSON data: JSON queries
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
To select a single element or a data subset from a complex data structure in JSON format (for example, Ansible facts), use the :ansplugin:`community.general.json_query filter <community.general.json_query#filter>`. The :ansplugin:`community.general.json_query#filter` filter lets you query a complex JSON structure and iterate over it using a loop structure.
|
To select a single element or a data subset from a complex data structure in JSON format (for example, Ansible facts), use the ``json_query`` filter. The ``json_query`` filter lets you query a complex JSON structure and iterate over it using a loop structure.
|
||||||
|
|
||||||
.. note:: You must manually install the **jmespath** dependency on the Ansible controller before using this filter. This filter is built upon **jmespath**, and you can use the same syntax. For examples, see `jmespath examples <http://jmespath.org/examples.html>`_.
|
.. note:: You must manually install the **jmespath** dependency on the Ansible controller before using this filter. This filter is built upon **jmespath**, and you can use the same syntax. For examples, see `jmespath examples <http://jmespath.org/examples.html>`_.
|
||||||
|
|
||||||
@@ -146,4 +141,4 @@ To extract ports from all clusters with name containing 'server1':
|
|||||||
vars:
|
vars:
|
||||||
server_name_query: "domain.server[?contains(name,'server1')].port"
|
server_name_query: "domain.server[?contains(name,'server1')].port"
|
||||||
|
|
||||||
.. note:: while using ``starts_with`` and ``contains``, you have to use ``to_json | from_json`` filter for correct parsing of data structure.
|
.. note:: while using ``starts_with`` and ``contains``, you have to use `` to_json | from_json `` filter for correct parsing of data structure.
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user