How to debug why a role is not played?

Hi,

I have a playbook with one play that runs several roles.

But when I run the playbook, Ansible is skipping one of the roles (not the first or last, but one in the middle).
I tried creating a playbook with just that role, and again it’s skipped.
The play has a “pre_tasks” section and those are run.

i.e.,

`

  • hosts: servers
    become: true
    gather_facts: false
    pre_tasks:
  • name: Install python-simplejson
    raw: sudo apt-get -y install python-simplejson
    roles:
  • the_role
    `

I’ve tried running Ansible with -vvv but it did not tell me why the role was skipped.

Thanks for any help.

Probably need the actual playbook and actual role to see why this is happening.

Is the role tagged, if so how? Though if it were tags you’d expect to see output even when skipped.

Maybe make sure that you are running the playbook you think you are running, and check that the role that is being skipped is definitely being referenced by the playbook. Check things like the roles_path. And check that the contents of the role are not commented out or something silly.

Also, check that the output you expect from this role is the output it will actually create - maybe you are looking for something that the role is not actually doing!

Regards, K.