Run Playbook with only several tags with the dependencies

10 views
Skip to first unread message

Ruhut Tambunan

unread,
Apr 17, 2015, 9:44:11 AM4/17/15
to ansible...@googlegroups.com
Hello guys,

I have a little problem in running a playbook.
So, let's just say I have this kind of roles:

myproject
\--roles
   \++cars.yml
   \--dodge
   |  \--meta
   |  |  \++main.yml
   |  \--tasks
   |     \++main.yml
   |     \++charger.yml
   |     \++viper.yml
   \--toyota
      \--tasks
         \++main.yml
         \++supra.yml
         \++yaris.yml

Here are some important file contents we need to know:

myproject/cars.yml
---
- hosts: 127.0.0.1
  connection
: local
  roles
:
   
- dodge


myproject/roles/dodge/meta/main.yml
---
dependencies
:
 
- toyota


myproject/roles/dodge/tasks/main.yml
---
- include: charger.yml tags=charger
- include: viper.yml tags=viper


myproject/roles/toyota/tasks/main.yml
---
- include: supra.yml tags=supra
- include: yaris.yml tags=yaris


So, at first I ran ansible-playbook cars.yml and everything went very well.
It ran toyota role at first, and then dodge role with charger, tags and viper tags

Now I just want to run the dogde role with charger tags (not viper), but I also want to run the toyota role as well.

So I ran ansible-playbook cars.yml -t charger

It ran the dodge role with charger tags, but it skipped the toyota role.

I need the dodge role with charger tags run after the toyota role,

Now I would like to ask your help. Please help me to fix this.

Thank you very much.
Reply all
Reply to author
Forward
0 new messages