Skip to content

Commit 21dcd2b

Browse files
authored
Reimplemented templating (init command) (#3959)
- Replaced use of cookiecutter with ansible templates - Removed 'init role' command due to already being covered by ansible-galaxy - Removed support for custom templating from drivers
1 parent 5012292 commit 21dcd2b

File tree

43 files changed

+140
-739
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+140
-739
lines changed

.ansible.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
# Used for testing to avoid using one from outside repository
2+
[defaults]
3+
host_key_checking = False

.config/requirements-lock.txt

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,28 @@
55
# pip-compile --no-annotate --output-file=.config/requirements-lock.txt --resolver=backtracking --strip-extras --unsafe-package=ruamel-yaml-clib pyproject.toml
66
#
77
ansible-compat==4.1.2
8-
ansible-core==2.14.4
9-
arrow==1.2.3
8+
ansible-core==2.15.1
109
attrs==23.1.0
11-
binaryornot==0.4.4
12-
certifi==2022.12.7
1310
cffi==1.15.1
14-
chardet==5.1.0
15-
charset-normalizer==3.1.0
16-
click==8.1.3
11+
click==8.1.4
1712
click-help-colors==0.9.1
18-
cookiecutter==2.1.1
19-
cryptography==41.0.0
13+
cryptography==41.0.1
2014
enrich==1.2.7
21-
idna==3.4
15+
importlib-resources==5.0.7
2216
jinja2==3.1.2
23-
jinja2-time==0.2.0
24-
jsonschema==4.17.3
25-
markdown-it-py==2.2.0
26-
markupsafe==2.1.2
17+
jsonschema==4.18.0
18+
jsonschema-specifications==2023.6.1
19+
markdown-it-py==3.0.0
20+
markupsafe==2.1.3
2721
mdurl==0.1.2
2822
packaging==23.1
29-
pluggy==1.0.0
23+
pluggy==1.2.0
3024
pycparser==2.21
3125
pygments==2.15.1
32-
pyrsistent==0.19.3
33-
python-dateutil==2.8.2
34-
python-slugify==8.0.1
3526
pyyaml==6.0
36-
requests==2.31.0
37-
resolvelib==0.8.1
38-
rich==13.3.4
39-
six==1.16.0
27+
referencing==0.29.1
28+
resolvelib==1.0.1
29+
rich==13.4.2
30+
rpds-py==0.8.10
4031
subprocess-tee==0.4.1
41-
text-unidecode==1.3
42-
urllib3==1.26.15
32+
typing-extensions==4.7.1

.config/requirements.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ ansible-compat >= 4.1.2
22
ansible-core >= 2.12.10
33
click >= 8.0, < 9
44
click-help-colors >= 0.9
5-
cookiecutter >= 1.7.3 # dependency issues in older versions
65
enrich >= 1.2.7
76
jsonschema >= 4.9.1
87
Jinja2 >= 2.11.3

.config/requirements.txt

Lines changed: 47 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,105 +6,100 @@
66
#
77
ansi2html==1.8.0
88
ansible-compat==4.1.2
9-
ansible-core==2.14.4
10-
ansible-lint==6.14.6
11-
arrow==1.2.3
9+
ansible-core==2.15.1
10+
ansible-lint==6.17.2
1211
attrs==23.1.0
13-
beautifulsoup4==4.12.1
14-
binaryornot==0.4.4
12+
beautifulsoup4==4.12.2
1513
black==23.3.0
1614
bracex==2.3.post1
17-
cairocffi==1.5.0
15+
cairocffi==1.5.1
1816
cairosvg==2.7.0
19-
certifi==2022.12.7
17+
certifi==2023.5.7
2018
cffi==1.15.1
21-
chardet==5.1.0
2219
charset-normalizer==3.1.0
23-
check-jsonschema==0.22.0
20+
check-jsonschema==0.23.2
2421
click==8.1.3
2522
click-help-colors==0.9.1
2623
colorama==0.4.6
27-
cookiecutter==2.1.1
28-
coverage==7.2.3
29-
cryptography==40.0.2
24+
coverage==7.2.7
25+
cryptography==41.0.1
3026
csscompressor==0.9.5
3127
cssselect2==0.7.0
3228
defusedxml==0.7.1
3329
dnspython==2.3.0
3430
enrich==1.2.7
35-
exceptiongroup==1.1.1
36-
execnet==1.9.0
37-
filelock==3.12.0
31+
exceptiongroup==1.1.2
32+
execnet==2.0.0
33+
filelock==3.12.2
3834
ghp-import==2.1.0
39-
griffe==0.26.0
35+
griffe==0.29.0
4036
htmlmin2==0.1.13
4137
idna==3.4
42-
importlib-metadata==6.1.0
38+
importlib-metadata==6.6.0
39+
importlib-resources==5.0.7
4340
iniconfig==2.0.0
4441
jinja2==3.1.2
45-
jinja2-time==0.2.0
4642
jsmin==3.0.1
47-
jsonschema==4.17.3
43+
jsonschema==4.18.0
44+
jsonschema-specifications==2023.6.1
4845
linkchecker==10.2.1
4946
markdown==3.3.7
50-
markdown-exec==1.4.0
47+
markdown-exec==1.6.0
5148
markdown-include==0.8.1
52-
markdown-it-py==2.2.0
49+
markdown-it-py==3.0.0
5350
markupsafe==2.1.2
5451
mdurl==0.1.2
5552
mergedeep==1.3.4
56-
mkdocs==1.4.2
57-
mkdocs-ansible==0.1.4
53+
mkdocs==1.4.3
54+
mkdocs-ansible==0.1.6
5855
mkdocs-autorefs==0.4.1
59-
mkdocs-gen-files==0.4.0
60-
mkdocs-htmlproofer-plugin==0.11.0
61-
mkdocs-material==9.1.5
56+
mkdocs-gen-files==0.5.0
57+
mkdocs-htmlproofer-plugin==0.13.1
58+
mkdocs-material==9.1.15
6259
mkdocs-material-extensions==1.1.1
6360
mkdocs-minify-plugin==0.6.4
64-
mkdocs-monorepo-plugin==1.0.4
65-
mkdocstrings==0.21.2
66-
mkdocstrings-python==0.9.0
61+
mkdocs-monorepo-plugin==1.0.5
62+
mkdocstrings==0.22.0
63+
mkdocstrings-python==1.1.0
6764
mypy-extensions==1.0.0
68-
packaging==23.0
65+
packaging==23.1
6966
pathspec==0.11.1
7067
pexpect==4.8.0
7168
pillow==9.5.0
72-
pipdeptree==2.7.0
73-
platformdirs==3.2.0
74-
pluggy==1.0.0
69+
pipdeptree==2.7.1
70+
platformdirs==3.8.1
71+
pluggy==1.2.0
7572
ptyprocess==0.7.0
7673
pycparser==2.21
77-
pygments==2.14.0
78-
pymdown-extensions==9.10
79-
pyrsistent==0.19.3
80-
pytest==7.3.1
81-
pytest-mock==3.10.0
74+
pygments==2.15.1
75+
pymdown-extensions==10.0.1
76+
pytest==7.4.0
77+
pytest-mock==3.11.1
8278
pytest-plus==0.4.0
83-
pytest-testinfra==7.0.0
84-
pytest-xdist==3.2.1
79+
pytest-testinfra==8.1.0
80+
pytest-xdist==3.3.1
8581
python-dateutil==2.8.2
8682
python-slugify==8.0.1
8783
pyyaml==6.0
8884
pyyaml-env-tag==0.1
89-
regex==2023.3.23
90-
requests==2.28.2
91-
resolvelib==0.8.1
92-
rich==13.3.4
93-
ruamel-yaml==0.17.21
85+
referencing==0.29.1
86+
regex==2023.5.5
87+
requests==2.31.0
88+
resolvelib==1.0.1
89+
rich==13.4.2
90+
rpds-py==0.8.10
91+
ruamel-yaml==0.17.31
9492
ruamel-yaml-clib==0.2.7
9593
six==1.16.0
96-
soupsieve==2.4
94+
soupsieve==2.4.1
9795
subprocess-tee==0.4.1
9896
text-unidecode==1.3
9997
tinycss2==1.2.1
10098
tomli==2.0.1
101-
typing-extensions==4.5.0
102-
urllib3==1.26.15
99+
typing-extensions==4.6.2
100+
urllib3==2.0.2
103101
watchdog==3.0.0
104102
wcmatch==8.4.1
105103
webencodings==0.5.1
106-
yamllint==1.30.0
104+
yamllint==1.32.0
107105
zipp==3.15.0
108-
109-
# The following packages are considered to be unsafe in a requirements file:
110-
# setuptools

.github/workflows/tox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
matrix: ${{ fromJson(needs.pre.outputs.matrix) }}
5252

5353
env:
54-
PYTEST_REQPASS: 450
54+
PYTEST_REQPASS: 445
5555
steps:
5656
- uses: actions/checkout@v3
5757
with:

.pre-commit-config.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ repos:
1414
# Temporary excludes so we can gradually normalize the formatting
1515
exclude: >
1616
(?x)^(
17-
src/molecule/cookiecutter/.*|
1817
src/molecule/test/resources/templates/.*|
1918
)$
2019
additional_dependencies:
@@ -63,7 +62,7 @@ repos:
6362
pass_filenames: false
6463
additional_dependencies:
6564
- ansible-compat>=4.1.2
66-
- click>=8.0.1
65+
- click>=8.0.1,<8.1.4 # https://github.com/pallets/click/issues/2558
6766
- enrich>=1.2.7
6867
- importlib-metadata>=4.6.1
6968
- jinja2
@@ -87,7 +86,6 @@ repos:
8786
- ansible-compat>=4.1.2
8887
- click
8988
- click-help-colors
90-
- cookiecutter
9189
- enrich>=1.2.7
9290
- filelock
9391
- jsonschema

.yamllint

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
22
# Based on ansible-lint config
33
extends: default
4-
ignore: |
5-
src/molecule/cookiecutter/scenario/driver/delegated/{{cookiecutter.molecule_directory}}
6-
src/molecule/cookiecutter/molecule/{{cookiecutter.role_name}}
7-
src/molecule/cookiecutter/scenario/verifier/ansible/{{cookiecutter.molecule_directory}}
84
rules:
95
braces:
106
max-spaces-inside: 1

docs/examples.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ items:
2222
use as-is[^1].
2323

2424
> - When `true`, use the specified `platform[].image` as-is.
25-
>
2625
> - When `false`, exec `docker build` to customize base image
2726
> using either:
2827
>

docs/getting-started.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,6 @@ familiar with the basics of how to use Molecule and what it can offer.
1111
external Python dependency for the Docker driver which is provided when
1212
installing Molecule using `pip install 'molecule-plugins[docker]'`.
1313

14-
## Creating a new role
15-
16-
Molecule uses [ansible-galaxy](https://docs.ansible.com/ansible/latest/cli/ansible-galaxy.html) under the hood to generate conventional role layouts. If
17-
you've ever worked with Ansible roles before, you'll be right at home.
18-
If not, please review the
19-
[role directory structure](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#role-directory-structure)
20-
guide to see what each folder is responsible for.
21-
22-
To generate a new role with Molecule, simply run:
23-
24-
```shell
25-
$ molecule init role acme.my_new_role --driver-name docker
26-
```
27-
28-
You should then see a `my_new_role` folder in your current directory.
29-
30-
!!! note
31-
32-
For future reference, if you want to initialize Molecule within an
33-
existing role, you would use the
34-
`molecule init scenario -r my_role_name` command from within the role's
35-
directory (e.g. `my_role_name/`).
36-
3714
## Molecule Scenarios
3815

3916
You will notice one new folder which is the `molecule` folder.

docs/usage.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@
4545

4646
## molecule init
4747

48-
### molecule init role
49-
50-
Initialize a new role using ansible-galaxy and include default
51-
molecule directory. Please refer to the `init scenario`
52-
command in order to generate a custom `molecule` scenario.
53-
5448
### molecule init scenario
5549

5650
## molecule list

0 commit comments

Comments
 (0)