Using existing modules to determine whether to run a script?

8 views
Skip to first unread message

Kim Betti

unread,
Feb 21, 2014, 3:02:31 PM2/21/14
to ansible...@googlegroups.com
I've started looking into Ansible and I quite like it. 

Is it possible to run a shell script only if the yum module determines that a given package is -not- installed? 

Or in more general terms, is there a convenient way to leverage existing modules to decide whether or not to run a task?

Brian Coca

unread,
Feb 21, 2014, 3:51:45 PM2/21/14
to ansible...@googlegroups.com
tasks/modules can register output register: var, you can use that in when: clause in all/any subsequent tasks.
Reply all
Reply to author
Forward
0 new messages