Call role multiple times with different tags

87 views
Skip to first unread message

Kevin Porter

unread,
Jan 26, 2015, 9:23:31 PM1/26/15
to ansible...@googlegroups.com
From one ansible script I would like to call a single role multiple times passing different tags in.

example:
roles:
   
- role: service-name
      tags
:
         
- install

     
- role: get-configs-from-git
 
     
- role: service-name
       tags
:
         
- configure
         
- start


Or is there another common pattern used to handle such case?

Giovanni Tirloni

unread,
Jan 28, 2015, 7:56:38 AM1/28/15
to ansible...@googlegroups.com
On Mon, 26 Jan 2015 18:23 -0800, Kevin Porter <kpo...@aerospike.com>
wrote:
> From one ansible script I would like to call a single role multiple times passing different tags in.

[...]

> Or is there another common pattern used to handle such case?

If a server has role 'webserver', I would add tasks inside that role to
install, configure and start it.

Otherwise you start thinking "this server has role X, but is it
configured or just installed?".. that's question you might ask for a
package, not a role. IMHO.

Giovanni
Reply all
Reply to author
Forward
0 new messages