Skip to content

Commit d7936d9

Browse files
committed
Update molecule wording
1 parent 5d0d110 commit d7936d9

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

docs/user_guide/testing.md renamed to docs/user-guide/testing.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Molecule
44

55
To set up molecule, create a new directory in your collection called
6-
extensions, and inside that directory, run molecule init scenario to create
6+
extensions, and inside that directory, run `molecule init scenario` to create
77
the default scenario.
88

99
```
@@ -12,10 +12,28 @@ cd extensions
1212
molecule init scenario
1313
```
1414

15-
add collection path to molecule.yml
16-
https://ansible.readthedocs.io/projects/molecule/configuration/
15+
Update molecule.yml to know where the collection path is
1716

18-
include role in converge.yml
17+
```
18+
provisioner:
19+
name: ansible
20+
config_options:
21+
defaults:
22+
collections_path: ${ANSIBLE_COLLECTIONS_PATH}
23+
```
24+
25+
And set the collection path in the shell
26+
27+
```
28+
export ANSIBLE_COLLECTIONS_PATH=/home/user/working/collections
29+
```
30+
31+
Note that this should be the root `collections` directory, not the
32+
`ansible_collections` directory inside it. We set this to an environment
33+
variable so that the collection can be moved without having to update hardcoded
34+
directories inside the collection later.
35+
36+
Finally, update converge.yml to include a role from your collection:
1937

2038
```
2139
---
@@ -37,7 +55,8 @@ or a playbook:
3755
ansible.builtin.import_playbook: foo.bar.my_playbook
3856
```
3957

40-
molecule test
58+
This tells molecule what to run for the test. You can now run it with
59+
`molecule test`.
4160

4261
## pytest-ansible
4362

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ nav:
5050
- Getting Started: getting-started.md
5151
- User Guide:
5252
- user-guide/index.md
53+
- Testing: user-guide/testing.md
5354
- Content Best Practices: user-guide/content-best-practices.md
5455
- Contributor Guide: contributor-guide.md
5556

0 commit comments

Comments
 (0)