File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 3
3
## Molecule
4
4
5
5
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
7
7
the default scenario.
8
8
9
9
```
@@ -12,10 +12,28 @@ cd extensions
12
12
molecule init scenario
13
13
```
14
14
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
17
16
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:
19
37
20
38
```
21
39
---
@@ -37,7 +55,8 @@ or a playbook:
37
55
ansible.builtin.import_playbook: foo.bar.my_playbook
38
56
```
39
57
40
- molecule test
58
+ This tells molecule what to run for the test. You can now run it with
59
+ ` molecule test ` .
41
60
42
61
## pytest-ansible
43
62
Original file line number Diff line number Diff line change 50
50
- Getting Started : getting-started.md
51
51
- User Guide :
52
52
- user-guide/index.md
53
+ - Testing : user-guide/testing.md
53
54
- Content Best Practices : user-guide/content-best-practices.md
54
55
- Contributor Guide : contributor-guide.md
55
56
You can’t perform that action at this time.
0 commit comments