No such command 'role' - Ansible Molecule

839 Views Asked by At

When running molecule init role <sample_role>

It returns with

Error: No such command 'role'

Python version: 3.10.12
Ansible version: 2.15.4
OS: Windows using WSL
Molecule version: 6.0.2
1

There are 1 best solutions below

1
Zeitounator On BEST ANSWER

init role has been removed from molecule with release 6.0.0.

This was redundant with the same functionality provided by ansible-galaxy

So if you want to init a role and a default molecule scenario inside it you should now run:

ansible-galaxy role init my_role
cd my_role
molecule init scenario