## WORKING WITH TAGS

Tags are useful to be able to run a subset of a playbook on-demand.

Ansible Terminal

    - yum:
        name: "{{ item }}"
        state: latest
      with_items:
      - httpd
      - php56
      tags:
         - packages

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

In the provided example, if the playbook were run with `--tags "packages"` the yum task would execute and the template task would be skipped. If the playbook were run with `--tags "configuration"` the opposite would happen. Without a `--tags` both tasks would execute like normal.

Tags can be seen as a simple though specialized form of conditional statement designed to enable the execution of a subset tasks. Tags are a bit more than simple boolean flags though. To dig deeper see the playbook Tags documentation.