Skip to content

Commit 489682b

Browse files
authored
Improve default templates for converge and verify (#4476)
Based on discussion https://github.com/ansible/molecule/discussions/4464 this might make it a bit easier to start for new people. ---------
1 parent 66ed050 commit 489682b

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

.config/dictionary.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,8 @@ virtenv
159159
virtualmachines
160160
webservers
161161
xdist
162+
yourcollection
163+
yournamespace
164+
yourrole
162165
zceos
163166
zzyzx
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
2+
# Purpose: bring the instance to the desired state by running the role under test.
3+
# Molecule calls this playbook with `molecule converge`.
24
- name: Converge
35
hosts: all
4-
gather_facts: false
6+
gather_facts: true # Disable if your role does not rely on facts
57
tasks:
6-
- name: Replace this task with one that validates your content
7-
ansible.builtin.debug:
8-
msg: "This is the effective test"
8+
- name: Apply role under test
9+
ansible.builtin.include_role:
10+
name: yournamespace.yourcollection.yourrole
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
# Purpose: assert that the instance really ended up in the expected state.
3+
# Molecule calls this playbook with `molecule verify`.
4+
- name: Verify
5+
hosts: instance
6+
gather_facts: false # Quicker, if you do not need facts
7+
tasks:
8+
- name: Assert something
9+
ansible.builtin.assert:
10+
that: true

0 commit comments

Comments
 (0)