Molecule: Molecule broken - ansible v2.1.1.0

Created on 29 Jul 2016  路  12Comments  路  Source: ansible-community/molecule

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
bug

Most helpful comment

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.

All 12 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

decentral1se picture decentral1se  路  3Comments

dfinninger picture dfinninger  路  5Comments

r0ckyte picture r0ckyte  路  5Comments

Lirt picture Lirt  路  3Comments

srizzling picture srizzling  路  3Comments