Skip to content

Commit db38958

Browse files
authored
Merge pull request #965 from konstruktoid/env
adapt to molecule changes
2 parents 829bb64 + 489c098 commit db38958

10 files changed

+29
-21
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*suid.list
77
.ansible
88
.cache
9+
.env.yml
910
.scannerwork
1011
.sonar
1112
.tox

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ The [argument_specs.yml](meta/argument_specs.yml) file is used to generate the
10011001
documentation and defaults for this role, so please ensure that any changes
10021002
made to the role are also reflected in the `argument_specs.yml` file.
10031003

1004-
After making changes, run `bash genREADME.sh` to regenerate the defaults file,
1004+
After making changes, run `bash generate_doc_defaults.sh` to regenerate the defaults file,
10051005
README and other documentation files.
10061006

10071007
Last but not least, ensure that the role passes all tests by running

STRUCTURE.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
│   └── share
2222
│   └── dict
2323
│   └── passwords.list
24-
├── genDefault.py
25-
├── genREADME.sh
24+
├── generate_defaults.py
25+
├── generate_doc_defaults.sh
26+
├── generate_molecule_env.sh
2627
├── handlers
2728
│   └── main.yml
2829
├── meta
@@ -49,6 +50,7 @@
4950
├── postChecks.sh
5051
├── renovate.json
5152
├── requirements-dev.txt
53+
├── requirements-upstream.txt
5254
├── requirements.yml
5355
├── runTests.sh
5456
├── tasks
@@ -165,5 +167,5 @@
165167
│   └── test.yml
166168
└── tox.ini
167169

168-
40 directories, 122 files
170+
40 directories, 124 files
169171
```
File renamed without changes.

genREADME.sh renamed to generate_doc_defaults.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ The [argument_specs.yml](meta/argument_specs.yml) file is used to generate the
188188
documentation and defaults for this role, so please ensure that any changes
189189
made to the role are also reflected in the \`argument_specs.yml\` file.
190190
191-
After making changes, run \`bash genREADME.sh\` to regenerate the defaults file,
191+
After making changes, run \`bash generate_doc_defaults.sh\` to regenerate the defaults file,
192192
README and other documentation files.
193193
194194
Last but not least, ensure that the role passes all tests by running
@@ -251,7 +251,7 @@ echo '```'
251251

252252
aar-doc --output-template aar-doc_template.j2 "$(pwd)" markdown
253253

254-
python3 genDefault.py meta/argument_specs.yml > defaults/main.yml || exit 1
254+
python3 generate_defaults.py meta/argument_specs.yml > defaults/main.yml || exit 1
255255

256256
ansible-lint --fix . &>/dev/null
257257
ansible-lint --fix .

generate_molecule_env.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
PYTHON_LIB_PATH="$(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')"
6+
7+
echo "ANSIBLE_FILTER_PLUGINS: ${PYTHON_LIB_PATH}/molecule/provisioner/ansible/plugins/filter:${HOME}/.ansible/plugins/filter:/usr/share/ansible/plugins/filter
8+
ANSIBLE_LIBRARY: ${PYTHON_LIB_PATH}/molecule/provisioner/ansible/plugins/modules:${PYTHON_LIB_PATH}/molecule_plugins/vagrant/modules:${HOME}/.ansible/plugins/modules:/usr/share/ansible/plugins/modules"

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ aar-doc
22
ansible
33
ansible-lint
44
jmespath
5+
molecule
56
molecule-plugins[docker]
67
molecule-plugins[vagrant]
7-
molecule==25.1.0
88
passlib
99
tox

requirements-upstream.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
aar-doc
22
git+https://github.com/ansible-community/ansible-lint.git
3-
https://github.com/ansible/ansible/archive/devel.tar.gz
3+
git+https://github.com/ansible/ansible.git
4+
git+https://github.com/ansible/molecule.git
45
jmespath
56
molecule-plugins[docker]@git+https://github.com/ansible-community/molecule-plugins.git
67
molecule-plugins[vagrant]@git+https://github.com/ansible-community/molecule-plugins.git
7-
molecule==25.1.0
88
passlib
99
tox

tox.ini

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,45 +13,43 @@ skipsdist = true
1313
description = Run tests using molecule
1414
basepython = python3.12
1515
set_env =
16-
ANSIBLE_REMOTE_TMP="/var/tmp/${USER}/ansible"
17-
passenv = *
16+
PYTHON_LIB_PATH={envdir}/lib/{basepython}/site-packages
17+
ANSIBLE_REMOTE_TMP=/var/tmp/${USER}/ansible
18+
ANSIBLE_FILTER_PLUGINS={env:PYTHON_LIB_PATH}/molecule/provisioner/ansible/plugins/filter:${HOME}/.ansible/plugins/filter:/usr/share/ansible/plugins/filter
19+
ANSIBLE_LIBRARY={env:PYTHON_LIB_PATH}/molecule/provisioner/ansible/plugins/modules:${PYTHON_LIB_PATH}/molecule_plugins/vagrant/modules:${HOME}/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
1820
deps =
1921
-r requirements-dev.txt
2022
commands =
2123
ansible --version
2224
ansible-lint --version
25+
molecule --version
2326
ansible-galaxy install --force -r requirements.yml
2427
ansible-lint
2528
molecule test
2629

2730
[testenv:upstream]
2831
description = Run tests using molecule against upstream Ansible and ansible-lint
2932
deps =
30-
-r requirements-dev.txt
31-
git+https://github.com/ansible-community/ansible-lint.git
32-
https://github.com/ansible/ansible/archive/devel.tar.gz
33+
-r requirements-upstream.txt
3334

3435
[testenv:docker]
3536
description = Run tests using molecule with Docker driver
3637
commands =
3738
ansible --version
3839
ansible-lint --version
40+
molecule --version
3941
ansible-galaxy install --force -r requirements.yml
4042
ansible-lint
4143
molecule test -s docker
4244

4345
[testenv:docker-upstream]
4446
description = Run tests using molecule with Docker driver against upstream Ansible and ansible-lint
45-
set_env =
46-
ANSIBLE_ALLOW_BROKEN_CONDITIONALS=True
4747
deps =
48-
-r requirements-dev.txt
49-
git+https://github.com/ansible-community/ansible-lint.git
50-
https://github.com/ansible/ansible/archive/devel.tar.gz
51-
molecule-plugins[docker]@git+https://github.com/ansible-community/molecule-plugins.git
48+
-r requirements-upstream.txt
5249
commands =
5350
ansible --version
5451
ansible-lint --version
52+
molecule --version
5553
ansible-galaxy install --force -r requirements.yml
5654
ansible-lint
5755
molecule test -s docker

vagrant

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)