Disable Handlers?

608 views
Skip to first unread message

ja...@blendlabs.com

unread,
Jun 6, 2016, 9:26:08 PM6/6/16
to Ansible Project
Any one know a good way to disable all handlers in a role w/o putting conditionals on each of the handlers/tasks?

Alexey Vazhnov

unread,
Jun 9, 2016, 1:30:16 AM6/9/16
to Ansible Project
I know only using «when» to disable the handlers.

ja...@blendlabs.com

unread,
Jun 9, 2016, 2:29:20 AM6/9/16
to Ansible Project
Yeah was hoping for something not as intrusive.

Mark Janssen

unread,
Jun 10, 2016, 10:15:09 AM6/10/16
to ansible...@googlegroups.com
Not exactly clean, but you could modify all handlers to have a tag: handler . .... and then run ansible with --skip-tags=handler

Mark

--
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/f6cbc0f5-65d0-4964-a2a7-947ad2e8baa1%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Mark Janssen  --  maniac(at)maniac.nl
Unix / Linux Open-Source and Internet Consultant
Maniac.nl Sig-IO.nl Vps.Stoned-IT.com

Mark Janssen

unread,
Jun 10, 2016, 10:23:14 AM6/10/16
to ansible...@googlegroups.com
Ignore that one.... seems that doesn't work

$ ansible-playbook -i hosts.localhost handlertest.yml -l localhost  --skip-tags=handler

PLAY ***************************************************************************

TASK [Create a file] ***********************************************************
changed: [localhost]

RUNNING HANDLER [notifytest] ***************************************************
ok: [localhost] => {
    "msg": "Handler being run"
}

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0   

Reply all
Reply to author
Forward
0 new messages