Molecule version: 1.8.3
Command: molecule test
The latest version of molecule is broken. I first tried with my roles and then I cloned the molecule repo and tried with the demo and go the same error.
ERROR! the role 'molecule' was not found in /Users/mohammed/Downloads/molecule-master/demo/molecule/roles:/Users/macuser/Downloads/molecule-master/demo/molecule:/Users/macuser/Downloads/molecule-master/demo/molecule/.molecule/.molecule/roles:/Users/macuser/Downloads/molecule-master/demo/molecule
The error appears to have been in '/Users/macuser/Downloads/molecule-master/demo/molecule/playbook.yml': line 4, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
roles:
- role: molecule
^ here
None
Works here.
[jodewey:~/git/molecule/demo/molecule] [venv] master+ 卤 molecule --version
1.8.3
[jodewey:~/git/molecule/demo/molecule] [venv] master+ 卤 pwd
/Users/jodewey/git/molecule/demo/molecule
[jodewey:~/git/molecule/demo/molecule] [venv] master+ 卤 molecule test
--> Destroying instances ...
--> Checking playbooks syntax ...
playbook: playbook.yml
--> Creating instances ...
Bringing machine 'demo-01' up with 'virtualbox' provider...
Bringing machine 'demo-02' up with 'virtualbox' provider...
...
works with ansible-2.0.2.0 and ansible-2.1.0.0 not ansible-2.1.1.0 just tested now :(
@moh-abk ok confirmed, thanks!
Looks like the problem is with the syntax command. We need to pass the env to syntax so it can find the role.
Ahh cool. I was wondering why this was happening. I ran into this yesterday too
@moh-abk Actually, it does not work with ansible 2.1.0.0
$ ansible --version
ansible 2.1.0.0
$ molecule --version
1.8.3
Ansible must have changed ever so slightly. However, 2.1.0.0 does work when ran manually.
ANSIBLE_ROLES_PATH=../ ansible-playbook playbook.yml -i .molecule/ansible_inventory
We must not be passing the right env to our ansible playbook class.
Ahh cool. I was wondering why this was happening. I ran into this yesterday too
I'm thinking we need some basic setup/teardown integration tasks across various ansible versions we support.
However, 2.1.0.0 does work when ran manually
sorry, I was wrong. Indeed it does.
Adding ../../ to the roles path of the default ansible.cfg is a fix, but why is it suddenly relative to the tasks folder? I was looking at 2.1.1 changes and don't see anything associated with it.
Tracking the ansible bug upstream https://github.com/ansible/ansible/issues/16911.
We will need to cut a 1.8.4 release off the stable/1.x branch.
/cc @abrown-sg
1.8.4 released to pypi.
Most helpful comment
I'm thinking we need some basic setup/teardown integration tasks across various ansible versions we support.