How to debug why a role is not played?

11 views
Skip to first unread message

kumkum

unread,
Jan 23, 2019, 4:43:21 PM1/23/19
to Ansible Project
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.

Karl Auer

unread,
Jan 23, 2019, 6:10:59 PM1/23/19
to ansible-project
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.


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/485a7cb2-731f-4e61-bd77-fe94eacad1c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Karl Auer

Email  : ka...@2pisoftware.com
Website: http://2pisoftware.com


GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA

Reply all
Reply to author
Forward
0 new messages