Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@muziyoshiz
Created January 15, 2018 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muziyoshiz/49c087ad71ba56f30b2c8880d06eaf08 to your computer and use it in GitHub Desktop.
Save muziyoshiz/49c087ad71ba56f30b2c8880d06eaf08 to your computer and use it in GitHub Desktop.
Example of import_tasks/include_tasks with tags
- name: Task 0
debug: msg="No tag"
- name: Task 1
debug: msg="tag1"
tags: [ tag1 ]
- name: Task 2
debug: msg="tag2"
tags: [ tag2 ]
---
- hosts: localhost
connection: local
tasks:
- include: main.yml
tags: [ tag1 ]
---
- hosts: localhost
connection: local
tasks:
- import_tasks: main.yml
tags: [ tag1 ]
---
- hosts: localhost
connection: local
tasks:
- include_tasks: main.yml
tags: [ tag1 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment