Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplemented templating (init command) #3959

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .ansible.cfg
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Used for testing to avoid using one from outside repository
[defaults]
host_key_checking = False
38 changes: 14 additions & 24 deletions .config/requirements-lock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,28 @@
# pip-compile --no-annotate --output-file=.config/requirements-lock.txt --resolver=backtracking --strip-extras --unsafe-package=ruamel-yaml-clib pyproject.toml
#
ansible-compat==4.1.2
ansible-core==2.14.4
arrow==1.2.3
ansible-core==2.15.1
attrs==23.1.0
binaryornot==0.4.4
certifi==2022.12.7
cffi==1.15.1
chardet==5.1.0
charset-normalizer==3.1.0
click==8.1.3
click==8.1.4
click-help-colors==0.9.1
cookiecutter==2.1.1
cryptography==41.0.0
cryptography==41.0.1
enrich==1.2.7
idna==3.4
importlib-resources==5.0.7
jinja2==3.1.2
jinja2-time==0.2.0
jsonschema==4.17.3
markdown-it-py==2.2.0
markupsafe==2.1.2
jsonschema==4.18.0
jsonschema-specifications==2023.6.1
markdown-it-py==3.0.0
markupsafe==2.1.3
mdurl==0.1.2
packaging==23.1
pluggy==1.0.0
pluggy==1.2.0
pycparser==2.21
pygments==2.15.1
pyrsistent==0.19.3
python-dateutil==2.8.2
python-slugify==8.0.1
pyyaml==6.0
requests==2.31.0
resolvelib==0.8.1
rich==13.3.4
six==1.16.0
referencing==0.29.1
resolvelib==1.0.1
rich==13.4.2
rpds-py==0.8.10
subprocess-tee==0.4.1
text-unidecode==1.3
urllib3==1.26.15
typing-extensions==4.7.1
1 change: 0 additions & 1 deletion .config/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ ansible-compat >= 4.1.2
ansible-core >= 2.12.10
click >= 8.0, < 9
click-help-colors >= 0.9
cookiecutter >= 1.7.3 # dependency issues in older versions
enrich >= 1.2.7
jsonschema >= 4.9.1
Jinja2 >= 2.11.3
Expand Down
99 changes: 47 additions & 52 deletions .config/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,105 +6,100 @@
#
ansi2html==1.8.0
ansible-compat==4.1.2
ansible-core==2.14.4
ansible-lint==6.14.6
arrow==1.2.3
ansible-core==2.15.1
ansible-lint==6.17.2
attrs==23.1.0
beautifulsoup4==4.12.1
binaryornot==0.4.4
beautifulsoup4==4.12.2
black==23.3.0
bracex==2.3.post1
cairocffi==1.5.0
cairocffi==1.5.1
cairosvg==2.7.0
certifi==2022.12.7
certifi==2023.5.7
cffi==1.15.1
chardet==5.1.0
charset-normalizer==3.1.0
check-jsonschema==0.22.0
check-jsonschema==0.23.2
click==8.1.3
click-help-colors==0.9.1
colorama==0.4.6
cookiecutter==2.1.1
coverage==7.2.3
cryptography==40.0.2
coverage==7.2.7
cryptography==41.0.1
csscompressor==0.9.5
cssselect2==0.7.0
defusedxml==0.7.1
dnspython==2.3.0
enrich==1.2.7
exceptiongroup==1.1.1
execnet==1.9.0
filelock==3.12.0
exceptiongroup==1.1.2
execnet==2.0.0
filelock==3.12.2
ghp-import==2.1.0
griffe==0.26.0
griffe==0.29.0
htmlmin2==0.1.13
idna==3.4
importlib-metadata==6.1.0
importlib-metadata==6.6.0
importlib-resources==5.0.7
iniconfig==2.0.0
jinja2==3.1.2
jinja2-time==0.2.0
jsmin==3.0.1
jsonschema==4.17.3
jsonschema==4.18.0
jsonschema-specifications==2023.6.1
linkchecker==10.2.1
markdown==3.3.7
markdown-exec==1.4.0
markdown-exec==1.6.0
markdown-include==0.8.1
markdown-it-py==2.2.0
markdown-it-py==3.0.0
markupsafe==2.1.2
mdurl==0.1.2
mergedeep==1.3.4
mkdocs==1.4.2
mkdocs-ansible==0.1.4
mkdocs==1.4.3
mkdocs-ansible==0.1.6
mkdocs-autorefs==0.4.1
mkdocs-gen-files==0.4.0
mkdocs-htmlproofer-plugin==0.11.0
mkdocs-material==9.1.5
mkdocs-gen-files==0.5.0
mkdocs-htmlproofer-plugin==0.13.1
mkdocs-material==9.1.15
mkdocs-material-extensions==1.1.1
mkdocs-minify-plugin==0.6.4
mkdocs-monorepo-plugin==1.0.4
mkdocstrings==0.21.2
mkdocstrings-python==0.9.0
mkdocs-monorepo-plugin==1.0.5
mkdocstrings==0.22.0
mkdocstrings-python==1.1.0
mypy-extensions==1.0.0
packaging==23.0
packaging==23.1
pathspec==0.11.1
pexpect==4.8.0
pillow==9.5.0
pipdeptree==2.7.0
platformdirs==3.2.0
pluggy==1.0.0
pipdeptree==2.7.1
platformdirs==3.8.1
pluggy==1.2.0
ptyprocess==0.7.0
pycparser==2.21
pygments==2.14.0
pymdown-extensions==9.10
pyrsistent==0.19.3
pytest==7.3.1
pytest-mock==3.10.0
pygments==2.15.1
pymdown-extensions==10.0.1
pytest==7.4.0
pytest-mock==3.11.1
pytest-plus==0.4.0
pytest-testinfra==7.0.0
pytest-xdist==3.2.1
pytest-testinfra==8.1.0
pytest-xdist==3.3.1
python-dateutil==2.8.2
python-slugify==8.0.1
pyyaml==6.0
pyyaml-env-tag==0.1
regex==2023.3.23
requests==2.28.2
resolvelib==0.8.1
rich==13.3.4
ruamel-yaml==0.17.21
referencing==0.29.1
regex==2023.5.5
requests==2.31.0
resolvelib==1.0.1
rich==13.4.2
rpds-py==0.8.10
ruamel-yaml==0.17.31
ruamel-yaml-clib==0.2.7
six==1.16.0
soupsieve==2.4
soupsieve==2.4.1
subprocess-tee==0.4.1
text-unidecode==1.3
tinycss2==1.2.1
tomli==2.0.1
typing-extensions==4.5.0
urllib3==1.26.15
typing-extensions==4.6.2
urllib3==2.0.2
watchdog==3.0.0
wcmatch==8.4.1
webencodings==0.5.1
yamllint==1.30.0
yamllint==1.32.0
zipp==3.15.0

