Ansible tags

Use Ansible tags to filter tasks in execution.

2

Votes

- yum:
    name: "{{ item }}"
    state: installed
  loop:
     - httpd
     - memcached
  tags:
     - packages

- template:
    src: templates/src.j2
    dest: /etc/foo.conf
  tags:
     - configuration

--- Usage ---

Run on "configuration" and "packages" tags:

ansible-playbook example.yml --tags "configuration,packages"

Skip all the tasks with "notifications" tag:

ansible-playbook example.yml --skip-tags "notification"

Vote Here

You must earn at least 1 vote on your snippets to be allowed to vote

Terms Of Use

Privacy Policy

Featured snippets are MIT license

Gears & Masters

Advertise

DevOpsnipp.com © 2020

medium.png