ansible / molecule

Molecule aids in the development and testing of Ansible content: collections, playbooks and roles
https://ansible.readthedocs.io/projects/molecule/
MIT License
3.87k stars 660 forks source link

Running side effect with custom playbook skips when no default is defined #3617

Open saiello opened 2 years ago

saiello commented 2 years ago

Issue Type

Molecule and Ansible details

ansible --version && molecule --version
ansible [core 2.13.1]
  config file = None
  configured module search path = ['/Users/saiello/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/saiello/Workspace/github.com/tmp-molecule-bug/venv/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/saiello/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/saiello/Workspace/github.com/tmp-molecule-bug/venv/bin/ansible
  python version = 3.10.3 (main, Jul 17 2022, 16:04:39) [Clang 12.0.0 (clang-1200.0.32.29)]
  jinja version = 3.1.2
  libyaml = True
molecule 4.0.0 using python 3.10 
    ansible:2.13.1
    delegated:4.0.0 from molecule

Molecule installation method (one of):

Ansible installation method (one of):

How to reproduce

molecule init scenario
mv molecule/default/verify{,_reboot}.yml
cat <<\EOF > molecule/default/molecule.yml
---
dependency:
  name: galaxy
driver:
  name: delegated
platforms:
  - name: instance
provisioner:
  name: ansible
verifier:
  name: ansible
scenario:
  converge_sequence:
    - converge
    - idempotence
    - side_effect reboot.yml
    - verify verify_reboot.yml
EOF

molecule converge

Desired Behavior

Configuring a custom playbook for side_effect should run that playbook despite the presence of the default provisioner.playbooks.side_effect value.

In the mcve the reboot.yml playbook is expected to be executed.

Actual Behaviour

Side effect is skipped with the following output:

INFO     Running default > side_effect
WARNING  Skipping, side effect playbook not configured.
amarao commented 2 years ago

I've missed that. As workaround, just create an empty side_effect.yml file.

I will try to find a fix.

saiello commented 2 years ago

I've missed that. As workaround, just create an empty side_effect.yml file.

Yeah it works. Thanks!

I will try to find a fix.

If can help, the verify is working as expected.