python-3.xansiblemolecule

No such command 'role' - Ansible Molecule


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

Solution

  • 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