# The following packages are considered to be unsafe in a requirements file:
# setuptools
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
matrix: ${{ fromJson(needs.pre.outputs.matrix) }}

env:
PYTEST_REQPASS: 450
PYTEST_REQPASS: 445
steps:
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 1 addition & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ repos:
# Temporary excludes so we can gradually normalize the formatting
exclude: >
(?x)^(
src/molecule/cookiecutter/.*|
src/molecule/test/resources/templates/.*|
)$
additional_dependencies:
Expand Down Expand Up @@ -63,7 +62,7 @@ repos:
pass_filenames: false
additional_dependencies:
- ansible-compat>=4.1.2
- click>=8.0.1
- click>=8.0.1,<8.1.4 # https://github.com/pallets/click/issues/2558
- enrich>=1.2.7
- importlib-metadata>=4.6.1
- jinja2
Expand All @@ -87,7 +86,6 @@ repos:
- ansible-compat>=4.1.2
- click
- click-help-colors
- cookiecutter
- enrich>=1.2.7
- filelock
- jsonschema
Expand Down
4 changes: 0 additions & 4 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
# Based on ansible-lint config
extends: default
ignore: |
src/molecule/cookiecutter/scenario/driver/delegated/{{cookiecutter.molecule_directory}}
src/molecule/cookiecutter/molecule/{{cookiecutter.role_name}}
src/molecule/cookiecutter/scenario/verifier/ansible/{{cookiecutter.molecule_directory}}
rules:
braces:
max-spaces-inside: 1
Expand Down
1 change: 0 additions & 1 deletion docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ items:
use as-is[^1].

> - When `true`, use the specified `platform[].image` as-is.
>
> - When `false`, exec `docker build` to customize base image
> using either:
>
Expand Down
23 changes: 0 additions & 23 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,6 @@ familiar with the basics of how to use Molecule and what it can offer.
external Python dependency for the Docker driver which is provided when
installing Molecule using `pip install 'molecule-plugins[docker]'`.

## Creating a new role

Molecule uses [ansible-galaxy](https://docs.ansible.com/ansible/latest/cli/ansible-galaxy.html) under the hood to generate conventional role layouts. If
you've ever worked with Ansible roles before, you'll be right at home.
If not, please review the
[role directory structure](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#role-directory-structure)
guide to see what each folder is responsible for.

To generate a new role with Molecule, simply run:

```shell
$ molecule init role acme.my_new_role --driver-name docker
```

You should then see a `my_new_role` folder in your current directory.

!!! note

For future reference, if you want to initialize Molecule within an
existing role, you would use the
`molecule init scenario -r my_role_name` command from within the role's
directory (e.g. `my_role_name/`).

## Molecule Scenarios

You will notice one new folder which is the `molecule` folder.
Expand Down
6 changes: 0 additions & 6 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@

## molecule init

### molecule init role

Initialize a new role using ansible-galaxy and include default
molecule directory. Please refer to the `init scenario`
command in order to generate a custom `molecule` scenario.

### molecule init scenario

## molecule list
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ no_incremental = true
[[tool.mypy.overrides]]
module = [
"click_help_colors", # https://github.com/click-contrib/click-help-colors/issues/20
"cookiecutter.*", # https://github.com/cookiecutter/cookiecutter/issues/1878
"pexpect", # https://github.com/pexpect/pexpect/issues/759
"pluggy", # https://github.com/pytest-dev/pluggy/pull/414
"testinfra.*", # https://github.com/pytest-dev/pytest-testinfra/issues/619
Expand Down Expand Up @@ -158,7 +157,6 @@ norecursedirs = [
"build",
"dist",
"doc",
"src/molecule/cookiecutter/scenario",
"src/molecule/test/resources",
"src/molecule/test/scenarios",
]
Expand Down
2 changes: 1 addition & 1 deletion src/molecule/command/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def execute(self, action_args=None):
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help=f"Name of the scenario to target. ({base.MOLECULE_DEFAULT_SCENARIO_NAME})",
)
def cleanup(ctx, scenario_name): # pragma: no cover
def cleanup(ctx, scenario_name="default"): # pragma: no cover
"""Use the provisioner to cleanup any changes made to external systems during \
the stages of testing.
"""
Expand Down
Loading