Skip to content

Instantly share code, notes, and snippets.

@bcoca
Created May 1, 2015 01:22
Show Gist options
  • Save bcoca/fae0233ab7cc69a29fdb to your computer and use it in GitHub Desktop.
Save bcoca/fae0233ab7cc69a29fdb to your computer and use it in GitHub Desktop.
#play.yml
---
- hosts: localhost
connection: local
gather_facts: false
roles:
- test
tasks:
- debug: msg="ran untagged"
- debug: msg="always tagged"
tags: ['always']
- debug: msg="tagged first"
tags: ['first']
- debug: msg="tagged second"
tags:
- second
- include: other.yml
- hosts: localhost
name: play tagged with second
tags:
- second
connection: local
gather_facts: false
roles:
- {role: test, tags: ['second']}
tasks:
- debug: msg="ran second, tagged in play"
- include: other.yml
tags: ['second']
...
# other.yml
---
- debug: msg="untagged include"
- debug: msg="tagged first include"
tags: ['first']
- debug: msg="tagged always include"
tags: ['always']
...
# roles/test/tasks/main.yml
---
- debug: msg='role untagged'
- debug: msg='role always'
tags: ['always']
- debug: msg='role first'
tags: ['first']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment