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

Fix check mode on handler #43

Merged
merged 1 commit into from
Feb 6, 2025
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
1 change: 1 addition & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
ansible.builtin.service:
name: avahi-daemon
state: restarted
when: 'not ansible_check_mode'
5 changes: 5 additions & 0 deletions molecule/check_mode/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Converge
hosts: all
roles:
- role: brianhartsock.avahi
41 changes: 41 additions & 0 deletions molecule/check_mode/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
dependency:
name: galaxy
driver:
name: docker
lint: |
set -e
yamllint .
ansible-lint
flake8
platforms:
# Only worry about noble for check mode since there is no difference in playbooks
- name: noble
image: geerlingguy/docker-ubuntu2404-ansible:latest
command: ""
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
pre_build_image: true
provisioner:
name: ansible
options:
check: true
verifier:
name: testinfra
scenario:
test_sequence:
- dependency
- cleanup
- destroy
- syntax
- create
- prepare
- converge
# Skipping idempotence since it is check_mode
# idempotence
- side_effect
- verify
- cleanup
- destroy
8 changes: 8 additions & 0 deletions molecule/check_mode/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: Prepare
hosts: all
check_mode: false
tasks:
- name: Update apt cache.
ansible.builtin.package:
update_cache: true
5 changes: 5 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ dependency:
name: galaxy
driver:
name: docker
lint: |
set -e
yamllint .
ansible-lint
flake8
platforms:
- name: focal
image: geerlingguy/docker-ubuntu2004-ansible:latest
Expand Down