mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-13 21:12:02 +00:00
Compare commits
410 Commits
v1.10.0
...
validate_e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22700620c6 | ||
|
|
e8688d4cf5 | ||
|
|
d540be425a | ||
|
|
c1d7ed1df6 | ||
|
|
0fc8ddf450 | ||
|
|
012f0deb00 | ||
|
|
f27b0e3011 | ||
|
|
8b4b22dd00 | ||
|
|
91c4b83311 | ||
|
|
6925503a10 | ||
|
|
0da0b22ae7 | ||
|
|
f5f454915c | ||
|
|
8581b79eba | ||
|
|
a9602431ce | ||
|
|
9195494f37 | ||
|
|
81abf6889b | ||
|
|
81906edec6 | ||
|
|
5071653db3 | ||
|
|
df4ec30a51 | ||
|
|
73160a037b | ||
|
|
b7ed9ecfd5 | ||
|
|
a4f608854d | ||
|
|
8e6c5e566d | ||
|
|
431dc8667a | ||
|
|
bc16ccaef7 | ||
|
|
227c95e62e | ||
|
|
5abb515c92 | ||
|
|
1c4b50fa51 | ||
|
|
8fc2de1673 | ||
|
|
8d74fe34ef | ||
|
|
87ad46f7a4 | ||
|
|
4c3f4e6f7d | ||
|
|
489f4d5784 | ||
|
|
29fc03c625 | ||
|
|
651337541a | ||
|
|
e61b8db66c | ||
|
|
2dc1deeb87 | ||
|
|
82a53b9ae4 | ||
|
|
d580431832 | ||
|
|
6c94fe9bd5 | ||
|
|
4fa0621156 | ||
|
|
da775a21b2 | ||
|
|
5a774d2612 | ||
|
|
3e405fd08d | ||
|
|
cb3226910b | ||
|
|
a96611fb3f | ||
|
|
e92f09b920 | ||
|
|
97b0638f30 | ||
|
|
24569b850a | ||
|
|
08a2ba1592 | ||
|
|
3d5ff1f5fd | ||
|
|
2b28626012 | ||
|
|
7c7d98872e | ||
|
|
8956a7a1dd | ||
|
|
25577fa9bc | ||
|
|
f6bd62feb4 | ||
|
|
33c1c00643 | ||
|
|
0f530df092 | ||
|
|
a707d1887d | ||
|
|
e1786c9ddc | ||
|
|
367d30a30c | ||
|
|
77c34aeca2 | ||
|
|
5b33cb5e80 | ||
|
|
c979843b1a | ||
|
|
a8ce235261 | ||
|
|
bdcc8153f8 | ||
|
|
57bc35df80 | ||
|
|
a2f59e1a34 | ||
|
|
16636de681 | ||
|
|
55ec25a759 | ||
|
|
2b10256575 | ||
|
|
907650c746 | ||
|
|
b128a5cb9f | ||
|
|
220c4f0016 | ||
|
|
7f1df9d8f8 | ||
|
|
75d8ea283f | ||
|
|
91a3013513 | ||
|
|
85ef81c842 | ||
|
|
ad44f11887 | ||
|
|
80693c431a | ||
|
|
9ebc365d69 | ||
|
|
50ba326ed8 | ||
|
|
691e5915b9 | ||
|
|
178cf218b9 | ||
|
|
36f26bdf63 | ||
|
|
e2bdbeef6d | ||
|
|
88dc4c6923 | ||
|
|
e05fbce04c | ||
|
|
c2ff12b101 | ||
|
|
7dbe6edbf0 | ||
|
|
02ba890eb4 | ||
|
|
8515c9a48b | ||
|
|
94311f439c | ||
|
|
7aa9483b2c | ||
|
|
68bca84481 | ||
|
|
c9010d52ef | ||
|
|
0c6a7c8a14 | ||
|
|
0d246b1c11 | ||
|
|
785681f100 | ||
|
|
480c83f504 | ||
|
|
928ed30b8b | ||
|
|
fb6fed58cb | ||
|
|
b0e03a032d | ||
|
|
7ac0ec6bd4 | ||
|
|
8153239ef7 | ||
|
|
c2f6a19677 | ||
|
|
0002d4c7f7 | ||
|
|
a95c222ed6 | ||
|
|
d9a20e16c1 | ||
|
|
a4860f7b04 | ||
|
|
e71602be6e | ||
|
|
3dfa026eda | ||
|
|
16a4eb81ce | ||
|
|
cd16490531 | ||
|
|
7b6bc32fa0 | ||
|
|
6b3fb78db6 | ||
|
|
67df9e83c7 | ||
|
|
14be339af0 | ||
|
|
76251ead2c | ||
|
|
74028bd36c | ||
|
|
43217b9e70 | ||
|
|
96209f6945 | ||
|
|
7eac30127a | ||
|
|
719d1cd056 | ||
|
|
832d44d986 | ||
|
|
82f403c0de | ||
|
|
fa4a90e628 | ||
|
|
c38ff9b78c | ||
|
|
85b1c54ce1 | ||
|
|
6d5f3f3274 | ||
|
|
1dba4ba408 | ||
|
|
e867373fc0 | ||
|
|
c5c8cb3b04 | ||
|
|
8944999657 | ||
|
|
b7a04bc49b | ||
|
|
935bef4b9f | ||
|
|
8e139e2fe9 | ||
|
|
332d41dc46 | ||
|
|
ab94ff07a0 | ||
|
|
5a5b3c1655 | ||
|
|
74663b877a | ||
|
|
2f06f194f1 | ||
|
|
3148c10480 | ||
|
|
f4187a1453 | ||
|
|
7126dec0f3 | ||
|
|
3d241e55b4 | ||
|
|
173acf282b | ||
|
|
39ba225784 | ||
|
|
b7ccd8fed5 | ||
|
|
ef94b703df | ||
|
|
0dc58be3f6 | ||
|
|
b64da1dbb7 | ||
|
|
84b5d33c62 | ||
|
|
5ac7143f42 | ||
|
|
07d91e02d1 | ||
|
|
127d758100 | ||
|
|
4ff6e35c28 | ||
|
|
a1230cabc6 | ||
|
|
411f5f3467 | ||
|
|
8779384614 | ||
|
|
2cc1484ad7 | ||
|
|
77c1d206d3 | ||
|
|
52241fe233 | ||
|
|
f53ca3ad39 | ||
|
|
60905ef5bf | ||
|
|
0d48da060d | ||
|
|
5cdbcf6442 | ||
|
|
08b0fc02ba | ||
|
|
6cec03eb15 | ||
|
|
65a1fd7804 | ||
|
|
bcb6a68230 | ||
|
|
8f8a16f815 | ||
|
|
bfcc62a27f | ||
|
|
8ba32bfc26 | ||
|
|
69306a6177 | ||
|
|
967a2d8e56 | ||
|
|
2626715db6 | ||
|
|
2166a9f7a2 | ||
|
|
8b4bb631a5 | ||
|
|
f17f83d6bd | ||
|
|
a3517a3a23 | ||
|
|
5aa1c7cb57 | ||
|
|
15e9201dab | ||
|
|
6caa58e8be | ||
|
|
5c61f14cc1 | ||
|
|
b3a74e616a | ||
|
|
cbff802d13 | ||
|
|
4ceb6aa05d | ||
|
|
35614d7a88 | ||
|
|
7a9ea832a1 | ||
|
|
2804ec3f83 | ||
|
|
bef748cfdc | ||
|
|
c24e8b498e | ||
|
|
fe16df8a6c | ||
|
|
d804dc470e | ||
|
|
8fa3daece8 | ||
|
|
0cad1fa879 | ||
|
|
780e6b1436 | ||
|
|
216a5d4f9d | ||
|
|
f8ff833b03 | ||
|
|
b92da82661 | ||
|
|
ce05b5e137 | ||
|
|
a826bf1781 | ||
|
|
a3a6919416 | ||
|
|
e9c6e93608 | ||
|
|
f40f4d4c9a | ||
|
|
7b7d9c9957 | ||
|
|
c0c3394d8d | ||
|
|
11205102af | ||
|
|
22401d18d6 | ||
|
|
9b5a54c4fa | ||
|
|
9920a76777 | ||
|
|
249eab6047 | ||
|
|
29f046b8e2 | ||
|
|
2317c20556 | ||
|
|
0d1f8b53b8 | ||
|
|
0a468d32e8 | ||
|
|
03c65bd761 | ||
|
|
b87b346a0a | ||
|
|
e92db5c5cd | ||
|
|
1028f61b6c | ||
|
|
1fde1764af | ||
|
|
4321478cf0 | ||
|
|
900c76e810 | ||
|
|
1ecdbd3a49 | ||
|
|
47a1d50c84 | ||
|
|
3fe41a5260 | ||
|
|
3a304e8bd7 | ||
|
|
86e089fd42 | ||
|
|
3eb86b2c2d | ||
|
|
3bd68ac0fa | ||
|
|
0f2c37612e | ||
|
|
4e831b0cb8 | ||
|
|
34973c04c6 | ||
|
|
bc694b722c | ||
|
|
92d579be41 | ||
|
|
e55a41ca0c | ||
|
|
0f7ebd22fd | ||
|
|
f4c9e28715 | ||
|
|
81e6cbe6b7 | ||
|
|
9ecbe2315e | ||
|
|
102d6c5a6d | ||
|
|
66bbc50c4d | ||
|
|
a38106afae | ||
|
|
47940b48c6 | ||
|
|
8114120814 | ||
|
|
505cb356c1 | ||
|
|
d2e0cad90b | ||
|
|
9c735939a2 | ||
|
|
22214dafff | ||
|
|
2c9ee7d842 | ||
|
|
de3c6c0ace | ||
|
|
ff084fbd96 | ||
|
|
ca5496918a | ||
|
|
48c0fd0a28 | ||
|
|
f2a1d50b82 | ||
|
|
1930d8c8be | ||
|
|
1837ee662c | ||
|
|
26e171df79 | ||
|
|
01440e3c04 | ||
|
|
2426e04c22 | ||
|
|
92e44f6a6c | ||
|
|
16c8ee87e9 | ||
|
|
3109e9d1bc | ||
|
|
b457de545d | ||
|
|
b22bf4dfb9 | ||
|
|
f1a6f44477 | ||
|
|
1dbe19cefb | ||
|
|
7982fad342 | ||
|
|
212719496c | ||
|
|
3de6f9146e | ||
|
|
48f2ef88a4 | ||
|
|
6845acd596 | ||
|
|
f012da22ce | ||
|
|
ba7bf0f6cd | ||
|
|
fe2d17e4df | ||
|
|
319a0d3d86 | ||
|
|
c71a2b33dd | ||
|
|
02223dfb67 | ||
|
|
5731a1539b | ||
|
|
ee7354230b | ||
|
|
4bb40f3397 | ||
|
|
55b8729c52 | ||
|
|
539ace413d | ||
|
|
0c20b34d28 | ||
|
|
f9ff41320f | ||
|
|
69c6b4d644 | ||
|
|
b63716b724 | ||
|
|
3cf138674b | ||
|
|
12e0d110f6 | ||
|
|
34654d1090 | ||
|
|
72d3ab8e04 | ||
|
|
fb75aed663 | ||
|
|
6f5bb9eebf | ||
|
|
e5b2c122ce | ||
|
|
c0692e1746 | ||
|
|
2d079c8eec | ||
|
|
b70a1ecf61 | ||
|
|
7cb5e481e5 | ||
|
|
60593b7dd3 | ||
|
|
e84ed3b6ba | ||
|
|
6e1f9f1a72 | ||
|
|
46a307aaeb | ||
|
|
d8f8211a1c | ||
|
|
34daa992f5 | ||
|
|
07c1a5ee61 | ||
|
|
63d0272385 | ||
|
|
d0a8005a7f | ||
|
|
24efad73fa | ||
|
|
fd1352ad7e | ||
|
|
de38e8f0bc | ||
|
|
847ae2a374 | ||
|
|
bcee9aba92 | ||
|
|
c34c66fa79 | ||
|
|
0a3cd06c6e | ||
|
|
b5b22c3f7e | ||
|
|
7ee385ee02 | ||
|
|
7d9e4da9df | ||
|
|
0a20b5902d | ||
|
|
be9a2db404 | ||
|
|
ba4a360520 | ||
|
|
3534fcdce7 | ||
|
|
f0f21fc8aa | ||
|
|
5ed96eda05 | ||
|
|
cf779e43bb | ||
|
|
1a48a0fb63 | ||
|
|
ed3a0d5a1b | ||
|
|
d58b492f1d | ||
|
|
88d4a36e17 | ||
|
|
6fa8223662 | ||
|
|
c9e8656494 | ||
|
|
a791c6a0ca | ||
|
|
9cbccdade9 | ||
|
|
42c07d6336 | ||
|
|
a728a8d43e | ||
|
|
bd3266e9f1 | ||
|
|
48063d2b3a | ||
|
|
5d08214516 | ||
|
|
ef0b7e80f0 | ||
|
|
a33fcf45f8 | ||
|
|
c4b273c896 | ||
|
|
62d34d0a22 | ||
|
|
3ed0c229c4 | ||
|
|
c089c010e6 | ||
|
|
cfbdd83a64 | ||
|
|
fef1bdcf8e | ||
|
|
411d363d91 | ||
|
|
1555132d85 | ||
|
|
57ad57dda3 | ||
|
|
dab64c7cf6 | ||
|
|
b7145bc2cc | ||
|
|
c9f1da5d6b | ||
|
|
f4070f6a30 | ||
|
|
ad9a03ece6 | ||
|
|
1bfe6888a4 | ||
|
|
51ddaa6491 | ||
|
|
f56861cc15 | ||
|
|
c4de680497 | ||
|
|
7b2701b985 | ||
|
|
694c717829 | ||
|
|
083396e133 | ||
|
|
9a8a1db38f | ||
|
|
8f9c344bc1 | ||
|
|
067b683b81 | ||
|
|
51f64e4393 | ||
|
|
45700bc02b | ||
|
|
d04a12e522 | ||
|
|
4e9ec11b23 | ||
|
|
2d93051101 | ||
|
|
1a7b279d78 | ||
|
|
be228d1df3 | ||
|
|
ce95c638be | ||
|
|
876f39a6c5 | ||
|
|
950840e050 | ||
|
|
87e1edf575 | ||
|
|
09250cb2c5 | ||
|
|
872c9e4cb2 | ||
|
|
efe9c68600 | ||
|
|
0d9873b81c | ||
|
|
5b91703bd7 | ||
|
|
180afd7586 | ||
|
|
7f16914032 | ||
|
|
306522acd8 | ||
|
|
a155324188 | ||
|
|
8ec5b1fe21 | ||
|
|
316255d524 | ||
|
|
36b7a18e40 | ||
|
|
a32fcb3765 | ||
|
|
2d4cad6c1b | ||
|
|
a4b8e10a40 | ||
|
|
98681bd4d2 | ||
|
|
2882e2426a | ||
|
|
f056775d95 | ||
|
|
ad5450cd6f | ||
|
|
e75d82131d | ||
|
|
99e468ad60 | ||
|
|
3cc111782c | ||
|
|
b429b4495e | ||
|
|
0f99ef2199 | ||
|
|
1c8f1c28e1 | ||
|
|
47d5211185 | ||
|
|
4a18ad03c8 | ||
|
|
966797dbee | ||
|
|
892c0dd6f0 | ||
|
|
645a234d92 | ||
|
|
5cbc8b7ada | ||
|
|
5e5fbd87bf | ||
|
|
35ded3bf53 | ||
|
|
209c6365ea | ||
|
|
a69446021b |
@@ -7,7 +7,6 @@ exclude_paths:
|
|||||||
- .tox/
|
- .tox/
|
||||||
- .venv/
|
- .venv/
|
||||||
- .yamllint
|
- .yamllint
|
||||||
- molecule/
|
|
||||||
- tests/azure/
|
- tests/azure/
|
||||||
- meta/runtime.yml
|
- meta/runtime.yml
|
||||||
- requirements-docker.yml
|
- requirements-docker.yml
|
||||||
@@ -35,6 +34,7 @@ skip_list:
|
|||||||
- yaml # yamllint should be executed separately.
|
- yaml # yamllint should be executed separately.
|
||||||
- experimental # Do not run any experimental tests
|
- experimental # Do not run any experimental tests
|
||||||
- name[template] # Allow Jinja templating inside task names
|
- name[template] # Allow Jinja templating inside task names
|
||||||
|
- var-naming
|
||||||
|
|
||||||
use_default_rules: true
|
use_default_rules: true
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/ansible-test.yml
vendored
4
.github/workflows/ansible-test.yml
vendored
@@ -8,10 +8,8 @@ jobs:
|
|||||||
name: Verify ansible-test sanity
|
name: Verify ansible-test sanity
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Install virtualenv using pip
|
|
||||||
run: pip install virtualenv
|
|
||||||
- name: Run ansible-test
|
- name: Run ansible-test
|
||||||
run: bash tests/sanity/sanity.sh
|
run: bash tests/sanity/sanity.sh
|
||||||
|
|||||||
54
.github/workflows/docs.yml
vendored
54
.github/workflows/docs.yml
vendored
@@ -5,30 +5,13 @@ on:
|
|||||||
- pull_request
|
- pull_request
|
||||||
jobs:
|
jobs:
|
||||||
check_docs_oldest_supported:
|
check_docs_oldest_supported:
|
||||||
name: Check Ansible Documentation with ansible-core 2.12.
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3.1.0
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@v4.3.0
|
|
||||||
with:
|
|
||||||
python-version: '3.x'
|
|
||||||
- name: Install Ansible 2.12
|
|
||||||
run: |
|
|
||||||
python -m pip install "ansible-core >=2.12,<2.13"
|
|
||||||
- name: Run ansible-doc-test
|
|
||||||
run: |
|
|
||||||
ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins
|
|
||||||
|
|
||||||
check_docs_previous:
|
|
||||||
name: Check Ansible Documentation with ansible-core 2.13.
|
name: Check Ansible Documentation with ansible-core 2.13.
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 1
|
||||||
- uses: actions/setup-python@v4.3.0
|
- uses: actions/setup-python@v5.1.0
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
- name: Install Ansible 2.13
|
- name: Install Ansible 2.13
|
||||||
@@ -38,14 +21,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins
|
ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins
|
||||||
|
|
||||||
check_docs_current:
|
check_docs_previous:
|
||||||
name: Check Ansible Documentation with ansible-core 2.14.
|
name: Check Ansible Documentation with ansible-core 2.14.
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 1
|
||||||
- uses: actions/setup-python@v4.3.0
|
- uses: actions/setup-python@v5.1.0
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
- name: Install Ansible 2.14
|
- name: Install Ansible 2.14
|
||||||
@@ -55,14 +38,31 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins
|
ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins
|
||||||
|
|
||||||
|
check_docs_current:
|
||||||
|
name: Check Ansible Documentation with ansible-core 2.15.
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4.1.1
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
- uses: actions/setup-python@v5.1.0
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
- name: Install Ansible 2.15
|
||||||
|
run: |
|
||||||
|
python -m pip install "ansible-core >=2.15,<2.16"
|
||||||
|
- name: Run ansible-doc-test
|
||||||
|
run: |
|
||||||
|
ANSIBLE_LIBRARY="." ANSIBLE_DOC_FRAGMENT_PLUGINS="." python utils/ansible-doc-test -v roles plugins
|
||||||
|
|
||||||
check_docs_ansible_latest:
|
check_docs_ansible_latest:
|
||||||
name: Check Ansible Documentation with latest Ansible version.
|
name: Check Ansible Documentation with latest Ansible version.
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 1
|
||||||
- uses: actions/setup-python@v4.3.0
|
- uses: actions/setup-python@v5.1.0
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
- name: Install Ansible-latest
|
- name: Install Ansible-latest
|
||||||
|
|||||||
49
.github/workflows/lint.yml
vendored
49
.github/workflows/lint.yml
vendored
@@ -8,55 +8,40 @@ jobs:
|
|||||||
name: Verify ansible-lint
|
name: Verify ansible-lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@v4.3.0
|
- uses: actions/setup-python@v5.1.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.x"
|
python-version: "3.x"
|
||||||
- name: Run ansible-lint
|
- name: Run ansible-lint
|
||||||
run: |
|
run: |
|
||||||
pip install "ansible-core >=2.14,<2.15" ansible-lint
|
pip install "ansible-core>=2.16,<2.17" 'ansible-lint==6.22'
|
||||||
utils/build-galaxy-release.sh -ki
|
utils/build-galaxy-release.sh -ki
|
||||||
cd .galaxy-build
|
cd .galaxy-build
|
||||||
ansible-lint
|
ansible-lint --profile production --exclude tests/integration/ --exclude tests/unit/ --parseable --nocolor
|
||||||
|
|
||||||
yamllint:
|
yamllint:
|
||||||
name: Verify yamllint
|
name: Verify yamllint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 1
|
||||||
- uses: actions/setup-python@v4.3.0
|
- uses: actions/setup-python@v5.1.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.x"
|
python-version: "3.x"
|
||||||
- name: Run yaml-lint
|
- name: Run yaml-lint
|
||||||
uses: ibiqlik/action-yamllint@v3.1.1
|
uses: ibiqlik/action-yamllint@v3.1.1
|
||||||
|
|
||||||
pydocstyle:
|
|
||||||
name: Verify pydocstyle
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3.1.0
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@v4.3.0
|
|
||||||
with:
|
|
||||||
python-version: "3.x"
|
|
||||||
- name: Run pydocstyle
|
|
||||||
run: |
|
|
||||||
pip install pydocstyle
|
|
||||||
pydocstyle
|
|
||||||
|
|
||||||
flake8:
|
flake8:
|
||||||
name: Verify flake8
|
name: Verify flake8
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 1
|
||||||
- uses: actions/setup-python@v4.3.0
|
- uses: actions/setup-python@v5.1.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.x"
|
python-version: "3.x"
|
||||||
- name: Run flake8
|
- name: Run flake8
|
||||||
@@ -68,23 +53,25 @@ jobs:
|
|||||||
name: Verify pylint
|
name: Verify pylint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 1
|
||||||
- uses: actions/setup-python@v4.3.0
|
- uses: actions/setup-python@v5.1.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.x"
|
python-version: "3.x"
|
||||||
- name: Run pylint
|
- name: Run pylint
|
||||||
run: |
|
run: |
|
||||||
pip install pylint==2.14.4 wrapt==1.14.0
|
pip install 'pylint>=3.0'
|
||||||
pylint plugins roles --disable=import-error
|
pylint plugins roles --disable=import-error
|
||||||
|
|
||||||
shellcheck:
|
shellcheck:
|
||||||
name: Shellcheck
|
name: Shellcheck
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 1
|
||||||
- name: Run ShellCheck
|
- name: Run ShellCheck
|
||||||
uses: ludeeus/action-shellcheck@master
|
uses: ludeeus/action-shellcheck@master
|
||||||
|
env:
|
||||||
|
SHELLCHECK_OPTS: -x
|
||||||
|
|||||||
4
.github/workflows/readme.yml
vendored
4
.github/workflows/readme.yml
vendored
@@ -8,9 +8,9 @@ jobs:
|
|||||||
name: Verify readme
|
name: Verify readme
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 1
|
||||||
- name: Run readme test
|
- name: Run readme test
|
||||||
run: |
|
run: |
|
||||||
error=0
|
error=0
|
||||||
|
|||||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,8 +1,15 @@
|
|||||||
*.pyc
|
*.pyc
|
||||||
*.retry
|
*.retry
|
||||||
|
*.swp
|
||||||
|
|
||||||
|
# collection files
|
||||||
|
freeipa-ansible_freeipa*.tar.gz
|
||||||
|
redhat-rhel_idm*.tar.gz
|
||||||
|
importer_result.json
|
||||||
|
|
||||||
# ignore virtual environments
|
# ignore virtual environments
|
||||||
/.tox/
|
/.tox/
|
||||||
/.venv/
|
/.venv/
|
||||||
|
|
||||||
tests/logs/
|
tests/logs/
|
||||||
|
TEST*.xml
|
||||||
|
|||||||
@@ -1,30 +1,36 @@
|
|||||||
---
|
---
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/ansible/ansible-lint.git
|
- repo: https://github.com/ansible/ansible-lint.git
|
||||||
rev: v6.6.1
|
rev: v24.5.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: ansible-lint
|
- id: ansible-lint
|
||||||
always_run: false
|
always_run: false
|
||||||
pass_filenames: true
|
pass_filenames: true
|
||||||
files: \.(yaml|yml)$
|
files: \.(yaml|yml)$
|
||||||
exclude: /env[^/]*.(yaml|yml)$
|
exclude: /env[^/]*.(yaml|yml)$
|
||||||
entry: |
|
entry: |-
|
||||||
env ANSIBLE_LIBRARY=./plugins/modules ANSIBLE_MODULE_UTILS=./plugins/module_utils ANSIBLE_DOC_FRAGMENT_PLUGINS=./plugins/doc_fragments ansible-lint
|
env
|
||||||
|
ANSIBLE_LIBRARY=./plugins/modules
|
||||||
|
ANSIBLE_MODULE_UTILS=./plugins/module_utils
|
||||||
|
ANSIBLE_DOC_FRAGMENT_PLUGINS=./plugins/doc_fragments
|
||||||
|
ansible-lint
|
||||||
|
--offline
|
||||||
|
--profile production
|
||||||
|
--exclude tests/integration/
|
||||||
|
--exclude tests/unit/
|
||||||
|
--parseable
|
||||||
|
--nocolor
|
||||||
- repo: https://github.com/adrienverge/yamllint.git
|
- repo: https://github.com/adrienverge/yamllint.git
|
||||||
rev: v1.28.0
|
rev: v1.35.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: yamllint
|
- id: yamllint
|
||||||
files: \.(yaml|yml)$
|
files: \.(yaml|yml)$
|
||||||
- repo: https://github.com/pycqa/flake8
|
- repo: https://github.com/pycqa/flake8
|
||||||
rev: 5.0.3
|
rev: 7.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
- repo: https://github.com/pycqa/pydocstyle
|
|
||||||
rev: 6.0.0
|
|
||||||
hooks:
|
|
||||||
- id: pydocstyle
|
|
||||||
- repo: https://github.com/pycqa/pylint
|
- repo: https://github.com/pycqa/pylint
|
||||||
rev: v2.14.4
|
rev: v3.2.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: pylint
|
- id: pylint
|
||||||
args:
|
args:
|
||||||
@@ -44,4 +50,7 @@ repos:
|
|||||||
name: ShellCheck
|
name: ShellCheck
|
||||||
language: system
|
language: system
|
||||||
entry: shellcheck
|
entry: shellcheck
|
||||||
files: \.sh$
|
args: ['-x']
|
||||||
|
files: >
|
||||||
|
\.sh$
|
||||||
|
utils/sh*$
|
||||||
|
|||||||
@@ -20,4 +20,9 @@ rules:
|
|||||||
max: 160
|
max: 160
|
||||||
# Disabled rules
|
# Disabled rules
|
||||||
indentation: disable
|
indentation: disable
|
||||||
comments: disable
|
comments:
|
||||||
|
min-spaces-from-content: 1
|
||||||
|
comments-indentation: disable
|
||||||
|
octal-values:
|
||||||
|
forbid-implicit-octal: true
|
||||||
|
forbid-explicit-octal: true
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ FreeIPA versions 4.4.0 and up are supported by the ipaautomountkey module.
|
|||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ FreeIPA versions 4.4.0 and up are supported by the ipaautomountlocation module.
|
|||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ FreeIPA versions 4.4.0 and up are supported by the ipaautomountmap module.
|
|||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
@@ -54,6 +54,21 @@ Example playbook to ensure presence of an automount map:
|
|||||||
desc: "this is a map for servers in the DMZ"
|
desc: "this is a map for servers in the DMZ"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Automount maps can contain a submount key, which defines a mount location within the map the references another map. On FreeIPA, this is known as an indirect map. An indirect automount map is equivalent to adding a proper automount key to a map, referencyng another map (this second map is the indirect map). Use `parent` and `mount` parameters to create an indirect automount map with ansible-freeipa, without the need to directly manage the automount keys.
|
||||||
|
|
||||||
|
Example playbook to ensure an indirect automount map is present:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to add an indirect automount map
|
||||||
|
ipaautomountmap:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: auto.indirect
|
||||||
|
location: DMZ
|
||||||
|
parent: auto.DMZ
|
||||||
|
mount: dmz_indirect
|
||||||
|
```
|
||||||
|
|
||||||
Example playbook to ensure auto.DMZi is absent:
|
Example playbook to ensure auto.DMZi is absent:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -81,16 +96,14 @@ Variable | Description | Required
|
|||||||
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
||||||
`name` \| `mapname` \| `map` \| `automountmapname` | Name of the map to manage | yes
|
`name` \| `mapname` \| `map` \| `automountmapname` | Name of the map to manage | yes
|
||||||
`location` \| `automountlocation` \| `automountlocationcn` | Location name. | yes
|
`location` \| `automountlocation` \| `automountlocationcn` | Location name. | yes
|
||||||
|
`parentmap` | Parent map of the indirect map. Can only be used when creating new maps. Default: auto.master | no
|
||||||
|
`mount` | Indirect map mount point, relative to parent map. | yes, if `parent` is used.
|
||||||
`desc` \| `description` | Description of the map | yes
|
`desc` \| `description` | Description of the map | yes
|
||||||
`state` | The state to ensure. It can be one of `present`, or `absent`, default: `present`. | no
|
`state` | The state to ensure. It can be one of `present`, or `absent`, default: `present`. | no
|
||||||
|
|
||||||
|
|
||||||
Notes
|
|
||||||
=====
|
|
||||||
|
|
||||||
Creation of indirect mount points are not supported.
|
|
||||||
|
|
||||||
Authors
|
Authors
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Chris Procter
|
- Chris Procter
|
||||||
|
- Rafael Jeffman
|
||||||
|
|||||||
192
README-cert.md
Normal file
192
README-cert.md
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
Cert module
|
||||||
|
============
|
||||||
|
|
||||||
|
Description
|
||||||
|
-----------
|
||||||
|
|
||||||
|
The cert module makes it possible to request, revoke and retrieve SSL certificates for hosts, services and users.
|
||||||
|
|
||||||
|
Features
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Certificate request
|
||||||
|
* Certificate hold/release
|
||||||
|
* Certificate revocation
|
||||||
|
* Certificate retrieval
|
||||||
|
|
||||||
|
|
||||||
|
Supported FreeIPA Versions
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
FreeIPA versions 4.4.0 and up are supported by the ipacert module.
|
||||||
|
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
|
||||||
|
**Controller**
|
||||||
|
* Ansible version: 2.14+
|
||||||
|
* Some tool to generate a certificate signing request (CSR) might be needed, like `openssl`.
|
||||||
|
|
||||||
|
**Node**
|
||||||
|
* Supported FreeIPA version (see above)
|
||||||
|
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
Example inventory file
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[ipaserver]
|
||||||
|
ipaserver.test.local
|
||||||
|
```
|
||||||
|
|
||||||
|
Example playbook to request a new certificate for a service:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Certificate request
|
||||||
|
hosts: ipaserver
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Request a certificate for a web server
|
||||||
|
ipacert:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
state: requested
|
||||||
|
csr: |
|
||||||
|
-----BEGIN CERTIFICATE REQUEST-----
|
||||||
|
MIGYMEwCAQAwGTEXMBUGA1UEAwwOZnJlZWlwYSBydWxlcyEwKjAFBgMrZXADIQBs
|
||||||
|
HlqIr4b/XNK+K8QLJKIzfvuNK0buBhLz3LAzY7QDEqAAMAUGAytlcANBAF4oSCbA
|
||||||
|
5aIPukCidnZJdr491G4LBE+URecYXsPknwYb+V+ONnf5ycZHyaFv+jkUBFGFeDgU
|
||||||
|
SYaXm/gF8cDYjQI=
|
||||||
|
-----END CERTIFICATE REQUEST-----
|
||||||
|
principal: HTTP/www.example.com
|
||||||
|
register: cert
|
||||||
|
```
|
||||||
|
|
||||||
|
Example playbook to revoke an existing certificate:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Revoke certificate
|
||||||
|
hosts: ipaserver
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name Revoke a certificate
|
||||||
|
ipacert:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
serial_number: 123456789
|
||||||
|
reason: 5
|
||||||
|
state: revoked
|
||||||
|
```
|
||||||
|
|
||||||
|
When revoking a certificate a mnemonic can also be used to set the revocation reason:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Revoke certificate
|
||||||
|
hosts: ipaserver
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name Revoke a certificate
|
||||||
|
ipacert:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
serial_number: 123456789
|
||||||
|
reason: cessationOfOperation
|
||||||
|
state: revoked
|
||||||
|
```
|
||||||
|
|
||||||
|
Example to hold a certificate (alias for revoking a certificate with reason `certificateHold (6)`):
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Hold a certificate
|
||||||
|
hosts: ipaserver
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Hold certificate
|
||||||
|
ipacert:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
serial_number: 0xAB1234
|
||||||
|
state: held
|
||||||
|
```
|
||||||
|
|
||||||
|
Example playbook to release hold of certificate (may be used with any revoked certificates, despite of the rovoke reason):
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Release hold
|
||||||
|
hosts: ipaserver
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Take a revoked certificate off hold
|
||||||
|
ipacert:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
serial_number: 0xAB1234
|
||||||
|
state: released
|
||||||
|
```
|
||||||
|
|
||||||
|
Example playbook to retrieve a certificate and save it to a file in the target node:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Retriev certificate
|
||||||
|
hosts: ipaserver
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Retrieve a certificate and save it to file 'cert.pem'
|
||||||
|
ipacert:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
certificate_out: cert.pem
|
||||||
|
state: retrieved
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
ipacert
|
||||||
|
-------
|
||||||
|
|
||||||
|
Variable | Description | Required
|
||||||
|
-------- | ----------- | --------
|
||||||
|
`ipaadmin_principal` | The admin principal is a string and defaults to `admin` | no
|
||||||
|
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
||||||
|
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
||||||
|
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to yes. (bool) | no
|
||||||
|
`csr` | X509 certificate signing request, in PEM format. | yes, if `state: requested`
|
||||||
|
`principal` | Host/service/user principal for the certificate. | yes, if `state: requested`
|
||||||
|
`add` \| `add_principal` | Automatically add the principal if it doesn't exist (service principals only). (bool) | no
|
||||||
|
`profile_id` \| `profile` | Certificate Profile to use | no
|
||||||
|
`ca` | Name of the issuing certificate authority. | no
|
||||||
|
`chain` | Include certificate chain in output. (bool) | no
|
||||||
|
`serial_number` | Certificate serial number. (int) | yes, if `state` is `retrieved`, `held`, `released` or `revoked`.
|
||||||
|
`revocation_reason` \| `reason` | Reason for revoking the certificate. Use one of the reason strings, or the corresponding value: "unspecified" (0), "keyCompromise" (1), "cACompromise" (2), "affiliationChanged" (3), "superseded" (4), "cessationOfOperation" (5), "certificateHold" (6), "removeFromCRL" (8), "privilegeWithdrawn" (9), "aACompromise" (10) | yes, if `state: revoked`
|
||||||
|
`certificate_out` | Write certificate (chain if `chain` is set) to this file, on the target node. | no
|
||||||
|
`state` | The state to ensure. It can be one of `requested`, `held`, `released`, `revoked`, or `retrieved`. `held` is the same as revoke with reason "certificateHold" (6). `released` is the same as `cert-revoke-hold` on IPA CLI, releasing the hold status of a certificate. | yes
|
||||||
|
|
||||||
|
|
||||||
|
Return Values
|
||||||
|
=============
|
||||||
|
|
||||||
|
Values are returned only if `state` is `requested` or `retrieved` and if `certificate_out` is not defined.
|
||||||
|
|
||||||
|
Variable | Description | Returned When
|
||||||
|
-------- | ----------- | -------------
|
||||||
|
`certificate` | Certificate fields and data. (dict) <br>Options: | if `state` is `requested` or `retrieved` and if `certificate_out` is not defined
|
||||||
|
| `certificate` - Issued X509 certificate in PEM encoding. Will include certificate chain if `chain: true`. (list) | always
|
||||||
|
| `san_dnsname` - X509 Subject Alternative Name. | When DNSNames are present in the Subject Alternative Name extension of the issued certificate.
|
||||||
|
| `issuer` - X509 distinguished name of issuer. | always
|
||||||
|
| `subject` - X509 distinguished name of certificate subject. | always
|
||||||
|
| `serial_number` - Serial number of the issued certificate. (int) | always
|
||||||
|
| `revoked` - Revoked status of the certificate. (bool) | if certificate was revoked
|
||||||
|
| `owner_user` - The username that owns the certificate. | if `state: retrieved` and certificate is owned by a user
|
||||||
|
| `owner_host` - The host that owns the certificate. | if `state: retrieved` and certificate is owned by a host
|
||||||
|
| `owner_service` - The service that owns the certificate. | if `state: retrieved` and certificate is owned by a service
|
||||||
|
| `valid_not_before` - Time when issued certificate becomes valid, in GeneralizedTime format (YYYYMMDDHHMMSSZ) | always
|
||||||
|
| `valid_not_after` - Time when issued certificate ceases to be valid, in GeneralizedTime format (YYYYMMDDHHMMSSZ) | always
|
||||||
|
|
||||||
|
|
||||||
|
Authors
|
||||||
|
=======
|
||||||
|
|
||||||
|
Sam Morris
|
||||||
|
Rafael Jeffman
|
||||||
@@ -25,7 +25,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
@@ -145,7 +145,7 @@ Variable | Description | Required
|
|||||||
`selinuxusermaporder` \| `ipaselinuxusermaporder`| Set ordered list in increasing priority of SELinux users | no
|
`selinuxusermaporder` \| `ipaselinuxusermaporder`| Set ordered list in increasing priority of SELinux users | no
|
||||||
`selinuxusermapdefault`\| `ipaselinuxusermapdefault` | Set default SELinux user when no match is found in SELinux map rule | no
|
`selinuxusermapdefault`\| `ipaselinuxusermapdefault` | Set default SELinux user when no match is found in SELinux map rule | no
|
||||||
`pac_type` \| `ipakrbauthzdata` | set default types of PAC supported for services (choices: `MS-PAC`, `PAD`, `nfs:NONE`). Use `""` to clear this variable. | no
|
`pac_type` \| `ipakrbauthzdata` | set default types of PAC supported for services (choices: `MS-PAC`, `PAD`, `nfs:NONE`). Use `""` to clear this variable. | no
|
||||||
`user_auth_type` \| `ipauserauthtype` | set default types of supported user authentication (choices: `password`, `radius`, `otp`, `disabled`). Use `""` to clear this variable. | no
|
`user_auth_type` \| `ipauserauthtype` | set default types of supported user authentication (choices: `password`, `radius`, `otp`, `pkinit`, `hardened`, `idp`, `disabled`, `""`). An additional check ensures that only types can be used that are supported by the IPA version. Use `""` to clear this variable. | no
|
||||||
`domain_resolution_order` \| `ipadomainresolutionorder` | Set list of domains used for short name qualification | no
|
`domain_resolution_order` \| `ipadomainresolutionorder` | Set list of domains used for short name qualification | no
|
||||||
`ca_renewal_master_server` \| `ipacarenewalmasterserver`| Renewal master for IPA certificate authority. | no
|
`ca_renewal_master_server` \| `ipacarenewalmasterserver`| Renewal master for IPA certificate authority. | no
|
||||||
`enable_sid` | New users and groups automatically get a SID assigned. Cannot be deactivated once activated. Requires IPA 4.9.8+. (bool) | no
|
`enable_sid` | New users and groups automatically get a SID assigned. Cannot be deactivated once activated. Requires IPA 4.9.8+. (bool) | no
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ FreeIPA versions 4.4.0 and up are supported by the ipadnsforwardzone module.
|
|||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
@@ -133,6 +133,22 @@ Example playbook to enable a zone:
|
|||||||
state: enabled
|
state: enabled
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Example playbook to allow per-zone privilege delegation:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to enable per-zone privilege delegation
|
||||||
|
hosts: ipaserver
|
||||||
|
become: true
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Enable privilege delegation.
|
||||||
|
ipadnszone:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: testzone.local
|
||||||
|
permission: true
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Example playbook to remove a zone:
|
Example playbook to remove a zone:
|
||||||
```yaml
|
```yaml
|
||||||
@@ -223,6 +239,7 @@ Variable | Description | Required
|
|||||||
`ttl`| Time to live for records at zone apex | no
|
`ttl`| Time to live for records at zone apex | no
|
||||||
`default_ttl`| Time to live for records without explicit TTL definition | no
|
`default_ttl`| Time to live for records without explicit TTL definition | no
|
||||||
`nsec3param_rec`| NSEC3PARAM record for zone in format: hash_algorithm flags iterations salt | no
|
`nsec3param_rec`| NSEC3PARAM record for zone in format: hash_algorithm flags iterations salt | no
|
||||||
|
`permission` \| `managedby` | Set per-zone access delegation permission. | no
|
||||||
`skip_overlap_check`| Force DNS zone creation even if it will overlap with an existing zone | no
|
`skip_overlap_check`| Force DNS zone creation even if it will overlap with an existing zone | no
|
||||||
`skip_nameserver_check` | Force DNS zone creation even if nameserver is not resolvable | no
|
`skip_nameserver_check` | Force DNS zone creation even if nameserver is not resolvable | no
|
||||||
|
|
||||||
@@ -238,4 +255,6 @@ Variable | Description | Returned When
|
|||||||
Authors
|
Authors
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Sergio Oliveira Campos
|
- Sergio Oliveira Campos
|
||||||
|
- Thomas Woerner
|
||||||
|
- Rafael Jeffman
|
||||||
|
|||||||
@@ -8,8 +8,12 @@ The group module allows to ensure presence and absence of groups and members of
|
|||||||
|
|
||||||
The group module is as compatible as possible to the Ansible upstream `ipa_group` module, but additionally offers to add users to a group and also to remove users from a group.
|
The group module is as compatible as possible to the Ansible upstream `ipa_group` module, but additionally offers to add users to a group and also to remove users from a group.
|
||||||
|
|
||||||
## Note
|
|
||||||
Ensuring presence (adding) of several groups with mixed types (`external`, `nonposix` and `posix`) requires a fix in FreeIPA. The module implements a workaround to automatically use `client` context if the fix is not present in the target node FreeIPA and if more than one group is provided to the task using the `groups` parameter. If `ipaapi_context` is forced to be `server`, the module will fail in this case.
|
Notes
|
||||||
|
-----
|
||||||
|
|
||||||
|
* Ensuring presence (adding) of several groups with mixed types (`external`, `nonposix` and `posix`) requires a fix in FreeIPA. The module implements a workaround to automatically use `client` context if the fix is not present in the target node FreeIPA and if more than one group is provided to the task using the `groups` parameter. If `ipaapi_context` is forced to be `server`, the module will fail in this case.
|
||||||
|
* Using `externalmember` or `idoverrideuser` is only supported with `ipaapi_context: server`. With 'client' context, module execution will fail.
|
||||||
|
|
||||||
|
|
||||||
Features
|
Features
|
||||||
@@ -29,7 +33,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
@@ -130,6 +134,45 @@ And ensure the presence of the groups with this example playbook:
|
|||||||
groups: "{{ groups }}"
|
groups: "{{ groups }}"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Example playbook to rename a group:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to rename a single group
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
gather_facts: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Rename group appops to webops
|
||||||
|
ipagroup:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: appops
|
||||||
|
rename: webops
|
||||||
|
state: renamed
|
||||||
|
```
|
||||||
|
|
||||||
|
Several groups can also be renamed with a single task, as in the example playbook:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to rename multiple groups
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
gather_facts: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Rename group1 to newgroup1 and group2 to newgroup2
|
||||||
|
ipagroup:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
groups:
|
||||||
|
- name: group1
|
||||||
|
rename: newgroup1
|
||||||
|
- name: group2
|
||||||
|
rename: newgroup2
|
||||||
|
state: renamed
|
||||||
|
```
|
||||||
|
|
||||||
Example playbook to add users to a group:
|
Example playbook to add users to a group:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -174,7 +217,7 @@ Example playbook to add members from a trusted realm to an external group:
|
|||||||
---
|
---
|
||||||
- name: Playbook to handle groups.
|
- name: Playbook to handle groups.
|
||||||
hosts: ipaserver
|
hosts: ipaserver
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Create an external group and add members from a trust to it.
|
- name: Create an external group and add members from a trust to it.
|
||||||
ipagroup:
|
ipagroup:
|
||||||
@@ -237,6 +280,7 @@ Example playbook to ensure groups are absent:
|
|||||||
state: absent
|
state: absent
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Variables
|
Variables
|
||||||
=========
|
=========
|
||||||
|
|
||||||
@@ -260,13 +304,15 @@ Variable | Description | Required
|
|||||||
`service` | List of service name strings assigned to this group. Only usable with IPA versions 4.7 and up. | no
|
`service` | List of service name strings assigned to this group. Only usable with IPA versions 4.7 and up. | no
|
||||||
`membermanager_user` | List of member manager users assigned to this group. Only usable with IPA versions 4.8.4 and up. | no
|
`membermanager_user` | List of member manager users assigned to this group. Only usable with IPA versions 4.8.4 and up. | no
|
||||||
`membermanager_group` | List of member manager groups assigned to this group. Only usable with IPA versions 4.8.4 and up. | no
|
`membermanager_group` | List of member manager groups assigned to this group. Only usable with IPA versions 4.8.4 and up. | no
|
||||||
`externalmember` \| `ipaexternalmember` \| `external_member`| List of members of a trusted domain in DOM\\name or name@domain form. | no
|
`externalmember` \| `ipaexternalmember` \| `external_member`| List of members of a trusted domain in DOM\\name or name@domain form. Requires "server" context. | no
|
||||||
`idoverrideuser` | List of user ID overrides to manage. Only usable with IPA versions 4.8.7 and up.| no
|
`idoverrideuser` | List of user ID overrides to manage. Only usable with IPA versions 4.8.7 and up. Requires "server" context. | no
|
||||||
|
`rename` \| `new_name` | Rename the user object to the new name string. Only usable with `state: renamed`. | no
|
||||||
`action` | Work on group or member level. It can be on of `member` or `group` and defaults to `group`. | no
|
`action` | Work on group or member level. It can be on of `member` or `group` and defaults to `group`. | no
|
||||||
`state` | The state to ensure. It can be one of `present` or `absent`, default: `present`. | yes
|
`state` | The state to ensure. It can be one of `present`, `absent` or `renamed`, default: `present`. | yes
|
||||||
|
|
||||||
|
|
||||||
Authors
|
Authors
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Thomas Woerner
|
- Thomas Woerner
|
||||||
|
- Rafael Jeffman
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
@@ -44,7 +44,7 @@ Example playbook to make sure HBAC Rule login exists:
|
|||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
- name: Playbook to handle hbacrules
|
- name: Playbook to handle hbacrules
|
||||||
hbacsvcs: ipaserver
|
hosts: ipaserver
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -60,7 +60,7 @@ Example playbook to make sure HBAC Rule login exists with the only HBAC Service
|
|||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
- name: Playbook to handle hbacrules
|
- name: Playbook to handle hbacrules
|
||||||
hbacsvcs: ipaserver
|
hosts: ipaserver
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -77,7 +77,7 @@ Example playbook to make sure HBAC Service sshd is present in HBAC Rule login:
|
|||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
- name: Playbook to handle hbacrules
|
- name: Playbook to handle hbacrules
|
||||||
hbacsvcs: ipaserver
|
hosts: ipaserver
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -95,7 +95,7 @@ Example playbook to make sure HBAC Service sshd is absent in HBAC Rule login:
|
|||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
- name: Playbook to handle hbacrules
|
- name: Playbook to handle hbacrules
|
||||||
hbacsvcs: ipaserver
|
hosts: ipaserver
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -114,7 +114,7 @@ Example playbook to make sure HBAC Rule login is absent:
|
|||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
- name: Playbook to handle hbacrules
|
- name: Playbook to handle hbacrules
|
||||||
hbacsvcs: ipaserver
|
hosts: ipaserver
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
@@ -44,7 +44,7 @@ Example playbook to make sure HBAC Service Group login exists:
|
|||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
- name: Playbook to handle hbacsvcgroups
|
- name: Playbook to handle hbacsvcgroups
|
||||||
hbacsvcs: ipaserver
|
hosts: ipaserver
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -60,7 +60,7 @@ Example playbook to make sure HBAC Service Group login exists with the only HBAC
|
|||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
- name: Playbook to handle hbacsvcgroups
|
- name: Playbook to handle hbacsvcgroups
|
||||||
hbacsvcs: ipaserver
|
hosts: ipaserver
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -77,7 +77,7 @@ Example playbook to make sure HBAC Service sshd is present in HBAC Service Group
|
|||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
- name: Playbook to handle hbacsvcgroups
|
- name: Playbook to handle hbacsvcgroups
|
||||||
hbacsvcs: ipaserver
|
hosts: ipaserver
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -95,7 +95,7 @@ Example playbook to make sure HBAC Service sshd is absent in HBAC Service Group
|
|||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
- name: Playbook to handle hbacsvcgroups
|
- name: Playbook to handle hbacsvcgroups
|
||||||
hbacsvcs: ipaserver
|
hosts: ipaserver
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -114,7 +114,7 @@ Example playbook to make sure HBAC Service Group login is absent:
|
|||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
- name: Playbook to handle hbacsvcgroups
|
- name: Playbook to handle hbacsvcgroups
|
||||||
hbacsvcs: ipaserver
|
hosts: ipaserver
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
@@ -335,13 +335,13 @@ Variable | Description | Required
|
|||||||
-------- | ----------- | --------
|
-------- | ----------- | --------
|
||||||
`description` | The host description. | no
|
`description` | The host description. | no
|
||||||
`locality` | Host locality (e.g. "Baltimore, MD"). | no
|
`locality` | Host locality (e.g. "Baltimore, MD"). | no
|
||||||
`location` \| `ns_host_location` | Host location (e.g. "Lab 2"). | no
|
`location` \| `ns_host_location` | Host physical location hint (e.g. "Lab 2"). | no
|
||||||
`platform` \| `ns_hardware_platform` | Host hardware platform (e.g. "Lenovo T61"). | no
|
`platform` \| `ns_hardware_platform` | Host hardware platform (e.g. "Lenovo T61"). | no
|
||||||
`os` \| `ns_os_version` | Host operating system and version (e.g. "Fedora 9"). | no
|
`os` \| `ns_os_version` | Host operating system and version (e.g. "Fedora 9"). | no
|
||||||
`password` \| `user_password` \| `userpassword` | Password used in bulk enrollment for absent or not enrolled hosts. | no
|
`password` \| `user_password` \| `userpassword` | Password used in bulk enrollment for absent or not enrolled hosts. | no
|
||||||
`random` \| `random_password` | Initiate the generation of a random password to be used in bulk enrollment for absent or not enrolled hosts. | no
|
`random` \| `random_password` | Initiate the generation of a random password to be used in bulk enrollment for absent or not enrolled hosts. | no
|
||||||
`certificate` \| `usercertificate` | List of base-64 encoded host certificates | no
|
`certificate` \| `usercertificate` | List of base-64 encoded host certificates | no
|
||||||
`managedby` \| `principalname` \| `krbprincipalname` | List of hosts that can manage this host | no
|
`managedby_host` | List of hosts that can manage this host | no
|
||||||
`principal` \| `principalname` \| `krbprincipalname` | List of principal aliases for this host | no
|
`principal` \| `principalname` \| `krbprincipalname` | List of principal aliases for this host | no
|
||||||
`allow_create_keytab_user` \| `ipaallowedtoperform_write_keys_user` | Users allowed to create a keytab of this host. | no
|
`allow_create_keytab_user` \| `ipaallowedtoperform_write_keys_user` | Users allowed to create a keytab of this host. | no
|
||||||
`allow_create_keytab_group` \| `ipaallowedtoperform_write_keys_group` | Groups allowed to create a keytab of this host. | no
|
`allow_create_keytab_group` \| `ipaallowedtoperform_write_keys_group` | Groups allowed to create a keytab of this host. | no
|
||||||
@@ -354,7 +354,7 @@ Variable | Description | Required
|
|||||||
`mac_address` \| `macaddress` | List of hardware MAC addresses. | no
|
`mac_address` \| `macaddress` | List of hardware MAC addresses. | no
|
||||||
`sshpubkey` \| `ipasshpubkey` | List of SSH public keys | no
|
`sshpubkey` \| `ipasshpubkey` | List of SSH public keys | no
|
||||||
`userclass` \| `class` | Host category (semantics placed on this attribute are for local interpretation) | no
|
`userclass` \| `class` | Host category (semantics placed on this attribute are for local interpretation) | no
|
||||||
`auth_ind` \| `krbprincipalauthind` | Defines an allow list for Authentication Indicators. Use 'otp' to allow OTP-based 2FA authentications. Use 'radius' to allow RADIUS-based 2FA authentications. Use empty string to reset auth_ind to the initial value. Other values may be used for custom configurations. choices: ["radius", "otp", "pkinit", "hardened", ""] | no
|
`auth_ind` \| `krbprincipalauthind` | Defines an allow list for Authentication Indicators. Use 'otp' to allow OTP-based 2FA authentications. Use 'radius' to allow RADIUS-based 2FA authentications. Use empty string to reset auth_ind to the initial value. Other values may be used for custom configurations. An additional check ensures that only types can be used that are supported by the IPA version. Choices: ["radius", "otp", "pkinit", "hardened", "idp", ""] | no
|
||||||
`requires_pre_auth` \| `ipakrbrequirespreauth` | Pre-authentication is required for the service (bool) | no
|
`requires_pre_auth` \| `ipakrbrequirespreauth` | Pre-authentication is required for the service (bool) | no
|
||||||
`ok_as_delegate` \| `ipakrbokasdelegate` | Client credentials may be delegated to the service (bool) | no
|
`ok_as_delegate` \| `ipakrbokasdelegate` | Client credentials may be delegated to the service (bool) | no
|
||||||
`ok_to_auth_as_delegate` \| `ipakrboktoauthasdelegate` | The service is allowed to authenticate on behalf of a client (bool) | no
|
`ok_to_auth_as_delegate` \| `ipakrboktoauthasdelegate` | The service is allowed to authenticate on behalf of a client (bool) | no
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
233
README-idoverridegroup.md
Normal file
233
README-idoverridegroup.md
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
Idoverridegroup module
|
||||||
|
============
|
||||||
|
|
||||||
|
Description
|
||||||
|
-----------
|
||||||
|
|
||||||
|
The idoverridegroup module allows to ensure presence and absence of idoverridegroups and idoverridegroup members.
|
||||||
|
|
||||||
|
|
||||||
|
Use Cases
|
||||||
|
---------
|
||||||
|
|
||||||
|
With idoverridegroup it is possible to manage group attributes within ID views. These attributes are for example the group name or gid.
|
||||||
|
|
||||||
|
|
||||||
|
Features
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Idoverridegroup management
|
||||||
|
|
||||||
|
|
||||||
|
Supported FreeIPA Versions
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
FreeIPA versions 4.4.0 and up are supported by the ipaidoverridegroup module.
|
||||||
|
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
|
||||||
|
**Controller**
|
||||||
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
|
**Node**
|
||||||
|
* Supported FreeIPA version (see above)
|
||||||
|
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
Example inventory file
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[ipaserver]
|
||||||
|
ipaserver.test.local
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test group test_group is present in idview test_idview
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverridegroup
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test group test_group is present in idview test_idview.
|
||||||
|
ipaidoverridegroup:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_group
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test group test_group is present in idview test_idview with description
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverridegroup
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test group test_group is present in idview test_idview with description
|
||||||
|
ipaidoverridegroup:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_group
|
||||||
|
description: "test_group description"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test group test_group is present in idview test_idview without description
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverridegroup
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test group test_group is present in idview test_idview without description
|
||||||
|
ipaidoverridegroup:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_group
|
||||||
|
description: ""
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test group test_group is present in idview test_idview with internal name test_123_group
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverridegroup
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test group test_group is present in idview test_idview with internal name test_123_group
|
||||||
|
ipaidoverridegroup:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_group
|
||||||
|
name: test_123_group
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test group test_group is present in idview test_idview without internal name
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverridegroup
|
||||||
|
- name: Ensure test group test_group is present in idview test_idview without internal name
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- ipaidoverridegroup:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_group
|
||||||
|
name: ""
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test group test_group is present in idview test_idview with gid 20001
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverridegroup
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test group test_group is present in idview test_idview with gid 20001
|
||||||
|
ipaidoverridegroup:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_group
|
||||||
|
gid: 20001
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test group test_group is present in idview test_idview without gid
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverridegroup
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test group test_group is present in idview test_idview without gid
|
||||||
|
ipaidoverridegroup:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_group
|
||||||
|
gid: ""
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test group test_group is present in idview test_idview with enabling falling back to AD DC LDAP when resolving AD trusted objects. (For two-way trusts only.)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverridegroup
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test group test_group is present in idview test_idview with fallback_to_ldap enabled
|
||||||
|
ipaidoverridegroup:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_group
|
||||||
|
fallback_to_ldap: true
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test group test_group is absent in idview test_idview
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverridegroup
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test group test_group is absent in idview test_idview
|
||||||
|
ipaidoverridegroup:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_group
|
||||||
|
continue: true
|
||||||
|
state: absent
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Variables
|
||||||
|
---------
|
||||||
|
|
||||||
|
Variable | Description | Required
|
||||||
|
-------- | ----------- | --------
|
||||||
|
`ipaadmin_principal` | The admin principal is a string and defaults to `admin` | no
|
||||||
|
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
||||||
|
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
||||||
|
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to true. (bool) | no
|
||||||
|
`idview` \| `idviewcn` | The doverridegroup idview string. | yes
|
||||||
|
`anchor` \| `ipaanchoruuid` | The list of anchors to override. | yes
|
||||||
|
`description` \| `desc` | Description | no
|
||||||
|
`name` \| `group_name` \| `cn` | The group. | no
|
||||||
|
`gid` \| `gidnumber` | Group ID Number (int or "") | no
|
||||||
|
`fallback_to_ldap` | Allow falling back to AD DC LDAP when resolving AD trusted objects. For two-way trusts only. | no
|
||||||
|
`delete_continue` \| `continue` | Continuous mode. Don't stop on errors. Valid only if `state` is `absent`. | no
|
||||||
|
`state` | The state to ensure. It can be one of `present`, `absent`, default: `present`. | no
|
||||||
|
|
||||||
|
|
||||||
|
Authors
|
||||||
|
=======
|
||||||
|
|
||||||
|
Thomas Woerner
|
||||||
503
README-idoverrideuser.md
Normal file
503
README-idoverrideuser.md
Normal file
@@ -0,0 +1,503 @@
|
|||||||
|
Idoverrideuser module
|
||||||
|
============
|
||||||
|
|
||||||
|
Description
|
||||||
|
-----------
|
||||||
|
|
||||||
|
The idoverrideuser module allows to ensure presence and absence of idoverrideusers and idoverrideuser members.
|
||||||
|
|
||||||
|
|
||||||
|
Use Cases
|
||||||
|
---------
|
||||||
|
|
||||||
|
With idoverrideuser it is possible to manage user attributes within ID views. These attributes are for example the login name, home directory, certificate for authentication or SSH keys.
|
||||||
|
|
||||||
|
|
||||||
|
Features
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Idoverrideuser management
|
||||||
|
|
||||||
|
|
||||||
|
Supported FreeIPA Versions
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
FreeIPA versions 4.4.0 and up are supported by the ipaidoverrideuser module.
|
||||||
|
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
|
||||||
|
**Controller**
|
||||||
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
|
**Node**
|
||||||
|
* Supported FreeIPA version (see above)
|
||||||
|
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
Example inventory file
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[ipaserver]
|
||||||
|
ipaserver.test.local
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview.
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview with description
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview with description
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
description: "test_user description"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview without description
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview without description
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
description: ""
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview with internal name test_123_user
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview with internal name test_123_user
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
name: test_123_user
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview without internal name
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview without internal name
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
name: ""
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview with uid 20001
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview with uid 20001
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
uid: 20001
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview without uid
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview without uid
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
uid: ""
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview with gecos "Gecos Test"
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview with gecos "Gecos Test"
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
gecos: Gecos Test
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview without gecos
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview without gecos
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
gecos: ""
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview with gidnumber
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview with gidnumber
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
gidnumber: 20001
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview without gidnumber
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview without gidnumber
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
gidnumber: ""
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview with homedir /Users
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview with homedir /Users
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
homedir: /Users
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview without homedir
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview without homedir
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
homedir: ""
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview with shell
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview with shell
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
shell: /bin/someshell
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview without shell
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview without shell
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
shell: ""
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview with sshpubkey
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview with sshpubkey
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
sshpubkey:
|
||||||
|
- ssh-rsa AAAAB3NzaC1yc2EAAADAQABAAABgQCqmVDpEX5gnSjKuv97Ay ...
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview without sshpubkey
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview without sshpubkey
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
sshpubkey: []
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview with 1 certificate
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview with 1 certificate
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
certificate:
|
||||||
|
- "{{ lookup('file', 'cert1.b64', rstrip=False) }}"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview with 3 certificate members
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview with 3 certificate members
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
certificate:
|
||||||
|
- "{{ lookup('file', 'cert1.b64', rstrip=False) }}"
|
||||||
|
- "{{ lookup('file', 'cert2.b64', rstrip=False) }}"
|
||||||
|
- "{{ lookup('file', 'cert3.b64', rstrip=False) }}"
|
||||||
|
action: member
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview without 2 certificate members
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview without 2 certificate members
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
certificate:
|
||||||
|
- "{{ lookup('file', 'cert2.b64', rstrip=False) }}"
|
||||||
|
- "{{ lookup('file', 'cert3.b64', rstrip=False) }}"
|
||||||
|
action: member
|
||||||
|
state: absent
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview without certificates
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview without certificates
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
certificate: []
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is present in idview test_idview with enabling falling back to AD DC LDAP when resolving AD trusted objects. (For two-way trusts only.)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is present in idview test_idview with fallback_to_ldap enabled
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
fallback_to_ldap: true
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure test user test_user is absent in idview test_idview
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage idoverrideuser
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure test user test_user is absent in idview test_idview
|
||||||
|
ipaidoverrideuser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
idview: test_idview
|
||||||
|
anchor: test_user
|
||||||
|
continue: true
|
||||||
|
state: absent
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Variables
|
||||||
|
---------
|
||||||
|
|
||||||
|
Variable | Description | Required
|
||||||
|
-------- | ----------- | --------
|
||||||
|
`ipaadmin_principal` | The admin principal is a string and defaults to `admin` | no
|
||||||
|
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
||||||
|
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
||||||
|
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to true. (bool) | no
|
||||||
|
`idview` \| `idviewcn` | The doverrideuser idview string. | yes
|
||||||
|
`anchor` \| `ipaanchoruuid` | The list of anchors to override. | yes
|
||||||
|
`description` \| `desc` | Description | no
|
||||||
|
`name` \| `login` | The user (internally uid) | no
|
||||||
|
`uid` \| `uidnumber` | User ID Number (int or "") | no
|
||||||
|
`gecos` | GECOS | no
|
||||||
|
`gidnumber` | Group ID Number (int or ""). | no
|
||||||
|
`homedir` \| `homedirectory` | Home directory. | no
|
||||||
|
`shell` \| `loginshell` | Login shell. | no
|
||||||
|
`sshpubkey` \| `ipasshpubkey` | List of SSH public keys. | no
|
||||||
|
`certificate` \| `usercertificate` | List of Base-64 encoded user certificates. This variable can also be used with `action: member`. | no
|
||||||
|
`fallback_to_ldap` | Allow falling back to AD DC LDAP when resolving AD trusted objects. For two-way trusts only. | no
|
||||||
|
`delete_continue` \| `continue` | Continuous mode. Don't stop on errors. Valid only if `state` is `absent`. | no
|
||||||
|
`nomembers` \| `no_members` | Suppress processing of membership attributes. Valid only if `state` is `absent`. | no
|
||||||
|
`action` | Work on idoverrideuser or member level. It can be on of `member` or `idoverrideuser` and defaults to `idoverrideuser`. | no
|
||||||
|
`state` | The state to ensure. It can be one of `present`, `absent`, default: `present`. | no
|
||||||
|
|
||||||
|
|
||||||
|
Authors
|
||||||
|
=======
|
||||||
|
|
||||||
|
Thomas Woerner
|
||||||
192
README-idp.md
Normal file
192
README-idp.md
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
Idp module
|
||||||
|
============
|
||||||
|
|
||||||
|
Description
|
||||||
|
-----------
|
||||||
|
|
||||||
|
The idp module allows to ensure presence and absence of idps.
|
||||||
|
|
||||||
|
Features
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Idp management
|
||||||
|
|
||||||
|
|
||||||
|
Supported FreeIPA Versions
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
FreeIPA versions 4.4.0 and up are supported by the ipaidp module.
|
||||||
|
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
|
||||||
|
**Controller**
|
||||||
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
|
**Node**
|
||||||
|
* Supported FreeIPA version (see above)
|
||||||
|
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
Example inventory file
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[ipaserver]
|
||||||
|
ipaserver.test.local
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure keycloak idp my-keycloak-idp is present:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage IPA idp.
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure keycloak idp my-keycloak-idp is present
|
||||||
|
ipaidp:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: my-keycloak-idp
|
||||||
|
provider: keycloak
|
||||||
|
organization: main
|
||||||
|
base_url: keycloak.idm.example.com:8443/auth
|
||||||
|
client_id: my-client-id
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure keycloak idp my-keycloak-idp is absent:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage IPA idp.
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure keycloak idp my-keycloak-idp is absent
|
||||||
|
ipaidp:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: my-keycloak-idp
|
||||||
|
delete_continue: true
|
||||||
|
state: absent
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure github idp my-github-idp is present:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage IPA idp.
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure github idp my-github-idp is present
|
||||||
|
ipaidp:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: my-github-idp
|
||||||
|
provider: github
|
||||||
|
client_id: my-github-client-id
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure google idp my-google-idp is present using provider defaults without specifying provider:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage IPA idp.
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure google idp my-google-idp is present using provider defaults without specifying provider
|
||||||
|
ipaidp:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: my-google-idp
|
||||||
|
auth_uri: https://accounts.google.com/o/oauth2/auth
|
||||||
|
dev_auth_uri: https://oauth2.googleapis.com/device/code
|
||||||
|
token_uri: https://oauth2.googleapis.com/token
|
||||||
|
keys_uri: https://www.googleapis.com/oauth2/v3/certs
|
||||||
|
userinfo_uri: https://openidconnect.googleapis.com/v1/userinfo
|
||||||
|
client_id: my-google-client-id
|
||||||
|
scope: "openid email"
|
||||||
|
idp_user_id: email
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure google idp my-google-idp is present using provider:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage IPA idp.
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure google idp my-google-idp is present using provider
|
||||||
|
ipaidp:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: my-google-idp
|
||||||
|
provider: google
|
||||||
|
client_id: my-google-client-id
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure idps my-keycloak-idp, my-github-idp and my-google-idp are absent:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage IPA idp.
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure idps my-keycloak-idp, my-github-idp and my-google-idp are absent
|
||||||
|
ipaidp:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name:
|
||||||
|
- my-keycloak-idp
|
||||||
|
- my-github-idp
|
||||||
|
- my-google-idp
|
||||||
|
delete_continue: true
|
||||||
|
state: absent
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Variables
|
||||||
|
---------
|
||||||
|
|
||||||
|
Variable | Description | Required
|
||||||
|
-------- | ----------- | --------
|
||||||
|
`ipaadmin_principal` | The admin principal is a string and defaults to `admin` | no
|
||||||
|
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
||||||
|
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
||||||
|
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to true. (bool) | false
|
||||||
|
`name` \| `cn` | The list of idp name strings. | yes
|
||||||
|
auth_uri \| ipaidpauthendpoint | OAuth 2.0 authorization endpoint string. | no
|
||||||
|
dev_auth_uri \| ipaidpdevauthendpoint | Device authorization endpoint string. | no
|
||||||
|
token_uri \| ipaidptokenendpoint | Token endpoint string. | no
|
||||||
|
userinfo_uri \| ipaidpuserinfoendpoint | User information endpoint string. | no
|
||||||
|
keys_uri \| ipaidpkeysendpoint | JWKS endpoint string. | no
|
||||||
|
issuer_url \| ipaidpissuerurl | The Identity Provider OIDC URL string. | no
|
||||||
|
client_id \| ipaidpclientid | OAuth 2.0 client identifier string. | no
|
||||||
|
secret \| ipaidpclientsecret | OAuth 2.0 client secret string. | no
|
||||||
|
scope \| ipaidpscope | OAuth 2.0 scope string. Multiple scopes separated by space. | no
|
||||||
|
idp_user_id \| ipaidpsub | Attribute string for user identity in OAuth 2.0 userinfo. | no
|
||||||
|
provider \| ipaidpprovider | Pre-defined template string. This provides the provider defaults, which can be overridden with the other IdP options. Choices: ["google","github","microsoft","okta","keycloak"] | no
|
||||||
|
organization \| ipaidporg | Organization ID string or Realm name for IdP provider templates. | no
|
||||||
|
base_url \| ipaidpbaseurl | Base URL string for IdP provider templates. | no
|
||||||
|
rename \| new_name | New name for the Identity Provider server object. Only with `state: renamed`. | no
|
||||||
|
delete_continue \| continue | Continuous mode. Don't stop on errors. Valid only if `state` is `absent`. | no
|
||||||
|
`state` | The state to ensure. It can be one of `present`, `absent`, `renamed`, default: `present`. | no
|
||||||
|
|
||||||
|
|
||||||
|
Authors
|
||||||
|
=======
|
||||||
|
|
||||||
|
Thomas Woerner
|
||||||
@@ -37,7 +37,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
153
README-idview.md
Normal file
153
README-idview.md
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
Idview module
|
||||||
|
============
|
||||||
|
|
||||||
|
Description
|
||||||
|
-----------
|
||||||
|
|
||||||
|
The idview module allows to ensure presence and absence of idviews and idview host members.
|
||||||
|
|
||||||
|
Use Cases
|
||||||
|
---------
|
||||||
|
|
||||||
|
With ID views it is possible to override user or group attributes for users stored in the LDAP server. For example the login name, home directory, certificate for authentication or SSH keys. An ID view is client-side and specifies new values for user or group attributes and also the client host or hosts on which the values apply.
|
||||||
|
|
||||||
|
The ID view and the applied hosts are managed with idview, the user attributes are managed with idoverrideuser and the group attributes with idoverridegroup.
|
||||||
|
|
||||||
|
Features
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Idview management
|
||||||
|
|
||||||
|
|
||||||
|
Supported FreeIPA Versions
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
FreeIPA versions 4.4.0 and up are supported by the ipaidview module.
|
||||||
|
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
|
||||||
|
**Controller**
|
||||||
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
|
**Node**
|
||||||
|
* Supported FreeIPA version (see above)
|
||||||
|
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
Example inventory file
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[ipaserver]
|
||||||
|
ipaserver.test.local
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure idview "test_idview" is present:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage IPA idview.
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- ipaidview:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: test_idview
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure idview "test_idview" member host "testhost.example.com" is present:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage IPA idview host member.
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- ipaidview:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: test_idview
|
||||||
|
host: testhost.example.com
|
||||||
|
action: member
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure idview "test_idview" member host "testhost.example.com" is absent:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage IPA idview host member.
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- ipaidview:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: test_idview
|
||||||
|
host: testhost.example.com
|
||||||
|
action: member
|
||||||
|
state: absent
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure idview "test_idview" is present with domain_resolution_order for "ad.example.com:ipa.example.com":
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage IPA idview host member.
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- ipaidview:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: test_idview
|
||||||
|
domain_resolution_order: "ad.example.com:ipa.example.com"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to make sure idview "test_idview" is absent:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage IPA idview.
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- ipaidview:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: test_idview
|
||||||
|
state: absent
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Variables
|
||||||
|
---------
|
||||||
|
|
||||||
|
Variable | Description | Required
|
||||||
|
-------- | ----------- | --------
|
||||||
|
`ipaadmin_principal` | The admin principal is a string and defaults to `admin` | no
|
||||||
|
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
||||||
|
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
||||||
|
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to true. (bool) | no
|
||||||
|
`name` \| `cn` | The list of idview name strings. | yes
|
||||||
|
`description` \| `desc` | The description string of the idview. | no
|
||||||
|
`domain_resolution_order` \| `ipadomainresolutionorder` | Colon-separated list of domains used for short name qualification. | no
|
||||||
|
`host` \| `hosts` | List of hosts to apply the ID View to. A host can only be applied to a single idview at any time. Applying a host that is already applied to a different idview will change the idview the host is applied to to the new one. | no
|
||||||
|
`rename` \| `new_name` | Rename the ID view object to the new name string. Only usable with `state: renamed`. | no
|
||||||
|
`delete_continue` \| `continue` | Continuous mode. Don't stop on errors. Valid only if `state` is `absent`. | no
|
||||||
|
`action` | Work on idview or member level. It can be on of `member` or `idview` and defaults to `idview`. | no
|
||||||
|
`state` | The state to ensure. It can be one of `present`, `absent` and `renamed`, default: `present`. | no
|
||||||
|
|
||||||
|
|
||||||
|
Authors
|
||||||
|
=======
|
||||||
|
|
||||||
|
Thomas Woerner
|
||||||
106
README-inventory-plugin-freeipa.md
Normal file
106
README-inventory-plugin-freeipa.md
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
Inventory plugin
|
||||||
|
================
|
||||||
|
|
||||||
|
Description
|
||||||
|
-----------
|
||||||
|
|
||||||
|
|
||||||
|
The inventory plugin compiles a dynamic inventory from IPA domain. The servers can be filtered by their role(s).
|
||||||
|
|
||||||
|
This plugin is using the Python requests binding, that is only available for Python 3.7 and up.
|
||||||
|
|
||||||
|
|
||||||
|
Features
|
||||||
|
--------
|
||||||
|
* Dynamic inventory
|
||||||
|
|
||||||
|
|
||||||
|
Supported FreeIPA Versions
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
FreeIPA versions 4.6.0 and up are supported by the inventory plugin.
|
||||||
|
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
|
||||||
|
**Controller**
|
||||||
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
|
**Node**
|
||||||
|
* Supported FreeIPA version (see above)
|
||||||
|
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
=============
|
||||||
|
|
||||||
|
The inventory plugin is automatically enabled from the Ansible collection or from the top directory of the git repo if the `plugins` folder is linked to `~/.ansible`.
|
||||||
|
|
||||||
|
If `ansible.cfg` was modified to point to the roles and modules with `roles_path`, `library` and `module_utils` tag, then it is needed to set `inventory_plugins` also:
|
||||||
|
|
||||||
|
```
|
||||||
|
inventory_plugins = /my/dir/ansible-freeipa/plugins/inventory
|
||||||
|
```
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
Example inventory file "freeipa.yml":
|
||||||
|
|
||||||
|
```yml
|
||||||
|
---
|
||||||
|
plugin: freeipa
|
||||||
|
server: server.ipa.local
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
```
|
||||||
|
|
||||||
|
Example inventory file "freeipa.yml" with server TLS certificate verification using local copy of `/etc/ipa/ca.crt` from the server:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
---
|
||||||
|
plugin: freeipa
|
||||||
|
server: server.ipa.local
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
verify: ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
How to use the plugin
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
With the `ansible-inventory` command it is possible to show the generated inventorey:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ansible-inventory -v -i freeipa.yml --graph
|
||||||
|
```
|
||||||
|
|
||||||
|
Example inventory file "freeipa.yml" for use with `playbooks/config/retrieve-config.yml`:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
---
|
||||||
|
plugin: freeipa
|
||||||
|
server: server.ipa.local
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
inventory_group: ipaserver
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ansible-playbook -u root -i ipa.yml playbooks/config/retrieve-config.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
Variables
|
||||||
|
=========
|
||||||
|
|
||||||
|
Variable | Description | Required
|
||||||
|
-------- | ----------- | --------
|
||||||
|
`ipaadmin_principal` | The admin principal is a string and defaults to `admin` | no
|
||||||
|
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
||||||
|
`server` | The FQDN of server to start the scan. (string) | yes
|
||||||
|
`verify` | The server TLS certificate file for verification (/etc/ipa/ca.crt). Turned off if not set. (string) | yes
|
||||||
|
`role` | The role(s) of the server. If several roles are given, only servers that have all the roles are returned. (list of strings) (choices: "IPA master", "CA server", "KRA server", "DNS server", "AD trust controller", "AD trust agent") | no
|
||||||
|
`inventory_group` | The inventory group to create. The default group name is "ipaservers". | no
|
||||||
|
|
||||||
|
Authors
|
||||||
|
=======
|
||||||
|
|
||||||
|
- Thomas Woerner
|
||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
@@ -128,20 +128,20 @@ Variable | Description | Required
|
|||||||
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
||||||
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to yes. (bool) | no
|
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to yes. (bool) | no
|
||||||
`name` \| `cn` | The list of pwpolicy name strings. If name is not given, `global_policy` will be used automatically. | no
|
`name` \| `cn` | The list of pwpolicy name strings. If name is not given, `global_policy` will be used automatically. | no
|
||||||
`maxlife` \| `krbmaxpwdlife` | Maximum password lifetime in days. (int) | no
|
`maxlife` \| `krbmaxpwdlife` | Maximum password lifetime in days. (int or "") | no
|
||||||
`minlife` \| `krbminpwdlife` | Minimum password lifetime in hours. (int) | no
|
`minlife` \| `krbminpwdlife` | Minimum password lifetime in hours. (int or "") | no
|
||||||
`history` \| `krbpwdhistorylength` | Password history size. (int) | no
|
`history` \| `krbpwdhistorylength` | Password history size. (int or "") | no
|
||||||
`minclasses` \| `krbpwdmindiffchars` | Minimum number of character classes. (int) | no
|
`minclasses` \| `krbpwdmindiffchars` | Minimum number of character classes. (int or "") | no
|
||||||
`minlength` \| `krbpwdminlength` | Minimum length of password. (int) | no
|
`minlength` \| `krbpwdminlength` | Minimum length of password. (int or "") | no
|
||||||
`priority` \| `cospriority` | Priority of the policy, higher number means lower priority. (int) | no
|
`priority` \| `cospriority` | Priority of the policy, higher number means lower priority. (int or "") | no
|
||||||
`maxfail` \| `krbpwdmaxfailure` | Consecutive failures before lockout. (int) | no
|
`maxfail` \| `krbpwdmaxfailure` | Consecutive failures before lockout. (int or "") | no
|
||||||
`failinterval` \| `krbpwdfailurecountinterval` | Period after which failure count will be reset in seconds. (int) | no
|
`failinterval` \| `krbpwdfailurecountinterval` | Period after which failure count will be reset in seconds. (int or "") | no
|
||||||
`lockouttime` \| `krbpwdlockoutduration` | Period for which lockout is enforced in seconds. (int) | no
|
`lockouttime` \| `krbpwdlockoutduration` | Period for which lockout is enforced in seconds. (int or "") | no
|
||||||
`maxrepeat` \| `ipapwdmaxrepeat` | Maximum number of same consecutive characters. Requires IPA 4.9+ (int) | no
|
`maxrepeat` \| `ipapwdmaxrepeat` | Maximum number of same consecutive characters. Requires IPA 4.9+ (int or "") | no
|
||||||
`maxsequence` \| `ipapwdmaxsequence` | The maximum length of monotonic character sequences (abcd). Requires IPA 4.9+ (int) | no
|
`maxsequence` \| `ipapwdmaxsequence` | The maximum length of monotonic character sequences (abcd). Requires IPA 4.9+ (int or "") | no
|
||||||
`dictcheck` \| `ipapwdictcheck` | Check if the password is a dictionary word. Requires IPA 4.9+ (int) | no
|
`dictcheck` \| `ipapwdictcheck` | Check if the password is a dictionary word. Requires IPA 4.9+. (bool or "") | no
|
||||||
`usercheck` \| `ipapwdusercheck` | Check if the password contains the username. Requires IPA 4.9+ (int) | no
|
`usercheck` \| `ipapwdusercheck` | Check if the password contains the username. Requires IPA 4.9+. (bool or "") | no
|
||||||
`gracelimit` \| `passwordgracelimit` | Number of LDAP authentications allowed after expiration. Requires IPA 4.9.10 (int) | no
|
`gracelimit` \| `passwordgracelimit` | Number of LDAP authentications allowed after expiration. Requires IPA 4.9.10 (int or "") | no
|
||||||
`state` | The state to ensure. It can be one of `present` or `absent`, default: `present`. | yes
|
`state` | The state to ensure. It can be one of `present` or `absent`, default: `present`. | yes
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
@@ -249,14 +249,14 @@ Variable | Description | Required
|
|||||||
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
||||||
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to yes. (bool) | no
|
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to yes. (bool) | no
|
||||||
`name` \| `cn` | The list of server name strings. | yes
|
`name` \| `cn` | The list of server name strings. | yes
|
||||||
`location` \| `ipalocation_location` | The server location string. Only in state: present. "" for location reset. | no
|
`location` \| `ipalocation_location` | The server DNS location. Only available with 'state: present'. Use "" for location reset. | no
|
||||||
`service_weight` \| `ipaserviceweight` | Weight for server services. Type Values 0 to 65535, -1 for weight reset. Only in state: present. (int) | no
|
`service_weight` \| `ipaserviceweight` | Weight for server services. Type Values 0 to 65535, -1 for weight reset. Only available with 'state: present'. (int) | no
|
||||||
`hidden` | Set hidden state of a server. Only in state: present. (bool) | no
|
`hidden` | Set hidden state of a server. Only available with 'state: present'. (bool) | no
|
||||||
`no_members` | Suppress processing of membership attributes. Only in state: present. (bool) | no
|
`no_members` | Suppress processing of membership attributes. Only avialable with 'state: present'. (bool) | no
|
||||||
`delete_continue` \| `continue` | Continuous mode: Don't stop on errors. Only in state: absent. (bool) | no
|
`delete_continue` \| `continue` | Continuous mode: Don't stop on errors. Only available with 'state: absent'. (bool) | no
|
||||||
`ignore_last_of_role` | Skip a check whether the last CA master or DNS server is removed. Only in state: absent. (bool) | no
|
`ignore_last_of_role` | Skip a check whether the last CA master or DNS server is removed. Only available with 'state: absent'. (bool) | no
|
||||||
`ignore_topology_disconnect` | Ignore topology connectivity problems after removal. Only in state: absent. (bool) | no
|
`ignore_topology_disconnect` | Ignore topology connectivity problems after removal. Only available with 'state: absent'. (bool) | no
|
||||||
`force` | Force server removal even if it does not exist. Will always result in changed. Only in state: absent. (bool) | no
|
`force` | Force server removal even if it does not exist. Will always result in changed. Only available with 'state: absent'. (bool) | no
|
||||||
`state` | The state to ensure. It can be one of `present`, `absent`, default: `present`. `present` is only working with existing servers. | no
|
`state` | The state to ensure. It can be one of `present`, `absent`, default: `present`. `present` is only working with existing servers. | no
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FReeIPA version (see above)
|
* Supported FReeIPA version (see above)
|
||||||
@@ -282,6 +282,65 @@ Example playbook to allow users, groups, hosts or hostgroups to retrieve a keyta
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to ensure presence of serveral services in a single task:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage IPA service.
|
||||||
|
hosts: ipaserver
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure services are present
|
||||||
|
ipaservice:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
services:
|
||||||
|
- name: HTTP/www.example.com
|
||||||
|
principal:
|
||||||
|
- host/host1.example.com
|
||||||
|
- name: mysvc/www.example.com
|
||||||
|
pac_type: NONE
|
||||||
|
ok_as_delegate: yes
|
||||||
|
ok_to_auth_as_delegate: yes
|
||||||
|
- name: HTTP/www.example.com
|
||||||
|
allow_create_keytab_user:
|
||||||
|
- user01
|
||||||
|
- user02
|
||||||
|
allow_create_keytab_group:
|
||||||
|
- group01
|
||||||
|
- group02
|
||||||
|
allow_create_keytab_host:
|
||||||
|
- host1.example.com
|
||||||
|
- host2.example.com
|
||||||
|
allow_create_keytab_hostgroup:
|
||||||
|
- hostgroup01
|
||||||
|
- hostgroup02
|
||||||
|
- name: mysvc/host2.example.com
|
||||||
|
auth_ind: otp,radius
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to ensure presence of serveral services in a single task with `member` `action`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage IPA service.
|
||||||
|
hosts: ipaserver
|
||||||
|
become: true
|
||||||
|
gather_facts: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure service host members are present
|
||||||
|
ipaservice:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
services:
|
||||||
|
- name: HTTP/www1.example.com
|
||||||
|
host: host1.example.com
|
||||||
|
- name: HTTP/www2.example.com
|
||||||
|
host: host2.example.com
|
||||||
|
action: member
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Variables
|
Variables
|
||||||
---------
|
---------
|
||||||
|
|
||||||
@@ -291,10 +350,18 @@ Variable | Description | Required
|
|||||||
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
||||||
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
||||||
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to yes. (bool) | no
|
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to yes. (bool) | no
|
||||||
`name` \| `service` | The list of service name strings. | yes
|
`name` \| `service` | The list of service name strings. `name` with *service variables* or `services` containing *service variables* need to be used. | no
|
||||||
|
`action` | Work on service or member level. It can be on of `member` or `service` and defaults to `service`. | no
|
||||||
|
`state` | The state to ensure. It can be one of `present`, `absent`, or `disabled`, default: `present`. | no
|
||||||
|
|
||||||
|
|
||||||
|
**Service Variables:**
|
||||||
|
|
||||||
|
Variable | Description | Required
|
||||||
|
-------- | ----------- | --------
|
||||||
`certificate` \| `usercertificate` | Base-64 encoded service certificate. | no
|
`certificate` \| `usercertificate` | Base-64 encoded service certificate. | no
|
||||||
`pac_type` \| `ipakrbauthzdata` | Supported PAC type. It can be one of `MS-PAC`, `PAD`, or `NONE`. Use empty string to reset pac_type to the initial value. | no
|
`pac_type` \| `ipakrbauthzdata` | Supported PAC type. It can be one of `MS-PAC`, `PAD`, or `NONE`. Use empty string to reset pac_type to the initial value. | no
|
||||||
`auth_ind` \| `krbprincipalauthind` | Defines an allow list for Authentication Indicators. It can be any of `otp`, `radius`, `pkinit` or `hardened`. Use empty string to reset auth_ind to the initial value. | no
|
`auth_ind` \| `krbprincipalauthind` | Defines an allow list for Authentication Indicators. It can be any of `otp`, `radius`, `pkinit`, `hardened`, `idp` or `""`. An additional check ensures that only types can be used that are supported by the IPA version. Use empty string to reset auth_ind to the initial value. | no
|
||||||
`requires_pre_auth` \| `ipakrbrequirespreauth` | Pre-authentication is required for the service. Default to true. (bool) | no
|
`requires_pre_auth` \| `ipakrbrequirespreauth` | Pre-authentication is required for the service. Default to true. (bool) | no
|
||||||
`ok_as_delegate` \| `ipakrbokasdelegate` | Client credentials may be delegated to the service. Default to false. (bool) | no
|
`ok_as_delegate` \| `ipakrbokasdelegate` | Client credentials may be delegated to the service. Default to false. (bool) | no
|
||||||
`ok_to_auth_as_delegate` \| `ipakrboktoauthasdelegate` | The service is allowed to authenticate on behalf of a client. Default to false. (bool) | no
|
`ok_to_auth_as_delegate` \| `ipakrboktoauthasdelegate` | The service is allowed to authenticate on behalf of a client. Default to false. (bool) | no
|
||||||
@@ -310,11 +377,9 @@ Variable | Description | Required
|
|||||||
`allow_retrieve_keytab_group` \| `ipaallowedtoperform_read_keys_group` | Groups allowed to retrieve a keytab of this host. | no
|
`allow_retrieve_keytab_group` \| `ipaallowedtoperform_read_keys_group` | Groups allowed to retrieve a keytab of this host. | no
|
||||||
`allow_retrieve_keytab_host` \| `ipaallowedtoperform_read_keys_host` | Hosts allowed to retrieve a keytab from of host. | no
|
`allow_retrieve_keytab_host` \| `ipaallowedtoperform_read_keys_host` | Hosts allowed to retrieve a keytab from of host. | no
|
||||||
`allow_retrieve_keytab_hostgroup` \| `ipaallowedtoperform_read_keys_hostgroup` | Host groups allowed to retrieve a keytab of this host. | no
|
`allow_retrieve_keytab_hostgroup` \| `ipaallowedtoperform_read_keys_hostgroup` | Host groups allowed to retrieve a keytab of this host. | no
|
||||||
`continue` | Continuous mode: don't stop on errors. Valid only if `state` is `absent`. Default: `no` (bool) | no
|
|
||||||
`smb` | Service is an SMB service. If set, `cifs/` will be prefixed to the service name if needed. | no
|
`smb` | Service is an SMB service. If set, `cifs/` will be prefixed to the service name if needed. | no
|
||||||
`netbiosname` | NETBIOS name for the SMB service. Only with `smb: yes`. | no
|
`netbiosname` | NETBIOS name for the SMB service. Only with `smb: yes`. | no
|
||||||
`action` | Work on service or member level. It can be on of `member` or `service` and defaults to `service`. | no
|
`continue` \| `delete_continue` | Continuous mode: don't stop on errors. Valid only if `state` is `absent`. Default: `no` (bool) | no
|
||||||
`state` | The state to ensure. It can be one of `present`, `absent`, or `disabled`, default: `present`. | no
|
|
||||||
|
|
||||||
|
|
||||||
Authors
|
Authors
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
@@ -93,6 +93,26 @@ Example playbook to make sure sudocmds are not present in Sudo Rule:
|
|||||||
state: absent
|
state: absent
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example playbook to ensure a Group of RunAs User is present in sudo rule:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to manage sudorule member
|
||||||
|
hosts: ipaserver
|
||||||
|
become: no
|
||||||
|
gather_facts: no
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure sudorule 'runasuser' has 'ipasuers' group as runas users.
|
||||||
|
ipasudorule:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: testrule1
|
||||||
|
runasuser_group: ipausers
|
||||||
|
action: member
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Example playbook to make sure Sudo Rule is absent:
|
Example playbook to make sure Sudo Rule is absent:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -109,6 +129,49 @@ Example playbook to make sure Sudo Rule is absent:
|
|||||||
state: absent
|
state: absent
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Example playbook to ensure multiple Sudo Rule are present using batch mode:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to handle sudorules
|
||||||
|
hosts: ipaserver
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Ensure multiple Sudo Rules are present using batch mode.
|
||||||
|
ipasudorule:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
sudorules:
|
||||||
|
- name: testrule1
|
||||||
|
hostmask:
|
||||||
|
- 192.168.122.1/24
|
||||||
|
- name: testrule2
|
||||||
|
hostcategory: all
|
||||||
|
```
|
||||||
|
|
||||||
|
Example playbook to ensure multiple Sudo Rule members are present using batch mode:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to handle sudorules
|
||||||
|
hosts: ipaserver
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Ensure multiple Sudo Rules are present using batch mode.
|
||||||
|
ipasudorule:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
action: member
|
||||||
|
sudorules:
|
||||||
|
- name: testrule1
|
||||||
|
user:
|
||||||
|
- user01
|
||||||
|
- user02
|
||||||
|
group:
|
||||||
|
- group01
|
||||||
|
- name: testrule2
|
||||||
|
hostgroup:
|
||||||
|
- hostgroup01
|
||||||
|
- hostgroup02
|
||||||
|
```
|
||||||
|
|
||||||
Variables
|
Variables
|
||||||
=========
|
=========
|
||||||
@@ -119,7 +182,9 @@ Variable | Description | Required
|
|||||||
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
||||||
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
||||||
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to yes. (bool) | no
|
`ipaapi_ldap_cache` | Use LDAP cache for IPA connection. The bool setting defaults to yes. (bool) | no
|
||||||
`name` \| `cn` | The list of sudorule name strings. | yes
|
`name` \| `cn` | The list of sudorule name strings. | no
|
||||||
|
`sudorules` | The list of sudorule dicts. Each `sudorule` dict entry can contain sudorule variables.<br>There is one required option in the `sudorule` dict:| no
|
||||||
|
| `name` - The sudorule name string of the entry. | yes
|
||||||
`description` | The sudorule description string. | no
|
`description` | The sudorule description string. | no
|
||||||
`usercategory` \| `usercat` | User category the rule applies to. Choices: ["all", ""] | no
|
`usercategory` \| `usercat` | User category the rule applies to. Choices: ["all", ""] | no
|
||||||
`hostcategory` \| `hostcat` | Host category the rule applies to. Choices: ["all", ""] | no
|
`hostcategory` \| `hostcat` | Host category the rule applies to. Choices: ["all", ""] | no
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Requirements
|
|||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
|
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
@@ -58,6 +58,7 @@ Example playbook to ensure a user is present:
|
|||||||
last: Acme
|
last: Acme
|
||||||
uid: 10001
|
uid: 10001
|
||||||
gid: 100
|
gid: 100
|
||||||
|
gecos: "The Pinky"
|
||||||
phone: "+555123457"
|
phone: "+555123457"
|
||||||
email: pinky@acme.com
|
email: pinky@acme.com
|
||||||
passwordexpiration: "2023-01-19 23:59:59"
|
passwordexpiration: "2023-01-19 23:59:59"
|
||||||
@@ -278,7 +279,6 @@ Example playbook to disable a user:
|
|||||||
|
|
||||||
This can also be done as an alternative with the `users` variable containing only names.
|
This can also be done as an alternative with the `users` variable containing only names.
|
||||||
|
|
||||||
|
|
||||||
Example playbook to enable users:
|
Example playbook to enable users:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -297,6 +297,22 @@ Example playbook to enable users:
|
|||||||
|
|
||||||
This can also be done as an alternative with the `users` variable containing only names.
|
This can also be done as an alternative with the `users` variable containing only names.
|
||||||
|
|
||||||
|
Example playbook to rename users:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Playbook to handle users
|
||||||
|
hosts: ipaserver
|
||||||
|
become: true
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
# Rename user pinky to reddy
|
||||||
|
- ipauser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: pinky
|
||||||
|
rename: reddy
|
||||||
|
state: renamed
|
||||||
|
```
|
||||||
|
|
||||||
Example playbook to unlock users:
|
Example playbook to unlock users:
|
||||||
|
|
||||||
@@ -352,6 +368,33 @@ Example playbook to ensure users are absent:
|
|||||||
state: absent
|
state: absent
|
||||||
```
|
```
|
||||||
|
|
||||||
|
When using FreeIPA 4.8.0+, SMB logon script, profile, home directory and home drive can be set for users.
|
||||||
|
|
||||||
|
In the example playbook to set SMB attributes note that `smb_profile_path` and `smb_home_dir` use paths in UNC format, which includes backslashes ('\\`). If the paths are quoted, the backslash needs to be escaped becoming "\\", so the path `\\server\dir` becomes `"\\\\server\\dir"`. If the paths are unquoted the slashes do not have to be escaped.
|
||||||
|
|
||||||
|
The YAML specification states that a colon (':') is a key separator and a dash ('-') is an item marker, only with a space after them, so using both unquoted as part of a path should not be a problem. If a space is needed after a colon or a dash, then a quoted string must be used as in `"user - home"`. For the `smb_home_drive` attribute is is recomended that a quoted string is used, to improve readability.
|
||||||
|
|
||||||
|
Example playbook to set SMB attributes:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
- name: Plabook to handle users
|
||||||
|
hosts: ipaserver
|
||||||
|
become: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure user 'smbuser' is present with smb attributes
|
||||||
|
ipauser:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: smbuser
|
||||||
|
first: SMB
|
||||||
|
last: User
|
||||||
|
smb_logon_script: N:\logonscripts\startup
|
||||||
|
smb_profile_path: \\server\profiles\some_profile
|
||||||
|
smb_home_dir: \\users\home\smbuser
|
||||||
|
smb_home_drive: "U:"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Variables
|
Variables
|
||||||
=========
|
=========
|
||||||
@@ -373,7 +416,7 @@ Variable | Description | Required
|
|||||||
`update_password` | Set password for a user in present state only on creation or always. It can be one of `always` or `on_create` and defaults to `always`. | no
|
`update_password` | Set password for a user in present state only on creation or always. It can be one of `always` or `on_create` and defaults to `always`. | no
|
||||||
`preserve` | Delete a user, keeping the entry available for future use. (bool) | no
|
`preserve` | Delete a user, keeping the entry available for future use. (bool) | no
|
||||||
`action` | Work on user or member level. It can be on of `member` or `user` and defaults to `user`. | no
|
`action` | Work on user or member level. It can be on of `member` or `user` and defaults to `user`. | no
|
||||||
`state` | The state to ensure. It can be one of `present`, `absent`, `enabled`, `disabled`, `unlocked` or `undeleted`, default: `present`. Only `names` or `users` with only `name` set are allowed if state is not `present`. | yes
|
`state` | The state to ensure. It can be one of `present`, `absent`, `enabled`, `disabled`, `renamed`, `unlocked` or `undeleted`, default: `present`. Only `names` or `users` with only `name` set are allowed if state is not `present`. | yes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -395,6 +438,8 @@ Variable | Description | Required
|
|||||||
`random` | Generate a random user password | no
|
`random` | Generate a random user password | no
|
||||||
`uid` \| `uidnumber` | User ID Number (system will assign one if not provided). | no
|
`uid` \| `uidnumber` | User ID Number (system will assign one if not provided). | no
|
||||||
`gid` \| `gidnumber` | Group ID Number. | no
|
`gid` \| `gidnumber` | Group ID Number. | no
|
||||||
|
`gecos` | GECOS | no
|
||||||
|
`street` | Street address | no
|
||||||
`city` | City | no
|
`city` | City | no
|
||||||
`userstate` \| `st` | State/Province | no
|
`userstate` \| `st` | State/Province | no
|
||||||
`postalcode` \| `zip` | Postalcode/ZIP | no
|
`postalcode` \| `zip` | Postalcode/ZIP | no
|
||||||
@@ -407,7 +452,7 @@ Variable | Description | Required
|
|||||||
`manager` | List of manager user names. | no
|
`manager` | List of manager user names. | no
|
||||||
`carlicense` | List of car licenses. | no
|
`carlicense` | List of car licenses. | no
|
||||||
`sshpubkey` \| `ipasshpubkey` | List of SSH public keys. | no
|
`sshpubkey` \| `ipasshpubkey` | List of SSH public keys. | no
|
||||||
`userauthtype` | List of supported user authentication types. Choices: `password`, `radius`, `otp` and ``. Use empty string to reset userauthtype to the initial value. | no
|
`userauthtype` \| `ipauserauthtype` | List of supported user authentication types. Choices: `password`, `radius`, `otp`, `pkinit`, `hardened`, `idp` and `""`. An additional check ensures that only types can be used that are supported by the IPA version. Use empty string to reset userauthtype to the initial value. | no
|
||||||
`userclass` | User category. (semantics placed on this attribute are for local interpretation). | no
|
`userclass` | User category. (semantics placed on this attribute are for local interpretation). | no
|
||||||
`radius` | RADIUS proxy configuration | no
|
`radius` | RADIUS proxy configuration | no
|
||||||
`radiususer` | RADIUS proxy username | no
|
`radiususer` | RADIUS proxy username | no
|
||||||
@@ -415,6 +460,8 @@ Variable | Description | Required
|
|||||||
`employeenumber` | Employee Number | no
|
`employeenumber` | Employee Number | no
|
||||||
`employeetype` | Employee Type | no
|
`employeetype` | Employee Type | no
|
||||||
`preferredlanguage` | Preferred Language | no
|
`preferredlanguage` | Preferred Language | no
|
||||||
|
`idp` \| `ipaidpconfiglink` | External IdP configuration | no
|
||||||
|
`idp_user_id` \| `ipaidpsub` | A string that identifies the user at external IdP | no
|
||||||
`certificate` | List of base-64 encoded user certificates. | no
|
`certificate` | List of base-64 encoded user certificates. | no
|
||||||
`certmapdata` | List of certificate mappings. Either `data` or `certificate` or `issuer` together with `subject` need to be specified. Only usable with IPA versions 4.5 and up. <br>Options: | no
|
`certmapdata` | List of certificate mappings. Either `data` or `certificate` or `issuer` together with `subject` need to be specified. Only usable with IPA versions 4.5 and up. <br>Options: | no
|
||||||
| `certificate` - Base-64 encoded user certificate, not usable with other certmapdata options. | no
|
| `certificate` - Base-64 encoded user certificate, not usable with other certmapdata options. | no
|
||||||
@@ -422,10 +469,14 @@ Variable | Description | Required
|
|||||||
| `subject` - Subject of the certificate, only usable together with `issuer` option. | no
|
| `subject` - Subject of the certificate, only usable together with `issuer` option. | no
|
||||||
| `data` - Certmap data, not usable with other certmapdata options. | no
|
| `data` - Certmap data, not usable with other certmapdata options. | no
|
||||||
`noprivate` | Do not create user private group. (bool) | no
|
`noprivate` | Do not create user private group. (bool) | no
|
||||||
|
`smb_logon_script` \| `ipantlogonscript` | SMB logon script path. Requires FreeIPA version 4.8.0+. | no
|
||||||
|
`smb_profile_path:` \| `ipantprofilepath` | SMB profile path, in UNC format. Requires FreeIPA version 4.8.0+. | no
|
||||||
|
`smb_home_dir` \| `ipanthomedirectory` | SMB Home Directory, in UNC format. Requires FreeIPA version 4.8.0+. | no
|
||||||
|
`smb_home_drive` \| `ipanthomedirectorydrive` | SMB Home Directory Drive, a single upercase letter (A-Z) followed by a colon (:), for example "U:". Requires FreeIPA version 4.8.0+. | no
|
||||||
|
`rename` \| `new_name` | Rename the user object to the new name string. Only usable with `state: renamed`. | no
|
||||||
`nomembers` | Suppress processing of membership attributes. (bool) | no
|
`nomembers` | Suppress processing of membership attributes. (bool) | no
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Return Values
|
Return Values
|
||||||
=============
|
=============
|
||||||
|
|
||||||
@@ -441,4 +492,5 @@ Variable | Description | Returned When
|
|||||||
Authors
|
Authors
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Thomas Woerner
|
- Thomas Woerner
|
||||||
|
- Rafael Jeffman
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
|
|||||||
39
README.md
39
README.md
@@ -13,10 +13,12 @@ Features
|
|||||||
* Repair mode for clients
|
* Repair mode for clients
|
||||||
* Backup and restore, also to and from controller
|
* Backup and restore, also to and from controller
|
||||||
* Smartcard setup for servers and clients
|
* Smartcard setup for servers and clients
|
||||||
|
* Inventory plugin freeipa
|
||||||
* Modules for automembership rule management
|
* Modules for automembership rule management
|
||||||
* Modules for automount key management
|
* Modules for automount key management
|
||||||
* Modules for automount location management
|
* Modules for automount location management
|
||||||
* Modules for automount map management
|
* Modules for automount map management
|
||||||
|
* Modules for certificate management
|
||||||
* Modules for config management
|
* Modules for config management
|
||||||
* Modules for delegation management
|
* Modules for delegation management
|
||||||
* Modules for dns config management
|
* Modules for dns config management
|
||||||
@@ -29,7 +31,11 @@ Features
|
|||||||
* Modules for hbacsvcgroup management
|
* Modules for hbacsvcgroup management
|
||||||
* Modules for host management
|
* Modules for host management
|
||||||
* Modules for hostgroup management
|
* Modules for hostgroup management
|
||||||
|
* Modules for idoverridegroup management
|
||||||
|
* Modules for idoverrideuser management
|
||||||
|
* Modules for idp management
|
||||||
* Modules for idrange management
|
* Modules for idrange management
|
||||||
|
* Modules for idview management
|
||||||
* Modules for location management
|
* Modules for location management
|
||||||
* Modules for netgroup management
|
* Modules for netgroup management
|
||||||
* Modules for permission management
|
* Modules for permission management
|
||||||
@@ -60,7 +66,7 @@ Supported Distributions
|
|||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
* RHEL/CentOS 7.4+
|
* RHEL/CentOS 7.4+
|
||||||
* Fedora 26+
|
* Fedora 40+
|
||||||
* Ubuntu
|
* Ubuntu
|
||||||
* Debian 10+ (ipaclient only, no server or replica!)
|
* Debian 10+ (ipaclient only, no server or replica!)
|
||||||
|
|
||||||
@@ -68,7 +74,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
**Controller**
|
**Controller**
|
||||||
* Ansible version: 2.8+ (ansible-freeipa is an Ansible Collection)
|
* Ansible version: 2.14+
|
||||||
|
|
||||||
**Node**
|
**Node**
|
||||||
* Supported FreeIPA version (see above)
|
* Supported FreeIPA version (see above)
|
||||||
@@ -103,9 +109,10 @@ You can use the roles directly within the top directory of the git repo, but to
|
|||||||
You can either adapt ansible.cfg:
|
You can either adapt ansible.cfg:
|
||||||
|
|
||||||
```
|
```
|
||||||
roles_path = /my/dir/ansible-freeipa/roles
|
roles_path = /my/dir/ansible-freeipa/roles
|
||||||
library = /my/dir/ansible-freeipa/plugins/modules
|
library = /my/dir/ansible-freeipa/plugins/modules
|
||||||
module_utils = /my/dir/ansible-freeipa/plugins/module_utils
|
module_utils = /my/dir/ansible-freeipa/plugins/module_utils
|
||||||
|
inventory_plugins = /my/dir/ansible-freeipa/plugins/inventory
|
||||||
```
|
```
|
||||||
|
|
||||||
Or you can link the directories:
|
Or you can link the directories:
|
||||||
@@ -118,7 +125,7 @@ ansible-freeipa/plugins/module_utils to ~/.ansible/plugins/
|
|||||||
|
|
||||||
**RPM package**
|
**RPM package**
|
||||||
|
|
||||||
There are RPM packages available for Fedora 29+. These are installing the roles and modules into the global Ansible directories for `roles`, `plugins/modules` and `plugins/module_utils` in the `/usr/share/ansible` directory. Therefore is it possible to use the roles and modules without adapting the names like it is done in the example playbooks.
|
There are RPM packages available for Fedora. These are installing the roles and modules into the global Ansible directories for `roles`, `plugins/modules` and `plugins/module_utils` in the `/usr/share/ansible` directory. Therefore is it possible to use the roles and modules without adapting the names like it is done in the example playbooks.
|
||||||
|
|
||||||
**Ansible Galaxy**
|
**Ansible Galaxy**
|
||||||
|
|
||||||
@@ -128,18 +135,8 @@ This command will get the whole collection from galaxy:
|
|||||||
ansible-galaxy collection install freeipa.ansible_freeipa
|
ansible-galaxy collection install freeipa.ansible_freeipa
|
||||||
```
|
```
|
||||||
|
|
||||||
Installing collections using the ansible-galaxy command is only supported with ansible 2.9+.
|
|
||||||
|
|
||||||
The mazer tool can be used for to install the collection for ansible 2.8:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
mazer install freeipa.ansible_freeipa
|
|
||||||
```
|
|
||||||
|
|
||||||
Ansible galaxy does not support the use of dash ('-') in a name and is automatically replacing this with an underscore ('\_'). Therefore the name is `ansible_freeipa`. The ansible_freeipa collection will be placed in the directory `~/.ansible/collections/ansible_collections/freeipa/ansible_freeipa` where it will be automatically be found for this user.
|
Ansible galaxy does not support the use of dash ('-') in a name and is automatically replacing this with an underscore ('\_'). Therefore the name is `ansible_freeipa`. The ansible_freeipa collection will be placed in the directory `~/.ansible/collections/ansible_collections/freeipa/ansible_freeipa` where it will be automatically be found for this user.
|
||||||
|
|
||||||
The needed adaptions of collection prefixes for `modules` and `module_utils` will be done with ansible-freeipa release `0.1.6` for galaxy.
|
|
||||||
|
|
||||||
|
|
||||||
Ansible inventory file
|
Ansible inventory file
|
||||||
----------------------
|
----------------------
|
||||||
@@ -436,6 +433,7 @@ Modules in plugin/modules
|
|||||||
* [ipaautomountkey](README-automountkey.md)
|
* [ipaautomountkey](README-automountkey.md)
|
||||||
* [ipaautomountlocation](README-automountlocation.md)
|
* [ipaautomountlocation](README-automountlocation.md)
|
||||||
* [ipaautomountmap](README-automountmap.md)
|
* [ipaautomountmap](README-automountmap.md)
|
||||||
|
* [ipacert](README-cert.md)
|
||||||
* [ipaconfig](README-config.md)
|
* [ipaconfig](README-config.md)
|
||||||
* [ipadelegation](README-delegation.md)
|
* [ipadelegation](README-delegation.md)
|
||||||
* [ipadnsconfig](README-dnsconfig.md)
|
* [ipadnsconfig](README-dnsconfig.md)
|
||||||
@@ -448,7 +446,11 @@ Modules in plugin/modules
|
|||||||
* [ipahbacsvcgroup](README-hbacsvcgroup.md)
|
* [ipahbacsvcgroup](README-hbacsvcgroup.md)
|
||||||
* [ipahost](README-host.md)
|
* [ipahost](README-host.md)
|
||||||
* [ipahostgroup](README-hostgroup.md)
|
* [ipahostgroup](README-hostgroup.md)
|
||||||
|
* [idoverridegroup](README-idoverridegroup.md)
|
||||||
|
* [idoverrideuser](README-idoverrideuser.md)
|
||||||
|
* [idp](README-idp.md)
|
||||||
* [idrange](README-idrange.md)
|
* [idrange](README-idrange.md)
|
||||||
|
* [idview](README-idview.md)
|
||||||
* [ipalocation](README-location.md)
|
* [ipalocation](README-location.md)
|
||||||
* [ipanetgroup](README-netgroup.md)
|
* [ipanetgroup](README-netgroup.md)
|
||||||
* [ipapermission](README-permission.md)
|
* [ipapermission](README-permission.md)
|
||||||
@@ -470,3 +472,8 @@ Modules in plugin/modules
|
|||||||
* [ipavault](README-vault.md)
|
* [ipavault](README-vault.md)
|
||||||
|
|
||||||
If you want to write a new module please read [writing a new module](plugins/modules/README.md).
|
If you want to write a new module please read [writing a new module](plugins/modules/README.md).
|
||||||
|
|
||||||
|
Inventory plugins in plugin/inventory
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
* [freeipa](README-inventory-plugin-freeipa.md)
|
||||||
|
|||||||
73
infra/azure/azure-pipelines.yml
Normal file
73
infra/azure/azure-pipelines.yml
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
---
|
||||||
|
trigger:
|
||||||
|
- master
|
||||||
|
|
||||||
|
pool:
|
||||||
|
vmImage: 'ubuntu-20.04'
|
||||||
|
|
||||||
|
variables:
|
||||||
|
ansible_version: "-core >=2.16,<2.17"
|
||||||
|
ansible_latest: "-core"
|
||||||
|
ansible_minimum: "-core <2.16"
|
||||||
|
distros: "fedora-latest,c9s,c10s,fedora-rawhide"
|
||||||
|
|
||||||
|
stages:
|
||||||
|
|
||||||
|
- stage: fedora_latest_ansible_latest
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/group_tests.yml
|
||||||
|
parameters:
|
||||||
|
build_number: $(Build.BuildNumber)
|
||||||
|
distro: fedora-latest
|
||||||
|
ansible_version: ${{ variables.ansible_latest }}
|
||||||
|
skip_git_test: true
|
||||||
|
|
||||||
|
- stage: fedora_latest_ansible_2_15
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/group_tests.yml
|
||||||
|
parameters:
|
||||||
|
build_number: $(Build.BuildNumber)
|
||||||
|
distro: fedora-latest
|
||||||
|
ansible_version: ${{ variables.ansbile_minimum }}
|
||||||
|
skip_git_test: true
|
||||||
|
|
||||||
|
# Supported distros
|
||||||
|
|
||||||
|
- ${{ each distro in split(variables.distros, ',') }}:
|
||||||
|
- stage: ${{ replace(distro, '-', '_') }}_ansible_2_16
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/group_tests.yml
|
||||||
|
parameters:
|
||||||
|
build_number: $(Build.BuildNumber)
|
||||||
|
distro: ${{ distro }}
|
||||||
|
ansible_version: ${{ variables.ansible_version }}
|
||||||
|
skip_git_test: true
|
||||||
|
test_galaxy: false
|
||||||
|
|
||||||
|
# Galaxy on Fedora
|
||||||
|
|
||||||
|
- stage: galaxy_fedora_latest_ansible_2_16
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/group_tests.yml
|
||||||
|
parameters:
|
||||||
|
build_number: $(Build.BuildNumber)
|
||||||
|
distro: fedora-latest
|
||||||
|
ansible_version: ${{ variables.ansible_version }}
|
||||||
|
skip_git_test: true
|
||||||
|
test_galaxy: true
|
||||||
|
|
||||||
|
# CentOS 8 Stream, latest supported Ansible version.
|
||||||
|
|
||||||
|
- stage: c8s_ansible_2_16
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/group_tests.yml
|
||||||
|
parameters:
|
||||||
|
build_number: $(Build.BuildNumber)
|
||||||
|
distro: c8s
|
||||||
|
ansible_version: "-core <2.17"
|
||||||
|
skip_git_test: true
|
||||||
35
infra/azure/build-containers.yml
Normal file
35
infra/azure/build-containers.yml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
---
|
||||||
|
schedules:
|
||||||
|
- cron: "0 0 * * 0"
|
||||||
|
displayName: Weekly Sunday midnight build
|
||||||
|
branches:
|
||||||
|
include:
|
||||||
|
- master
|
||||||
|
always: true
|
||||||
|
|
||||||
|
trigger: none
|
||||||
|
|
||||||
|
pool:
|
||||||
|
vmImage: 'ubuntu-24.04'
|
||||||
|
|
||||||
|
variables: { distros: "fedora-latest,fedora-rawhide,c9s,c10s" }
|
||||||
|
|
||||||
|
stages:
|
||||||
|
|
||||||
|
- ${{ each distro in split(variables.distros, ',') }}:
|
||||||
|
- stage: build_${{ join('_', split(distro, '-')) }}
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/build_container.yml
|
||||||
|
parameters:
|
||||||
|
distro: ${{ distro }}
|
||||||
|
|
||||||
|
# Special case for CentOS 8 Stream
|
||||||
|
- stage: CentOS_8_Stream
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/build_container.yml
|
||||||
|
parameters:
|
||||||
|
distro: c8s
|
||||||
|
# ansible-core 2.17+ cannot be used to deploy on CentOS 8 Stream.
|
||||||
|
ansible_core_version: "<2.17"
|
||||||
79
infra/azure/nightly.yml
Normal file
79
infra/azure/nightly.yml
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
---
|
||||||
|
schedules:
|
||||||
|
- cron: "0 19 * * *"
|
||||||
|
displayName: Nightly Builds
|
||||||
|
branches:
|
||||||
|
include:
|
||||||
|
- master
|
||||||
|
always: true
|
||||||
|
|
||||||
|
trigger: none
|
||||||
|
|
||||||
|
pool:
|
||||||
|
vmImage: 'ubuntu-20.04'
|
||||||
|
|
||||||
|
variables:
|
||||||
|
# We need to have two sets, as c8s is not supported by all ansible versions
|
||||||
|
recent_distros: "fedora-latest,fedora-rawhide,c10s,c9s"
|
||||||
|
distros: "fedora-latest,fedora-rawhide,c10s,c9s,c8s"
|
||||||
|
ansible_latest: "-core"
|
||||||
|
ansible_minimum: "-core <2.16"
|
||||||
|
ansible_version: "-core >=2.16,<2.17"
|
||||||
|
|
||||||
|
stages:
|
||||||
|
|
||||||
|
# Minimum ansible
|
||||||
|
|
||||||
|
- ${{ each distro in split(variables.distros, ',') }}:
|
||||||
|
- stage: ${{ replace(distro, '-', '_') }}_ansible_2_15
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/group_tests.yml
|
||||||
|
parameters:
|
||||||
|
build_number: $(Build.BuildNumber)
|
||||||
|
distro: fedora-latest
|
||||||
|
ansible_version: ${{ variables.ansible_minimum }}
|
||||||
|
skip_git_test: true
|
||||||
|
test_galaxy: false
|
||||||
|
|
||||||
|
# Latest ansible
|
||||||
|
|
||||||
|
- ${{ each distro in split(variables.recent_distros, ',') }}:
|
||||||
|
- stage: ${{ replace(distro, '-', '_') }}_ansible_latest
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/group_tests.yml
|
||||||
|
parameters:
|
||||||
|
build_number: $(Build.BuildNumber)
|
||||||
|
distro: ${{ distro }}
|
||||||
|
ansible_version: ${{ variables.ansible_latest }}
|
||||||
|
skip_git_test: true
|
||||||
|
test_galaxy: false
|
||||||
|
|
||||||
|
# Selected ansible-core version
|
||||||
|
|
||||||
|
- ${{ each distro in split(variables.distros, ',') }}:
|
||||||
|
- stage: ${{ replace(distro, '-', '_') }}_ansible_2_16
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/group_tests.yml
|
||||||
|
parameters:
|
||||||
|
build_number: $(Build.BuildNumber)
|
||||||
|
distro: ${{ distro }}
|
||||||
|
ansible_version: ${{ variables.ansible_version }}
|
||||||
|
skip_git_test: true
|
||||||
|
test_galaxy: false
|
||||||
|
|
||||||
|
# Galaxy collection with selected ansible-core version
|
||||||
|
|
||||||
|
- ${{ each distro in split(variables.distros, ',') }}:
|
||||||
|
- stage: galaxy_${{ replace(distro, '-', '_') }}_asible_2_16
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/group_tests.yml
|
||||||
|
parameters:
|
||||||
|
build_number: $(Build.BuildNumber)
|
||||||
|
distro: ${{ distro }}
|
||||||
|
ansible_version: ${{ variables.ansible_version }}
|
||||||
|
skip_git_test: true
|
||||||
|
test_galaxy: true
|
||||||
39
infra/azure/pr-pipeline.yml
Normal file
39
infra/azure/pr-pipeline.yml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
trigger:
|
||||||
|
- master
|
||||||
|
|
||||||
|
pool:
|
||||||
|
vmImage: 'ubuntu-20.04'
|
||||||
|
|
||||||
|
variables:
|
||||||
|
distros: "fedora-latest,c10s,c9s,c8s,fedora-rawhide"
|
||||||
|
ansible_version: "-core >=2.15,<2.16"
|
||||||
|
|
||||||
|
stages:
|
||||||
|
|
||||||
|
# Test with repository in all distros
|
||||||
|
|
||||||
|
- ${{ each distro in split(variables.distros, ',') }}:
|
||||||
|
- stage: ${{ replace(distro, '-', '_') }}_ansible_2_16
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/run_tests.yml
|
||||||
|
parameters:
|
||||||
|
build_number: $(Build.BuildNumber)
|
||||||
|
distro: ${{ distro }}
|
||||||
|
ansible_version: ${{ variables.ansible_version }}
|
||||||
|
skip_git_test: false
|
||||||
|
test_galaxy: false
|
||||||
|
|
||||||
|
# Galaxy on Fedora
|
||||||
|
|
||||||
|
- stage: galaxy_fedora_latest_ansible_2_16
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/run_tests.yml
|
||||||
|
parameters:
|
||||||
|
build_number: $(Build.BuildNumber)
|
||||||
|
distro: fedora-latest
|
||||||
|
ansible_version: ${{ variables.ansible_version }}
|
||||||
|
skip_git_test: false
|
||||||
|
test_galaxy: true
|
||||||
@@ -23,8 +23,6 @@ def get_plugins_from_playbook(playbook):
|
|||||||
for tasks in task_block:
|
for tasks in task_block:
|
||||||
for task in tasks:
|
for task in tasks:
|
||||||
original_task = task
|
original_task = task
|
||||||
if "." in task:
|
|
||||||
task = task.split(".")[-1]
|
|
||||||
if task == "block":
|
if task == "block":
|
||||||
_result.update(get_tasks(tasks["block"]))
|
_result.update(get_tasks(tasks["block"]))
|
||||||
elif task in ["include_tasks", "import_tasks"
|
elif task in ["include_tasks", "import_tasks"
|
||||||
@@ -62,8 +60,7 @@ def get_plugins_from_playbook(playbook):
|
|||||||
return []
|
return []
|
||||||
except yaml.parser.ParserError: # If not a YAML/JSON file.
|
except yaml.parser.ParserError: # If not a YAML/JSON file.
|
||||||
return []
|
return []
|
||||||
else:
|
return data if data else []
|
||||||
return data if data else []
|
|
||||||
|
|
||||||
data = load_playbook(playbook)
|
data = load_playbook(playbook)
|
||||||
task_blocks = [t.get("tasks", []) if "tasks" in t else [] for t in data]
|
task_blocks = [t.get("tasks", []) if "tasks" in t else [] for t in data]
|
||||||
@@ -128,8 +125,16 @@ def parse_playbooks(test_module):
|
|||||||
"builtins.__import__", side_effect=import_mock
|
"builtins.__import__", side_effect=import_mock
|
||||||
):
|
):
|
||||||
# pylint: disable=no-value-for-parameter
|
# pylint: disable=no-value-for-parameter
|
||||||
loader = SourceFileLoader(playbook, source)
|
try:
|
||||||
loader.exec_module(types.ModuleType(loader.name))
|
loader = SourceFileLoader(playbook, source)
|
||||||
|
loader.exec_module(
|
||||||
|
types.ModuleType(loader.name)
|
||||||
|
)
|
||||||
|
except Exception: # pylint: disable=broad-except
|
||||||
|
# If import fails, we'll assume there's no
|
||||||
|
# plugin to be loaded. This is of little risk
|
||||||
|
# it is rare that a plugin includes another.
|
||||||
|
pass
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
candidates = [
|
candidates = [
|
||||||
f.split(".")[1:]
|
f.split(".")[1:]
|
||||||
@@ -154,7 +159,7 @@ def map_test_module_sources(base):
|
|||||||
"""Create a map of 'test-modules' to 'plugin-sources', from 'base'."""
|
"""Create a map of 'test-modules' to 'plugin-sources', from 'base'."""
|
||||||
# Find root directory of playbook tests.
|
# Find root directory of playbook tests.
|
||||||
script_dir = os.path.dirname(__file__)
|
script_dir = os.path.dirname(__file__)
|
||||||
test_root = os.path.realpath(os.path.join(script_dir, f"../{base}"))
|
test_root = os.path.realpath(os.path.join(script_dir, f"../../../{base}"))
|
||||||
# create modules:source_files map
|
# create modules:source_files map
|
||||||
_result = {}
|
_result = {}
|
||||||
for test_module in [d for d in os.scandir(test_root) if d.is_dir()]:
|
for test_module in [d for d in os.scandir(test_root) if d.is_dir()]:
|
||||||
@@ -165,7 +170,7 @@ def map_test_module_sources(base):
|
|||||||
|
|
||||||
|
|
||||||
def usage(err=0):
|
def usage(err=0):
|
||||||
print("filter_plugins.py [-h|--help] [-p|--pytest] PY_SRC...")
|
print("get_test_modules.py [-h|--help] [-p|--pytest] PY_SRC...")
|
||||||
print(
|
print(
|
||||||
"""
|
"""
|
||||||
Print a comma-separated list of modules that should be tested if
|
Print a comma-separated list of modules that should be tested if
|
||||||
67
infra/azure/scripts/set_test_modules
Normal file
67
infra/azure/scripts/set_test_modules
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
#!/bin/bash -eu
|
||||||
|
# This file shoud be source'd (. set_test_modules) rather than executed.
|
||||||
|
#
|
||||||
|
# Set SKIP_GIT_TEST="True" or use -a to prevent git modification comparison.
|
||||||
|
#
|
||||||
|
|
||||||
|
RED="\033[31;1m"
|
||||||
|
RST="\033[0m"
|
||||||
|
|
||||||
|
die() {
|
||||||
|
echo -e "${RED}${*}${RST}" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
BASEDIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")"
|
||||||
|
TOPDIR="$(readlink -f "${BASEDIR}/../../..")"
|
||||||
|
|
||||||
|
[ -n "$(command -v python3)" ] && python="$(command -v python3)" || python="$(command -v python2)"
|
||||||
|
|
||||||
|
pushd "${TOPDIR}" >/dev/null 2>&1 || die "Failed to change directory."
|
||||||
|
|
||||||
|
SKIP_GIT_TEST=${SKIP_GIT_TEST:-"False"}
|
||||||
|
|
||||||
|
while getopts ":a" opt
|
||||||
|
do
|
||||||
|
case "${opt}" in
|
||||||
|
a) SKIP_GIT_TEST="True" ;;
|
||||||
|
*) ;; # ignore other options
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
files_list=$(mktemp)
|
||||||
|
|
||||||
|
enabled_modules="None"
|
||||||
|
enabled_tests="None"
|
||||||
|
|
||||||
|
if [ "${SKIP_GIT_TEST}" != "True" ]
|
||||||
|
then
|
||||||
|
remote="$(basename "$(mktemp -u remote_XXXXXX)")"
|
||||||
|
git remote add "${remote}" https://github.com/freeipa/ansible-freeipa
|
||||||
|
git fetch --prune --no-tags --quiet "${remote}"
|
||||||
|
git diff "${remote}/master" --name-only > "${files_list}"
|
||||||
|
git remote remove "${remote}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2046
|
||||||
|
enabled_modules="$(${python} "${BASEDIR}/get_test_modules.py" $(cat "${files_list}"))"
|
||||||
|
[ -z "${enabled_modules}" ] && enabled_modules="None"
|
||||||
|
|
||||||
|
# Get individual tests that should be executed
|
||||||
|
mapfile -t tests < <(sed -n 's#.*/\(test_[^/]*\).yml#\1#p' "${files_list}" | tr -d " ")
|
||||||
|
[ ${#tests[@]} -gt 0 ] && enabled_tests=$(IFS=, ; echo "${tests[*]}")
|
||||||
|
[ -z "${enabled_tests}" ] && enabled_tests="None"
|
||||||
|
|
||||||
|
[ -n "${enabled_tests}" ] && IPA_ENABLED_TESTS="${enabled_tests},${IPA_ENABLED_TESTS}"
|
||||||
|
[ -n "${enabled_modules}" ] && IPA_ENABLED_MODULES="${enabled_modules},${IPA_ENABLED_MODULES}"
|
||||||
|
|
||||||
|
rm -f "${files_list}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get all modules that should have tests executed
|
||||||
|
|
||||||
|
export IPA_ENABLED_MODULES
|
||||||
|
export IPA_ENABLED_TESTS
|
||||||
|
|
||||||
|
echo "IPA_ENABLED_MODULES = [${IPA_ENABLED_MODULES}]"
|
||||||
|
echo "IPA_ENABLED_TESTS = [${IPA_ENABLED_TESTS}]"
|
||||||
|
|
||||||
|
popd >/dev/null 2>&1 || die "Failed to change back to original directory."
|
||||||
45
infra/azure/templates/build_container.yml
Normal file
45
infra/azure/templates/build_container.yml
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
parameters:
|
||||||
|
- name: distro
|
||||||
|
type: string
|
||||||
|
- name: python_version
|
||||||
|
type: string
|
||||||
|
default: 3.x
|
||||||
|
- name: ansible_core_version
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- job: BuildTestImage_${{ join('_', split(parameters.distro, '-')) }}
|
||||||
|
displayName: Build ${{ parameters.distro }} test container
|
||||||
|
steps:
|
||||||
|
- task: UsePythonVersion@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: '${{ parameters.python_version }}'
|
||||||
|
|
||||||
|
- script: python -m pip install --upgrade pip "ansible-core${{ parameters.ansible_core_version }}"
|
||||||
|
retryCountOnTaskFailure: 5
|
||||||
|
displayName: Install tools
|
||||||
|
|
||||||
|
- script: ansible-galaxy collection install containers.podman
|
||||||
|
displayName: Install Ansible Galaxy collections
|
||||||
|
|
||||||
|
- script: infra/image/build.sh -s ${{ parameters.distro }}
|
||||||
|
displayName: Build ${{ parameters.distro }} base image
|
||||||
|
env:
|
||||||
|
ANSIBLE_ROLES_PATH: "${PWD}/roles"
|
||||||
|
ANSIBLE_LIBRARY: "${PWD}/plugins/modules"
|
||||||
|
ANSIBLE_MODULE_UTILS: "${PWD}/plugins/module_utils"
|
||||||
|
|
||||||
|
- script: podman login -u="$QUAY_ROBOT_USERNAME" -p="$QUAY_ROBOT_TOKEN" quay.io
|
||||||
|
displayName: Registry login
|
||||||
|
env:
|
||||||
|
# Secrets needs to be mapped as env vars to work properly
|
||||||
|
QUAY_ROBOT_TOKEN: $(QUAY_ROBOT_TOKEN)
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
podman push quay.io/ansible-freeipa/upstream-tests:${{parameters.distro}}-base quay.io/ansible-freeipa/upstream-tests:${{ parameters.distro }}-base
|
||||||
|
displayName: Push base image
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
podman push quay.io/ansible-freeipa/upstream-tests:${{ parameters.distro }}-server quay.io/ansible-freeipa/upstream-tests:${{ parameters.distro }}-server
|
||||||
|
displayName: Push server image
|
||||||
30
infra/azure/templates/group_tests.yml
Normal file
30
infra/azure/templates/group_tests.yml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
parameters:
|
||||||
|
- name: distro
|
||||||
|
type: string
|
||||||
|
default: fedora-latest
|
||||||
|
- name: build_number
|
||||||
|
type: string
|
||||||
|
- name: ansible_version
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
- name: skip_git_test
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
- name: test_galaxy
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
- ${{ each group in split('1,2,3', ',') }}:
|
||||||
|
- template: run_tests.yml
|
||||||
|
parameters:
|
||||||
|
group_number: ${{ group }}
|
||||||
|
number_of_groups: 3
|
||||||
|
build_number: ${{ parameters.build_number }}
|
||||||
|
distro: ${{ parameters.distro }}
|
||||||
|
ansible_version: ${{ parameters.ansible_version }}
|
||||||
|
python_version: '< 3.12'
|
||||||
|
skip_git_test: ${{ parameters.skip_git_test }}
|
||||||
|
test_galaxy: ${{ parameters.test_galaxy }}
|
||||||
30
infra/azure/templates/prepare_environment.yaml
Normal file
30
infra/azure/templates/prepare_environment.yaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
parameters:
|
||||||
|
- name: distro
|
||||||
|
type: string
|
||||||
|
default: fedora-latest
|
||||||
|
- name: ansible_version
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
- name: python_version
|
||||||
|
type: string
|
||||||
|
default: 3.x
|
||||||
|
- name: build_number
|
||||||
|
type: string
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- task: UsePythonVersion@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: '${{ parameters.python_version }}'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
pip install "ansible${{ parameters.ansible_version }}" -r requirements-tests.txt
|
||||||
|
retryCountOnTaskFailure: 5
|
||||||
|
displayName: Install test dependencies
|
||||||
|
|
||||||
|
- script: ansible-galaxy collection install -r requirements-podman.yml
|
||||||
|
retryCountOnTaskFailure: 5
|
||||||
|
displayName: Install Ansible collections
|
||||||
|
|
||||||
|
- script: infra/image/start.sh ${{ parameters.distro }}-server
|
||||||
|
displayName: Setup target container for ${{ parameters.distro }}
|
||||||
98
infra/azure/templates/run_tests.yml
Normal file
98
infra/azure/templates/run_tests.yml
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
---
|
||||||
|
parameters:
|
||||||
|
- name: group_number
|
||||||
|
type: number
|
||||||
|
default: 1
|
||||||
|
- name: number_of_groups
|
||||||
|
type: number
|
||||||
|
default: 1
|
||||||
|
- name: distro
|
||||||
|
type: string
|
||||||
|
default: fedora-latest
|
||||||
|
- name: ansible_version
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
- name: python_version
|
||||||
|
type: string
|
||||||
|
default: 3.x
|
||||||
|
- name: build_number
|
||||||
|
type: string
|
||||||
|
- name: skip_git_test
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
- name: test_type
|
||||||
|
type: string
|
||||||
|
default: "playbook"
|
||||||
|
- name: test_galaxy
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- job: Test_Group${{ parameters.group_number }}
|
||||||
|
displayName: Run playbook tests ${{ parameters.distro }} (${{ parameters.group_number }}/${{ parameters.number_of_groups }})
|
||||||
|
timeoutInMinutes: 360
|
||||||
|
variables:
|
||||||
|
- template: variables.yaml
|
||||||
|
- template: variables_${{ parameters.distro }}.yaml
|
||||||
|
steps:
|
||||||
|
- template: prepare_environment.yaml
|
||||||
|
parameters:
|
||||||
|
build_number: ${{ parameters.build_number }}
|
||||||
|
distro: ${{ parameters.distro }}
|
||||||
|
ansible_version: ${{ parameters.ansible_version }}
|
||||||
|
python_version: ${{ parameters.python_version }}
|
||||||
|
|
||||||
|
- bash: echo "##vso[task.setvariable variable=TOPDIR]${PWD}"
|
||||||
|
displayName: Set repo rootdir
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
. "${TOPDIR}/infra/azure/scripts/set_test_modules"
|
||||||
|
python3 utils/check_test_configuration.py ${{ parameters.distro }}
|
||||||
|
displayName: Check test configuration
|
||||||
|
env:
|
||||||
|
SKIP_GIT_TEST: ${{ parameters.skip_git_test }}
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
git fetch --unshallow
|
||||||
|
utils/build-galaxy-release.sh -i
|
||||||
|
retryCountOnTaskFailure: 5
|
||||||
|
displayName: Build Galaxy release
|
||||||
|
condition: ${{ parameters.test_galaxy }}
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
echo "PWD: ${PWD}"
|
||||||
|
echo "TOPDIR: ${TOPDIR}"
|
||||||
|
echo "ROLES: ${ANSIBLE_ROLES_PATH}"
|
||||||
|
echo "LIBRARY: ${ANSIBLE_LIBRARY}"
|
||||||
|
echo "MODULE_UTILS: ${ANSIBLE_MODULE_UTILS}"
|
||||||
|
. "${TOPDIR}/infra/azure/scripts/set_test_modules"
|
||||||
|
[ "${{ parameters.test_galaxy }}" == "True" ] && cd ~/.ansible/collections/ansible_collections/freeipa/ansible_freeipa
|
||||||
|
pytest \
|
||||||
|
-m "${{ parameters.test_type }}" \
|
||||||
|
--verbose \
|
||||||
|
--color=yes \
|
||||||
|
--splits=${{ parameters.number_of_groups }} \
|
||||||
|
--group=${{ parameters.group_number }} \
|
||||||
|
--randomly-seed=$(date "+%Y%m%d") \
|
||||||
|
--suppress-no-test-exit-code \
|
||||||
|
--junit-xml=TEST-results-pr-check.xml
|
||||||
|
displayName: Run playbook tests
|
||||||
|
env:
|
||||||
|
SKIP_GIT_TEST: ${{ parameters.skip_git_test }}
|
||||||
|
${{ if not(parameters.test_galaxy) }}:
|
||||||
|
ANSIBLE_ROLES_PATH: "${PWD}/roles"
|
||||||
|
ANSIBLE_LIBRARY: "${PWD}/plugins"
|
||||||
|
ANSIBLE_MODULE_UTILS: "${PWD}/plugins/module_utils"
|
||||||
|
IPA_SERVER_HOST: ansible-freeipa-tests
|
||||||
|
RUN_TESTS_IN_DOCKER: podman
|
||||||
|
IPA_DISABLED_MODULES: ${{ variables.ipa_disabled_modules }}
|
||||||
|
IPA_DISABLED_TESTS: ${{ variables.ipa_disabled_tests }}
|
||||||
|
IPA_ENABLED_MODULES: ${{ variables.ipa_enabled_modules }}
|
||||||
|
IPA_ENABLED_TESTS: ${{ variables.ipa_enabled_tests }}
|
||||||
|
IPA_VERBOSITY: "-vvv"
|
||||||
|
|
||||||
|
- task: PublishTestResults@2
|
||||||
|
inputs:
|
||||||
|
mergeTestResults: true
|
||||||
|
testRunTitle: PlaybookTests-Build${{ parameters.build_number }}
|
||||||
|
condition: succeededOrFailed()
|
||||||
@@ -15,8 +15,9 @@
|
|||||||
#
|
#
|
||||||
---
|
---
|
||||||
variables:
|
variables:
|
||||||
empty: true
|
# empty: true
|
||||||
# ipa_enabled_modules: >-
|
# ipa_enabled_modules: >-
|
||||||
# ipa_enabled_tests: >-
|
# ipa_enabled_tests: >-
|
||||||
# ipa_disabled_modules: >-
|
ipa_disabled_modules: >-
|
||||||
|
config
|
||||||
# ipa_disabled_tests: >-
|
# ipa_disabled_tests: >-
|
||||||
21
infra/azure/templates/variables_c9s.yaml
Normal file
21
infra/azure/templates/variables_c9s.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#
|
||||||
|
# Variables must be defined as comma separated lists.
|
||||||
|
# For easier management of items to enable/disable,
|
||||||
|
# use one test/module on each line, followed by a comma.
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
#
|
||||||
|
# ipa_disabled_modules: >-
|
||||||
|
# dnsconfig,
|
||||||
|
# group,
|
||||||
|
# hostgroup
|
||||||
|
#
|
||||||
|
# If no variables are set, set "empty: true" as at least
|
||||||
|
# one item is needed in the set.
|
||||||
|
---
|
||||||
|
variables:
|
||||||
|
empty: true
|
||||||
|
# ipa_enabled_modules: >-
|
||||||
|
# ipa_enabled_tests: >-
|
||||||
|
# ipa_disabled_modules: >-
|
||||||
|
# ipa_disabled_tests: >-
|
||||||
15
infra/image/build-inventory
Normal file
15
infra/image/build-inventory
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[ipaserver]
|
||||||
|
ansible-freeipa-image-builder ansible_connection=podman
|
||||||
|
|
||||||
|
[ipaserver:vars]
|
||||||
|
ipaadmin_password=SomeADMINpassword
|
||||||
|
ipadm_password=SomeDMpassword
|
||||||
|
ipaserver_domain=test.local
|
||||||
|
ipaserver_realm=TEST.LOCAL
|
||||||
|
ipaserver_setup_dns=true
|
||||||
|
ipaserver_auto_forwarders=true
|
||||||
|
ipaserver_no_dnssec_validation=true
|
||||||
|
ipaserver_auto_reverse=true
|
||||||
|
ipaserver_setup_kra=true
|
||||||
|
ipaserver_setup_firewalld=false
|
||||||
|
ipaclient_no_ntp=true
|
||||||
137
infra/image/build.sh
Executable file
137
infra/image/build.sh
Executable file
@@ -0,0 +1,137 @@
|
|||||||
|
#!/bin/bash -eu
|
||||||
|
|
||||||
|
BASEDIR="$(readlink -f "$(dirname "$0")")"
|
||||||
|
TOPDIR="$(readlink -f "${BASEDIR}/../..")"
|
||||||
|
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
. "${BASEDIR}/shcontainer"
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
. "${TOPDIR}/utils/shfun"
|
||||||
|
|
||||||
|
valid_distro() {
|
||||||
|
find "${BASEDIR}/dockerfile" -type f -printf "%f\n" | tr "\n" " "
|
||||||
|
}
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
local prog="${0##*/}"
|
||||||
|
cat << EOF
|
||||||
|
usage: ${prog} [-h] [-n HOSTNAME] [-s] distro
|
||||||
|
${prog} build a container image to test ansible-freeipa.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
help() {
|
||||||
|
cat << EOF
|
||||||
|
positional arguments:
|
||||||
|
|
||||||
|
distro The base distro to build the test container.
|
||||||
|
Availble distros: $(valid_distro)
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
|
||||||
|
-n HOSTNAME Container hostname
|
||||||
|
-p Give extended privileges to the container
|
||||||
|
-s Deploy IPA server
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
name="ansible-freeipa-image-builder"
|
||||||
|
hostname="ipaserver.test.local"
|
||||||
|
cpus="2"
|
||||||
|
memory="3g"
|
||||||
|
quayname="quay.io/ansible-freeipa/upstream-tests"
|
||||||
|
deploy_server="N"
|
||||||
|
deploy_capabilities="SYS_ADMIN,SYSLOG"
|
||||||
|
capabilities=""
|
||||||
|
|
||||||
|
while getopts ":hn:s" option
|
||||||
|
do
|
||||||
|
case "${option}" in
|
||||||
|
h) help && exit 0 ;;
|
||||||
|
n) hostname="${OPTARG}" ;;
|
||||||
|
s) deploy_server="Y" ;;
|
||||||
|
*) die -u "Invalid option: ${option}" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
shift $((OPTIND - 1))
|
||||||
|
distro=${1:-}
|
||||||
|
|
||||||
|
[ -n "${distro}" ] || die "Distro needs to be given.\nUse one of: $(valid_distro)"
|
||||||
|
|
||||||
|
[ -f "${BASEDIR}/dockerfile/${distro}" ] \
|
||||||
|
|| die "${distro} is not a valid distro target.\nUse one of: $(valid_distro)"
|
||||||
|
|
||||||
|
container_check
|
||||||
|
|
||||||
|
if [ "${deploy_server}" == "Y" ]
|
||||||
|
then
|
||||||
|
capabilities="${deploy_capabilities}"
|
||||||
|
|
||||||
|
[ -n "$(command -v "ansible-playbook")" ] || die "ansible-playbook is required to install FreeIPA."
|
||||||
|
|
||||||
|
deploy_playbook="${TOPDIR}/playbooks/install-server.yml"
|
||||||
|
[ -f "${deploy_playbook}" ] || die "Can't find playbook '${deploy_playbook}'"
|
||||||
|
|
||||||
|
inventory_file="${BASEDIR}/build-inventory"
|
||||||
|
[ -f "${inventory_file}" ] || die "Can't find inventory '${inventory_file}'"
|
||||||
|
fi
|
||||||
|
|
||||||
|
container_state=$(container_get_state "${name}")
|
||||||
|
|
||||||
|
tag="${distro}-base"
|
||||||
|
server_tag="${distro}-server"
|
||||||
|
|
||||||
|
container_remove_image_if_exists "${tag}"
|
||||||
|
[ "${deploy_server}" == "Y" ] && \
|
||||||
|
container_remove_image_if_exists "${server_tag}"
|
||||||
|
|
||||||
|
container_build "${tag}" "${BASEDIR}/dockerfile/${distro}" "${BASEDIR}"
|
||||||
|
container_create "${name}" "${tag}" \
|
||||||
|
"hostname=${hostname}" \
|
||||||
|
"memory=${memory}" \
|
||||||
|
"cpus=${cpus}" \
|
||||||
|
"${capabilities:+capabilities=$capabilities}"
|
||||||
|
container_commit "${name}" "${quayname}:${tag}"
|
||||||
|
|
||||||
|
if [ "${deploy_server}" == "Y" ]
|
||||||
|
then
|
||||||
|
deployed=false
|
||||||
|
|
||||||
|
# Set path to ansible-freeipa roles
|
||||||
|
[ -z "${ANSIBLE_ROLES_PATH:-""}" ] && export ANSIBLE_ROLES_PATH="${TOPDIR}/roles"
|
||||||
|
|
||||||
|
# Install collection containers.podman if not available
|
||||||
|
if [ -z "$(ansible-galaxy collection list containers.podman)" ]
|
||||||
|
then
|
||||||
|
tmpdir="$(mktemp -d)"
|
||||||
|
export ANSIBLE_COLLECTIONS_PATH="${tmpdir}"
|
||||||
|
ansible-galaxy collection install -p "${tmpdir}" containers.podman
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ "${container_state}" != "running" ] && container_start "${name}"
|
||||||
|
|
||||||
|
container_wait_for_journald "${name}"
|
||||||
|
|
||||||
|
log info "= Deploying IPA ="
|
||||||
|
if ansible-playbook -u root -i "${inventory_file}" "${deploy_playbook}"
|
||||||
|
then
|
||||||
|
deployed=true
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
|
||||||
|
if $deployed; then
|
||||||
|
log info "= Enabling services ="
|
||||||
|
container_exec "${name}" systemctl enable fixnet
|
||||||
|
container_exec "${name}" systemctl enable fixipaip
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
container_stop "${name}"
|
||||||
|
|
||||||
|
$deployed || die "Deployment failed"
|
||||||
|
|
||||||
|
container_commit "${name}" "${quayname}:${server_tag}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
log info "= DONE: Image created. ="
|
||||||
39
infra/image/dockerfile/c10s
Normal file
39
infra/image/dockerfile/c10s
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
FROM quay.io/centos/centos:stream10
|
||||||
|
ENV container=podman
|
||||||
|
|
||||||
|
RUN rm -fv /var/cache/dnf/metadata_lock.pid; \
|
||||||
|
dnf makecache; \
|
||||||
|
dnf --assumeyes install \
|
||||||
|
/usr/bin/dnf-3 \
|
||||||
|
sudo \
|
||||||
|
bash \
|
||||||
|
systemd \
|
||||||
|
procps-ng \
|
||||||
|
iproute \
|
||||||
|
hostname; \
|
||||||
|
rm -rf /var/cache/dnf/;
|
||||||
|
|
||||||
|
RUN (cd /lib/systemd/system/; \
|
||||||
|
if [ -e dbus-broker.service ] && [ ! -e dbus.service ]; then \
|
||||||
|
ln -s dbus-broker.service dbus.service; \
|
||||||
|
fi \
|
||||||
|
)
|
||||||
|
COPY system-service/container-ipa.target /lib/systemd/system/
|
||||||
|
RUN systemctl set-default container-ipa.target
|
||||||
|
RUN (cd /etc/systemd/system/; \
|
||||||
|
rm -rf multi-user.target.wants \
|
||||||
|
&& mkdir container-ipa.target.wants \
|
||||||
|
&& ln -s container-ipa.target.wants multi-user.target.wants \
|
||||||
|
)
|
||||||
|
|
||||||
|
COPY system-service/fixnet.sh /root/
|
||||||
|
COPY system-service/fixipaip.sh /root/
|
||||||
|
COPY system-service/fixnet.service /etc/systemd/system/
|
||||||
|
COPY system-service/fixipaip.service /etc/systemd/system/
|
||||||
|
RUN chmod +x /root/fixnet.sh /root/fixipaip.sh
|
||||||
|
|
||||||
|
STOPSIGNAL RTMIN+3
|
||||||
|
|
||||||
|
VOLUME ["/sys/fs/cgroup"]
|
||||||
|
|
||||||
|
CMD ["/usr/sbin/init"]
|
||||||
43
infra/image/dockerfile/c8s
Normal file
43
infra/image/dockerfile/c8s
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
FROM quay.io/centos/centos:stream8
|
||||||
|
ENV container=podman
|
||||||
|
|
||||||
|
RUN rm -fv /var/cache/dnf/metadata_lock.pid; \
|
||||||
|
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo; \
|
||||||
|
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo; \
|
||||||
|
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo; \
|
||||||
|
dnf makecache; \
|
||||||
|
dnf --assumeyes install \
|
||||||
|
/usr/bin/dnf-3 \
|
||||||
|
sudo \
|
||||||
|
bash \
|
||||||
|
systemd \
|
||||||
|
procps-ng \
|
||||||
|
iproute; \
|
||||||
|
dnf clean all; \
|
||||||
|
rm -rf /var/cache/dnf/;
|
||||||
|
|
||||||
|
RUN (cd /lib/systemd/system/; \
|
||||||
|
if [ -e dbus-broker.service ] && [ ! -e dbus.service ]; then \
|
||||||
|
ln -s dbus-broker.service dbus.service; \
|
||||||
|
fi \
|
||||||
|
)
|
||||||
|
COPY system-service/container-ipa.target /lib/systemd/system/
|
||||||
|
RUN systemctl set-default container-ipa.target
|
||||||
|
RUN (cd /etc/systemd/system/; \
|
||||||
|
rm -rf multi-user.target.wants \
|
||||||
|
&& mkdir container-ipa.target.wants \
|
||||||
|
&& ln -s container-ipa.target.wants multi-user.target.wants \
|
||||||
|
)
|
||||||
|
|
||||||
|
COPY system-service/fixnet.sh /root/
|
||||||
|
COPY system-service/fixipaip.sh /root/
|
||||||
|
COPY system-service/fixnet.service /etc/systemd/system/
|
||||||
|
COPY system-service/fixipaip.service /etc/systemd/system/
|
||||||
|
RUN chmod +x /root/fixnet.sh /root/fixipaip.sh
|
||||||
|
|
||||||
|
STOPSIGNAL RTMIN+3
|
||||||
|
|
||||||
|
VOLUME ["/sys/fs/cgroup"]
|
||||||
|
|
||||||
|
CMD ["/usr/sbin/init"]
|
||||||
|
|
||||||
38
infra/image/dockerfile/c9s
Normal file
38
infra/image/dockerfile/c9s
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
FROM quay.io/centos/centos:stream9
|
||||||
|
ENV container=podman
|
||||||
|
|
||||||
|
RUN rm -fv /var/cache/dnf/metadata_lock.pid; \
|
||||||
|
dnf makecache; \
|
||||||
|
dnf --assumeyes install \
|
||||||
|
/usr/bin/dnf-3 \
|
||||||
|
sudo \
|
||||||
|
bash \
|
||||||
|
systemd \
|
||||||
|
procps-ng \
|
||||||
|
iproute; \
|
||||||
|
rm -rf /var/cache/dnf/;
|
||||||
|
|
||||||
|
RUN (cd /lib/systemd/system/; \
|
||||||
|
if [ -e dbus-broker.service ] && [ ! -e dbus.service ]; then \
|
||||||
|
ln -s dbus-broker.service dbus.service; \
|
||||||
|
fi \
|
||||||
|
)
|
||||||
|
COPY system-service/container-ipa.target /lib/systemd/system/
|
||||||
|
RUN systemctl set-default container-ipa.target
|
||||||
|
RUN (cd /etc/systemd/system/; \
|
||||||
|
rm -rf multi-user.target.wants \
|
||||||
|
&& mkdir container-ipa.target.wants \
|
||||||
|
&& ln -s container-ipa.target.wants multi-user.target.wants \
|
||||||
|
)
|
||||||
|
|
||||||
|
COPY system-service/fixnet.sh /root/
|
||||||
|
COPY system-service/fixipaip.sh /root/
|
||||||
|
COPY system-service/fixnet.service /etc/systemd/system/
|
||||||
|
COPY system-service/fixipaip.service /etc/systemd/system/
|
||||||
|
RUN chmod +x /root/fixnet.sh /root/fixipaip.sh
|
||||||
|
|
||||||
|
STOPSIGNAL RTMIN+3
|
||||||
|
|
||||||
|
VOLUME ["/sys/fs/cgroup"]
|
||||||
|
|
||||||
|
CMD ["/usr/sbin/init"]
|
||||||
41
infra/image/dockerfile/fedora-latest
Normal file
41
infra/image/dockerfile/fedora-latest
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
FROM fedora:latest
|
||||||
|
ENV container=podman
|
||||||
|
|
||||||
|
RUN rm -fv /var/cache/dnf/metadata_lock.pid; \
|
||||||
|
dnf makecache; \
|
||||||
|
dnf --assumeyes install \
|
||||||
|
/usr/bin/python3 \
|
||||||
|
/usr/bin/python3-config \
|
||||||
|
python3-libdnf5 \
|
||||||
|
sudo \
|
||||||
|
bash \
|
||||||
|
systemd \
|
||||||
|
procps-ng \
|
||||||
|
iproute; \
|
||||||
|
dnf clean all; \
|
||||||
|
rm -rf /var/cache/dnf/;
|
||||||
|
|
||||||
|
RUN (cd /lib/systemd/system/; \
|
||||||
|
if [ -e dbus-broker.service ] && [ ! -e dbus.service ]; then \
|
||||||
|
ln -s dbus-broker.service dbus.service; \
|
||||||
|
fi \
|
||||||
|
)
|
||||||
|
COPY system-service/container-ipa.target /lib/systemd/system/
|
||||||
|
RUN systemctl set-default container-ipa.target
|
||||||
|
RUN (cd /etc/systemd/system/; \
|
||||||
|
rm -rf multi-user.target.wants \
|
||||||
|
&& mkdir container-ipa.target.wants \
|
||||||
|
&& ln -s container-ipa.target.wants multi-user.target.wants \
|
||||||
|
)
|
||||||
|
|
||||||
|
COPY system-service/fixnet.sh /root/
|
||||||
|
COPY system-service/fixipaip.sh /root/
|
||||||
|
COPY system-service/fixnet.service /etc/systemd/system/
|
||||||
|
COPY system-service/fixipaip.service /etc/systemd/system/
|
||||||
|
RUN chmod +x /root/fixnet.sh /root/fixipaip.sh
|
||||||
|
|
||||||
|
STOPSIGNAL RTMIN+3
|
||||||
|
|
||||||
|
VOLUME ["/sys/fs/cgroup"]
|
||||||
|
|
||||||
|
CMD ["/usr/sbin/init"]
|
||||||
41
infra/image/dockerfile/fedora-rawhide
Normal file
41
infra/image/dockerfile/fedora-rawhide
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
FROM fedora:rawhide
|
||||||
|
ENV container=podman
|
||||||
|
|
||||||
|
RUN rm -fv /var/cache/dnf/metadata_lock.pid; \
|
||||||
|
dnf makecache; \
|
||||||
|
dnf --assumeyes install \
|
||||||
|
/usr/bin/python3 \
|
||||||
|
/usr/bin/python3-config \
|
||||||
|
python3-libdnf5 \
|
||||||
|
sudo \
|
||||||
|
bash \
|
||||||
|
systemd \
|
||||||
|
procps-ng \
|
||||||
|
iproute; \
|
||||||
|
dnf clean all; \
|
||||||
|
rm -rf /var/cache/dnf/;
|
||||||
|
|
||||||
|
RUN (cd /lib/systemd/system/; \
|
||||||
|
if [ -e dbus-broker.service ] && [ ! -e dbus.service ]; then \
|
||||||
|
ln -s dbus-broker.service dbus.service; \
|
||||||
|
fi \
|
||||||
|
)
|
||||||
|
COPY system-service/container-ipa.target /lib/systemd/system/
|
||||||
|
RUN systemctl set-default container-ipa.target
|
||||||
|
RUN (cd /etc/systemd/system/; \
|
||||||
|
rm -rf multi-user.target.wants \
|
||||||
|
&& mkdir container-ipa.target.wants \
|
||||||
|
&& ln -s container-ipa.target.wants multi-user.target.wants \
|
||||||
|
)
|
||||||
|
|
||||||
|
COPY system-service/fixnet.sh /root/
|
||||||
|
COPY system-service/fixipaip.sh /root/
|
||||||
|
COPY system-service/fixnet.service /etc/systemd/system/
|
||||||
|
COPY system-service/fixipaip.service /etc/systemd/system/
|
||||||
|
RUN chmod +x /root/fixnet.sh /root/fixipaip.sh
|
||||||
|
|
||||||
|
STOPSIGNAL RTMIN+3
|
||||||
|
|
||||||
|
VOLUME ["/sys/fs/cgroup"]
|
||||||
|
|
||||||
|
CMD ["/usr/sbin/init"]
|
||||||
6
infra/image/inventory
Normal file
6
infra/image/inventory
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[ipaserver]
|
||||||
|
ansible-freeipa-tests ansible_connection=podman
|
||||||
|
|
||||||
|
[ipaserver:vars]
|
||||||
|
ipaadmin_password=SomeADMINpassword
|
||||||
|
ipadm_password=SomeDMpassword
|
||||||
197
infra/image/shcontainer
Normal file
197
infra/image/shcontainer
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
#!/bin/bash -eu
|
||||||
|
# This file is meant to be source'd by other scripts
|
||||||
|
|
||||||
|
SCRIPTDIR="$(dirname -- "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||||
|
TOPDIR="$(readlink -f "${SCRIPTDIR}/../..")"
|
||||||
|
|
||||||
|
. "${TOPDIR}/utils/shfun"
|
||||||
|
|
||||||
|
container_create() {
|
||||||
|
local name=${1}
|
||||||
|
local image=${2}
|
||||||
|
shift 2
|
||||||
|
declare -a extra_opts=()
|
||||||
|
for opt in "$@"
|
||||||
|
do
|
||||||
|
[ -z "${opt}" ] && continue
|
||||||
|
case "${opt}" in
|
||||||
|
hostname=*) extra_opts+=("--${opt}") ;;
|
||||||
|
cpus=*) extra_opts+=("--${opt}") ;;
|
||||||
|
memory=*) extra_opts+=("--${opt}") ;;
|
||||||
|
capabilities=*) extra_opts+=("--cap-add=${opt##*=}") ;;
|
||||||
|
*) log error "container_create: Invalid option: ${opt}" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# ensure default values are set
|
||||||
|
[[ " ${extra_opts[*]} " =~ " --cpus=" ]] || extra_opts+=("--cpus=2")
|
||||||
|
[[ " ${extra_opts[*]} " =~ " --hostname=" ]] \
|
||||||
|
|| extra_opts+=("--hostname=ipaserver.test.local")
|
||||||
|
|
||||||
|
log info "= Creating ${name} ="
|
||||||
|
podman create \
|
||||||
|
--security-opt label=disable \
|
||||||
|
--network bridge:interface_name=eth0 \
|
||||||
|
--systemd true \
|
||||||
|
--name "${name}" \
|
||||||
|
--memory-swap -1 \
|
||||||
|
--no-hosts \
|
||||||
|
--replace \
|
||||||
|
"${extra_opts[@]}" \
|
||||||
|
"${image}"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
container_start() {
|
||||||
|
local name="${1}"
|
||||||
|
|
||||||
|
log info "= Starting ${name} ="
|
||||||
|
podman start "${name}"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
container_stop() {
|
||||||
|
local name="${1}"
|
||||||
|
|
||||||
|
log info "= Stopping ${name} ="
|
||||||
|
podman stop "${name}"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
container_wait_for_journald() {
|
||||||
|
local name=${1}
|
||||||
|
|
||||||
|
log info "= Waiting till systemd-journald is running ="
|
||||||
|
max=20
|
||||||
|
wait=2
|
||||||
|
count=0
|
||||||
|
while ! podman exec "${name}" ps -x | grep -q "systemd-journald"
|
||||||
|
do
|
||||||
|
if [ $count -ge $max ]; then
|
||||||
|
die "Timeout: systemd-journald is not starting up"
|
||||||
|
fi
|
||||||
|
count=$((count+1))
|
||||||
|
log info "Waiting ${wait} seconds .."
|
||||||
|
sleep ${wait}
|
||||||
|
done
|
||||||
|
log info "done"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
container_wait_up() {
|
||||||
|
local name="${1}"
|
||||||
|
|
||||||
|
log info "= Waiting till all services are started ="
|
||||||
|
max=20
|
||||||
|
wait=15
|
||||||
|
count=0
|
||||||
|
while podman exec "${name}" systemctl list-jobs | \
|
||||||
|
grep -qvi "no jobs running"
|
||||||
|
do
|
||||||
|
if [ $count -ge $max ]; then
|
||||||
|
die "Timeout: Services are not starting up"
|
||||||
|
fi
|
||||||
|
count=$((count+1))
|
||||||
|
log info "Waiting ${wait} seconds .."
|
||||||
|
sleep ${wait}
|
||||||
|
done
|
||||||
|
log info "done"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
container_build() {
|
||||||
|
local tag="${1}"
|
||||||
|
local file="${2}"
|
||||||
|
local dir="${3}"
|
||||||
|
|
||||||
|
log info "= Building ${tag} ="
|
||||||
|
podman build -t "${tag}" -f "${file}" "${dir}"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
container_commit() {
|
||||||
|
local name="${1}"
|
||||||
|
local image="${2}"
|
||||||
|
|
||||||
|
log info "= Committing \"${image}\" ="
|
||||||
|
podman commit "${name}" "${image}"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
container_exec() {
|
||||||
|
local name="${1}"
|
||||||
|
shift 1
|
||||||
|
|
||||||
|
# "@Q" is only needed for the log output, the exec command is properly
|
||||||
|
# working without also for args containing spaces.
|
||||||
|
log info "= Executing \"${*@Q}\" ="
|
||||||
|
podman exec -t "${name}" "${@}"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
container_remove_image_if_exists()
|
||||||
|
{
|
||||||
|
# In older (as in Ubuntu 22.04) podman versions,
|
||||||
|
# 'podman image rm --force' fails if the image
|
||||||
|
# does not exist.
|
||||||
|
local tag_to_remove="${1}"
|
||||||
|
|
||||||
|
if podman image exists "${tag_to_remove}"
|
||||||
|
then
|
||||||
|
log info "= Cleanup ${tag_to_remove} ="
|
||||||
|
podman image rm "${tag_to_remove}" --force
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
container_get_state()
|
||||||
|
{
|
||||||
|
local name="${1}"
|
||||||
|
|
||||||
|
state=$(podman ps -q --all --format "{{.State}}" --filter "name=${name}")
|
||||||
|
echo "${state}"
|
||||||
|
}
|
||||||
|
|
||||||
|
container_pull() {
|
||||||
|
local source="${1}"
|
||||||
|
|
||||||
|
image=$(podman pull "${source}")
|
||||||
|
echo "${image}"
|
||||||
|
}
|
||||||
|
|
||||||
|
container_image_list() {
|
||||||
|
local source="${1}"
|
||||||
|
|
||||||
|
# Append "$" for an exact match if the source does not end with ":" to
|
||||||
|
# search for the repo only.
|
||||||
|
if [[ ${source} != *: ]]; then
|
||||||
|
source="${source}$"
|
||||||
|
fi
|
||||||
|
image=$(podman image list --format "{{ .Repository }}:{{ .Tag }}" | \
|
||||||
|
grep "^${source}")
|
||||||
|
echo "${image}"
|
||||||
|
}
|
||||||
|
|
||||||
|
container_check() {
|
||||||
|
[ -n "$(command -v "podman")" ] || die "podman is required."
|
||||||
|
}
|
||||||
|
|
||||||
|
container_copy() {
|
||||||
|
local name="${1}"
|
||||||
|
local source="${2}"
|
||||||
|
local destination="${3}"
|
||||||
|
|
||||||
|
log info "= Copying ${source} to ${name}:${destination} ="
|
||||||
|
podman cp "${source}" "${name}:${destination}"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
container_fetch() {
|
||||||
|
local name="${1}"
|
||||||
|
local source="${2}"
|
||||||
|
local destination="${3}"
|
||||||
|
|
||||||
|
log info "= Copying ${name}:${source} to ${destination} ="
|
||||||
|
podman cp "${name}:${source}" "${destination}"
|
||||||
|
echo
|
||||||
|
}
|
||||||
95
infra/image/start.sh
Executable file
95
infra/image/start.sh
Executable file
@@ -0,0 +1,95 @@
|
|||||||
|
#!/bin/bash -eu
|
||||||
|
|
||||||
|
BASEDIR="$(readlink -f "$(dirname "$0")")"
|
||||||
|
TOPDIR="$(readlink -f "${BASEDIR}/../..")"
|
||||||
|
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
. "${BASEDIR}/shcontainer"
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
. "${TOPDIR}/utils/shfun"
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
local prog="${0##*/}"
|
||||||
|
cat << EOF
|
||||||
|
usage: ${prog} [-h] [-l] [-n HOSTNAME ] image
|
||||||
|
${prog} start a prebuilt ansible-freeipa test container image.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
help() {
|
||||||
|
cat << EOF
|
||||||
|
positional arguments:
|
||||||
|
|
||||||
|
image The image to start, leave empty to get list of images
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
|
||||||
|
-h Show this message
|
||||||
|
-l Try to use local image first, if not found download.
|
||||||
|
-n HOSTNAME Set container hostname
|
||||||
|
|
||||||
|
NOTE:
|
||||||
|
- The hostname must be the same as the hostname of the container
|
||||||
|
when FreeIPA was deployed. Use only if you built the image and
|
||||||
|
defined its hostname.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
list_images() {
|
||||||
|
local quay_api="https://quay.io/api/v1/repository/ansible-freeipa/upstream-tests/tag"
|
||||||
|
log info "Available images on quay:"
|
||||||
|
curl --silent -L "${quay_api}" | jq '.tags[]|.name' | tr -d '"'| sort | uniq | sed "s/.*/ &/"
|
||||||
|
echo
|
||||||
|
log info "Local images (use -l):"
|
||||||
|
local_image=$(container_image_list "${repo}:")
|
||||||
|
echo "${local_image}" | sed -e "s/.*://" | sed "s/.*/ &/"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
repo="quay.io/ansible-freeipa/upstream-tests"
|
||||||
|
name="ansible-freeipa-tests"
|
||||||
|
hostname="ipaserver.test.local"
|
||||||
|
try_local_first="N"
|
||||||
|
|
||||||
|
while getopts ":hln:" option
|
||||||
|
do
|
||||||
|
case "${option}" in
|
||||||
|
h) help && exit 0 ;;
|
||||||
|
l) try_local_first="Y" ;;
|
||||||
|
n) hostname="${OPTARG}" ;;
|
||||||
|
*) die -u "Invalid option: ${option}" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
shift $((OPTIND - 1))
|
||||||
|
image=${1:-}
|
||||||
|
|
||||||
|
container_check
|
||||||
|
|
||||||
|
if [ -z "${image}" ]; then
|
||||||
|
list_images
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
local_image=
|
||||||
|
if [ "${try_local_first}" == "Y" ]; then
|
||||||
|
log info "= Trying to use local image first ="
|
||||||
|
local_image=$(container_image_list "${repo}:${image}")
|
||||||
|
[ -n "${local_image}" ] && log info "Found ${local_image}"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
if [ -z "${local_image}" ]; then
|
||||||
|
log info "= Downloading from quay ="
|
||||||
|
local_image=$(container_pull "${repo}:${image}")
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -z "${local_image}" ] && die "Image '${image}' is not valid"
|
||||||
|
|
||||||
|
container_create "${name}" "${local_image}" "hostname=${hostname}"
|
||||||
|
container_start "${name}"
|
||||||
|
container_wait_for_journald "${name}"
|
||||||
|
container_wait_up "${name}"
|
||||||
|
|
||||||
|
log info "Container ${name} is ready to be used."
|
||||||
6
infra/image/system-service/container-ipa.target
Normal file
6
infra/image/system-service/container-ipa.target
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Minimal target for containerized FreeIPA server
|
||||||
|
DefaultDependencies=false
|
||||||
|
AllowIsolate=yes
|
||||||
|
Requires=systemd-tmpfiles-setup.service systemd-journald.service dbus.service
|
||||||
|
After=systemd-tmpfiles-setup.service systemd-journald.service dbus.service
|
||||||
12
infra/image/system-service/fixipaip.service
Normal file
12
infra/image/system-service/fixipaip.service
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Fix IPA server IP in IPA Server
|
||||||
|
After=ipa.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/root/fixipaip.sh
|
||||||
|
StandardOutput=journal
|
||||||
|
StandardError=journal
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
||||||
85
infra/image/system-service/fixipaip.sh
Executable file
85
infra/image/system-service/fixipaip.sh
Executable file
@@ -0,0 +1,85 @@
|
|||||||
|
#!/bin/bash -eu
|
||||||
|
|
||||||
|
function valid_fqdn()
|
||||||
|
{
|
||||||
|
local name="${1}"
|
||||||
|
|
||||||
|
[[ "${name}" =~ [[:space:]] ]] && return 1
|
||||||
|
[[ "${name}" =~ \. ]] || return 1
|
||||||
|
[[ "${name}" =~ \.\. ]] && return 1
|
||||||
|
for i in ${name//./ }; do
|
||||||
|
[[ "${i}" =~ ^[a-z0-9_/]+$ ]] || return 1
|
||||||
|
done
|
||||||
|
[[ "${name}" == "localhost.localdomain" ]] && return 1
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function valid_ipv4()
|
||||||
|
{
|
||||||
|
local ip="${1}"
|
||||||
|
local rematch="^([0-9]{1,3}\.){3}[0-9]{1,3}$"
|
||||||
|
|
||||||
|
[[ "${ip}" =~ ${rematch} ]] || return 1
|
||||||
|
for i in ${ip//./ }; do
|
||||||
|
[[ ${i} -le 255 ]] || return 1
|
||||||
|
done
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
HOSTNAME=$(hostname)
|
||||||
|
IP=$(hostname -I | cut -d " " -f 1)
|
||||||
|
export KRB5CCNAME=ansible_freeipa_cache
|
||||||
|
|
||||||
|
if [ -z "${HOSTNAME}" ] || ! valid_fqdn "${HOSTNAME}" ; then
|
||||||
|
echo "ERROR: Got invalid hostname: '${HOSTNAME}'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "${IP}" ] || ! valid_ipv4 "${IP}" ; then
|
||||||
|
echo "ERROR: Got invalid IPv4 address: '${IP}'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
PTR=$(echo "${IP}" | awk -F"." '{print $4}')
|
||||||
|
if [ -z "${PTR}" ] || [ -n "${PTR//[0-9]}" ]; then
|
||||||
|
echo "ERROR: Failed to get PTR from IPv4 address: '${PTR}'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
FORWARDER=$(grep -s -m 1 ^nameserver /etc/resolv.conf.fixnet | cut -d" " -f 2)
|
||||||
|
if [ -z "${FORWARDER}" ] || [ "${FORWARDER}" == "127.0.0.1" ]; then
|
||||||
|
FORWARDER="8.8.8.8"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Fix IPA:"
|
||||||
|
echo " HOSTNAME: '${HOSTNAME}'"
|
||||||
|
echo " IP: '${IP}'"
|
||||||
|
echo " PTR: '${PTR}'"
|
||||||
|
echo " FORWARDER: '${FORWARDER}'"
|
||||||
|
|
||||||
|
ZONES=$(ipa -e in_server=true dnszone-find --name-from-ip="${HOSTNAME}." \
|
||||||
|
--raw --pkey-only | grep "idnsname:" | awk -F": " '{print $2}')
|
||||||
|
for zone in ${ZONES}; do
|
||||||
|
echo
|
||||||
|
if [[ "${zone}" == *".in-addr.arpa."* ]]; then
|
||||||
|
echo "Fixing reverse zone ${zone}:"
|
||||||
|
OLD_PTR=$(ipa -e in_server=true dnsrecord-find "${zone}" \
|
||||||
|
--ptr-rec="${HOSTNAME}." --raw | grep "idnsname:" | \
|
||||||
|
awk -F": " '{print $2}')
|
||||||
|
if [ -z "${OLD_PTR}" ] || [ -n "${OLD_PTR//[0-9]}" ]; then
|
||||||
|
echo "ERROR: Failed to get old PTR from '${zone}': '${OLD_PTR}'"
|
||||||
|
else
|
||||||
|
ipa -e in_server=true dnsrecord-mod "${zone}" "${OLD_PTR}" \
|
||||||
|
--ptr-rec="${HOSTNAME}." --rename="${PTR}" || true
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Fixing forward zone ${zone}:"
|
||||||
|
ipa -e in_server=true dnsrecord-mod test.local "${HOSTNAME%%.*}" \
|
||||||
|
--a-rec="$IP" || true
|
||||||
|
ipa -e in_server=true dnsrecord-mod test.local ipa-ca \
|
||||||
|
--a-rec="$IP" || true
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
ipa -e in_server=true dnsserver-mod "${HOSTNAME}" \
|
||||||
|
--forwarder="${FORWARDER}" || true
|
||||||
|
|
||||||
|
exit 0
|
||||||
14
infra/image/system-service/fixnet.service
Normal file
14
infra/image/system-service/fixnet.service
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Fix server IP in IPA Server
|
||||||
|
Wants=network.target
|
||||||
|
After=network.target
|
||||||
|
Before=ipa.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/root/fixnet.sh
|
||||||
|
StandardOutput=journal
|
||||||
|
StandardError=journal
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=ipa.service
|
||||||
66
infra/image/system-service/fixnet.sh
Executable file
66
infra/image/system-service/fixnet.sh
Executable file
@@ -0,0 +1,66 @@
|
|||||||
|
#!/bin/bash -eu
|
||||||
|
|
||||||
|
function valid_fqdn()
|
||||||
|
{
|
||||||
|
local name="${1}"
|
||||||
|
|
||||||
|
[[ "${name}" =~ [[:space:]] ]] && return 1
|
||||||
|
[[ "${name}" =~ \. ]] || return 1
|
||||||
|
[[ "${name}" =~ \.\. ]] && return 1
|
||||||
|
for i in ${name//./ }; do
|
||||||
|
[[ "${i}" =~ ^[a-z0-9_/]+$ ]] || return 1
|
||||||
|
done
|
||||||
|
[[ "${name}" == "localhost.localdomain" ]] && return 1
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function valid_ipv4()
|
||||||
|
{
|
||||||
|
local ip="${1}"
|
||||||
|
local rematch="^([0-9]{1,3}\.){3}[0-9]{1,3}$"
|
||||||
|
|
||||||
|
[[ "${ip}" =~ ${rematch} ]] || return 1
|
||||||
|
for i in ${ip//./ }; do
|
||||||
|
[[ ${i} -le 255 ]] || return 1
|
||||||
|
done
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
HOSTNAME=$(hostname)
|
||||||
|
IP=$(hostname -I | cut -d " " -f 1)
|
||||||
|
|
||||||
|
if [ -z "${HOSTNAME}" ] || ! valid_fqdn "${HOSTNAME}" ; then
|
||||||
|
echo "ERROR: Failed to retrieve hostname."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "${IP}" ] || ! valid_ipv4 "${IP}" ; then
|
||||||
|
echo "ERROR: Got invalid IPv4 address: '${IP}'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Fix NET:"
|
||||||
|
echo " HOSTNAME: '${HOSTNAME}'"
|
||||||
|
echo " IP: '${IP}'"
|
||||||
|
echo
|
||||||
|
|
||||||
|
if grep -qE "^[^(#\s*)][0-9\.]+\s$HOSTNAME(\s|$)" /etc/hosts
|
||||||
|
then
|
||||||
|
sed -i.bak -e "s/.*${HOSTNAME}/${IP}\t${HOSTNAME}/" /etc/hosts
|
||||||
|
else
|
||||||
|
echo -e "$IP\t${HOSTNAME} ${HOSTNAME%%.*}" >> /etc/hosts
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp -a /etc/resolv.conf /etc/resolv.conf.fixnet
|
||||||
|
cat > /etc/resolv.conf <<EOF
|
||||||
|
search ${HOSTNAME#*.}
|
||||||
|
nameserver 127.0.0.1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "/etc/hosts:"
|
||||||
|
cat "/etc/hosts"
|
||||||
|
echo
|
||||||
|
echo "/etc/resolv.conf:"
|
||||||
|
cat "/etc/resolv.conf"
|
||||||
|
|
||||||
|
exit 0
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
---
|
---
|
||||||
requires_ansible: ">=2.9"
|
requires_ansible: ">=2.14.0"
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
FROM quay.io/centos/centos:stream8
|
|
||||||
ENV container=docker
|
|
||||||
|
|
||||||
RUN rm -fv /var/cache/dnf/metadata_lock.pid; \
|
|
||||||
dnf makecache; \
|
|
||||||
dnf --assumeyes install \
|
|
||||||
/usr/bin/python3 \
|
|
||||||
/usr/bin/python3-config \
|
|
||||||
/usr/bin/dnf-3 \
|
|
||||||
sudo \
|
|
||||||
bash \
|
|
||||||
systemd \
|
|
||||||
procps-ng \
|
|
||||||
iproute && \
|
|
||||||
dnf clean all; \
|
|
||||||
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
|
|
||||||
rm -f /lib/systemd/system/multi-user.target.wants/*;\
|
|
||||||
rm -f /etc/systemd/system/*.wants/*;\
|
|
||||||
rm -f /lib/systemd/system/local-fs.target.wants/*; \
|
|
||||||
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
|
|
||||||
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
|
|
||||||
rm -f /lib/systemd/system/basic.target.wants/*;\
|
|
||||||
rm -f /lib/systemd/system/anaconda.target.wants/*; \
|
|
||||||
rm -rf /var/cache/dnf/;
|
|
||||||
|
|
||||||
STOPSIGNAL RTMIN+3
|
|
||||||
|
|
||||||
VOLUME ["/sys/fs/cgroup"]
|
|
||||||
|
|
||||||
CMD ["/usr/sbin/init"]
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
platforms:
|
|
||||||
- name: c8s-build
|
|
||||||
image: "quay.io/centos/centos:stream8"
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
hostname: ipaserver.test.local
|
|
||||||
dns_servers:
|
|
||||||
- 8.8.8.8
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
command: /usr/sbin/init
|
|
||||||
privileged: true
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
prepare: ../resources/playbooks/prepare-build.yml
|
|
||||||
prerun: false
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
platforms:
|
|
||||||
- name: c8s
|
|
||||||
image: quay.io/ansible-freeipa/upstream-tests:c8s
|
|
||||||
pre_build_image: true
|
|
||||||
hostname: ipaserver.test.local
|
|
||||||
dns_servers:
|
|
||||||
- 127.0.0.1
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
command: /usr/sbin/init
|
|
||||||
privileged: true
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
prepare: ../resources/playbooks/prepare.yml
|
|
||||||
prerun: false
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
FROM quay.io/centos/centos:stream9
|
|
||||||
ENV container=docker
|
|
||||||
|
|
||||||
RUN rm -fv /var/cache/dnf/metadata_lock.pid; \
|
|
||||||
dnf makecache; \
|
|
||||||
dnf --assumeyes install \
|
|
||||||
/usr/bin/python3 \
|
|
||||||
/usr/bin/dnf-3 \
|
|
||||||
sudo \
|
|
||||||
bash \
|
|
||||||
systemd \
|
|
||||||
procps-ng \
|
|
||||||
iproute && \
|
|
||||||
dnf clean all; \
|
|
||||||
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
|
|
||||||
rm -f /lib/systemd/system/multi-user.target.wants/*;\
|
|
||||||
rm -f /etc/systemd/system/*.wants/*;\
|
|
||||||
rm -f /lib/systemd/system/local-fs.target.wants/*; \
|
|
||||||
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
|
|
||||||
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
|
|
||||||
rm -f /lib/systemd/system/basic.target.wants/*;\
|
|
||||||
rm -f /lib/systemd/system/anaconda.target.wants/*; \
|
|
||||||
rm -rf /var/cache/dnf/;
|
|
||||||
|
|
||||||
STOPSIGNAL RTMIN+3
|
|
||||||
|
|
||||||
VOLUME ["/sys/fs/cgroup"]
|
|
||||||
|
|
||||||
CMD ["/usr/sbin/init"]
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
platforms:
|
|
||||||
- name: c9s-build
|
|
||||||
image: "quay.io/centos/centos:stream9"
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
hostname: ipaserver.test.local
|
|
||||||
dns_servers:
|
|
||||||
- 8.8.8.8
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
command: /usr/sbin/init
|
|
||||||
privileged: true
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
prepare: ../resources/playbooks/prepare-build.yml
|
|
||||||
prerun: false
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
platforms:
|
|
||||||
- name: c9s
|
|
||||||
image: quay.io/ansible-freeipa/upstream-tests:c9s
|
|
||||||
pre_build_image: true
|
|
||||||
hostname: ipaserver.test.local
|
|
||||||
dns_servers:
|
|
||||||
- 127.0.0.1
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
command: /usr/sbin/init
|
|
||||||
privileged: true
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
prepare: ../resources/playbooks/prepare.yml
|
|
||||||
prerun: false
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
platforms:
|
|
||||||
- name: centos-7-build
|
|
||||||
image: centos/systemd
|
|
||||||
pre_build_image: true
|
|
||||||
hostname: ipaserver.test.local
|
|
||||||
dns_servers:
|
|
||||||
- 8.8.8.8
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
command: /usr/sbin/init
|
|
||||||
privileged: true
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
prepare: ../resources/playbooks/prepare-build.yml
|
|
||||||
prerun: false
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
platforms:
|
|
||||||
- name: centos-7
|
|
||||||
image: quay.io/ansible-freeipa/upstream-tests:centos-7
|
|
||||||
pre_build_image: true
|
|
||||||
hostname: ipaserver.test.local
|
|
||||||
dns_servers:
|
|
||||||
- 127.0.0.1
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
command: /usr/sbin/init
|
|
||||||
privileged: true
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
prepare: ../resources/playbooks/prepare.yml
|
|
||||||
prerun: false
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
fedora-latest
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
FROM fedora:latest
|
|
||||||
ENV container=docker
|
|
||||||
|
|
||||||
RUN rm -fv /var/cache/dnf/metadata_lock.pid; \
|
|
||||||
dnf makecache; \
|
|
||||||
dnf --assumeyes install \
|
|
||||||
/usr/bin/python3 \
|
|
||||||
/usr/bin/python3-config \
|
|
||||||
/usr/bin/dnf-3 \
|
|
||||||
sudo \
|
|
||||||
bash \
|
|
||||||
systemd \
|
|
||||||
procps-ng \
|
|
||||||
iproute && \
|
|
||||||
dnf clean all; \
|
|
||||||
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
|
|
||||||
rm -f /lib/systemd/system/multi-user.target.wants/*;\
|
|
||||||
rm -f /etc/systemd/system/*.wants/*;\
|
|
||||||
rm -f /lib/systemd/system/local-fs.target.wants/*; \
|
|
||||||
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
|
|
||||||
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
|
|
||||||
rm -f /lib/systemd/system/basic.target.wants/*;\
|
|
||||||
rm -f /lib/systemd/system/anaconda.target.wants/*; \
|
|
||||||
rm -rf /var/cache/dnf/;
|
|
||||||
|
|
||||||
STOPSIGNAL RTMIN+3
|
|
||||||
|
|
||||||
VOLUME ["/sys/fs/cgroup"]
|
|
||||||
|
|
||||||
CMD ["/usr/sbin/init"]
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
platforms:
|
|
||||||
- name: fedora-latest-build
|
|
||||||
image: "fedora:latest"
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
hostname: ipaserver.test.local
|
|
||||||
dns_servers:
|
|
||||||
- 8.8.8.8
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
command: /usr/sbin/init
|
|
||||||
privileged: true
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
prepare: ../resources/playbooks/prepare-build.yml
|
|
||||||
prerun: false
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
platforms:
|
|
||||||
- name: fedora-latest
|
|
||||||
image: quay.io/ansible-freeipa/upstream-tests:fedora-latest
|
|
||||||
pre_build_image: true
|
|
||||||
hostname: ipaserver.test.local
|
|
||||||
dns_servers:
|
|
||||||
- 127.0.0.1
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
command: /usr/sbin/init
|
|
||||||
privileged: true
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
prepare: ../resources/playbooks/prepare.yml
|
|
||||||
prerun: false
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
FROM fedora:rawhide
|
|
||||||
ENV container=docker
|
|
||||||
|
|
||||||
RUN rm -fv /var/cache/dnf/metadata_lock.pid; \
|
|
||||||
dnf makecache; \
|
|
||||||
dnf --assumeyes install \
|
|
||||||
/usr/bin/python3 \
|
|
||||||
/usr/bin/python3-config \
|
|
||||||
/usr/bin/dnf-3 \
|
|
||||||
sudo \
|
|
||||||
bash \
|
|
||||||
systemd \
|
|
||||||
procps-ng \
|
|
||||||
iproute && \
|
|
||||||
dnf clean all; \
|
|
||||||
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
|
|
||||||
rm -f /lib/systemd/system/multi-user.target.wants/*;\
|
|
||||||
rm -f /etc/systemd/system/*.wants/*;\
|
|
||||||
rm -f /lib/systemd/system/local-fs.target.wants/*; \
|
|
||||||
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
|
|
||||||
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
|
|
||||||
rm -f /lib/systemd/system/basic.target.wants/*;\
|
|
||||||
rm -f /lib/systemd/system/anaconda.target.wants/*; \
|
|
||||||
rm -rf /var/cache/dnf/;
|
|
||||||
|
|
||||||
STOPSIGNAL RTMIN+3
|
|
||||||
|
|
||||||
VOLUME ["/sys/fs/cgroup"]
|
|
||||||
|
|
||||||
CMD ["/usr/sbin/init"]
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
platforms:
|
|
||||||
- name: fedora-rawhide-build
|
|
||||||
image: "fedora:rawhide"
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
hostname: ipaserver.test.local
|
|
||||||
dns_servers:
|
|
||||||
- 8.8.8.8
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
command: /usr/sbin/init
|
|
||||||
privileged: true
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
prepare: ../resources/playbooks/prepare-build.yml
|
|
||||||
prerun: false
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
driver:
|
|
||||||
name: docker
|
|
||||||
platforms:
|
|
||||||
- name: fedora-rawhide
|
|
||||||
image: quay.io/ansible-freeipa/upstream-tests:fedora-rawhide
|
|
||||||
pre_build_image: true
|
|
||||||
hostname: ipaserver.test.local
|
|
||||||
dns_servers:
|
|
||||||
- 127.0.0.1
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
command: /usr/sbin/init
|
|
||||||
privileged: true
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
playbooks:
|
|
||||||
prepare: ../resources/playbooks/prepare.yml
|
|
||||||
prerun: false
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../../../plugins/modules/
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../../../plugins/module_utils/
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user