# Issue with Tags

**URL:** <https://forum.ansible.com/t/issue-with-tags/23509>\
**Category:** Ansible Project\
**Created:** [January 19, 2017, 8:54pm UTC](https://forum.ansible.com/t/issue-with-tags/23509 "2017-01-19T20:54:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jithendra\_myla](https://avatars.discourse-cdn.com/v4/letter/j/7ab992/32.png) [@jithendra\_myla](https://forum.ansible.com/u/jithendra_myla)\
**Post date:** [January 19, 2017, 8:54pm UTC](https://forum.ansible.com/t/issue-with-tags/23509/1 "2017-01-19T20:54:15Z")

</div>

Here is ansible playbook, i given a tag and wanted to use it while i run the playbook, but it will still run the whole playbook

[ansible@centos1 ansible\_playbooks]$ cat install\_plays.yml  
— # install software on multiple hosts

- hosts: apacheweb  
remote\_user: ansible  
connection: ssh  
become: yes  
become\_method: sudo  
gather\_facts: yes  
vars\_files:

- values.property  
tasks:

- name: install apache  
yum: name={{ apache }} state=latest  
tags:

- papa

- name: copy the httpd.conf  
template: src=httpd.conf dest=/etc/httpd/conf  
notify:

- restart apache  
handlers:

- name: restart apache  
service: name=httpd state=restarted enabled=yes

- hosts: appserver  
remote\_user: ansible  
connection: ssh  
gather\_facts: yes  
become: yes  
become\_method: sudo  
vars\_files:

- values.property  
tasks:

- name: Install telnet  
yum: name={{ package }} state=latest

- hosts: debian  
remote\_user: ansible  
connection: ssh  
become: yes  
become\_method: sudo  
gather\_facts: yes  
vars\_files:

- values.property  
tasks:

- name: Install lynx  
apt: name={{ package1 }} state=latest

- hosts: localhost  
remote\_user: ansible  
connection: ssh  
gather\_facts: yes  
become: yes  
become\_method: sudo  
vars\_files:

- values.property  
tasks:

- name: Install telnet  
yum: name={{ package }} state=latest  
[ansible@centos1 ansible\_playbooks]$

**_[ansible@centos1 ansible\_playbooks]$ ansible-playbook install\_plays.yml --tags “papa”_**

**_PLAY [apacheweb] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_**

**_TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_**  
**_ok: [[centos2.ohari.com](http://centos2.ohari.com)]_**

**_TASK [install apache] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_**  
**_ok: [[centos2.ohari.com](http://centos2.ohari.com)]_**

**_PLAY [appserver] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_**

**_TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_**  
**_ok: [[centos3.ohari.com](http://centos3.ohari.com)]_**

**_PLAY [debian] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_**

**_TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_**  
**_ok: [[ubuntu2.ohari.com](http://ubuntu2.ohari.com)]_**

**_PLAY [localhost] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_**

**_TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_**  
**_ok: [localhost]_**

**_PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_**  
**_[centos2.ohari.com](http://centos2.ohari.com) : ok=2 changed=0 unreachable=0 failed=0_**  
**_[centos3.ohari.com](http://centos3.ohari.com) : ok=1 changed=0 unreachable=0 failed=0_**  
**_localhost : ok=1 changed=0 unreachable=0 failed=0_**  
**_[ubuntu2.ohari.com](http://ubuntu2.ohari.com) : ok=1 changed=0 unreachable=0 failed=0_**

**_[ansible@centos1 ansible\_playbooks]$'_**

**_Thank you very much for helping me_**

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 20, 2017, 1:34am UTC](https://forum.ansible.com/t/issue-with-tags/23509/2 "2017-01-20T01:34:28Z")

</div>

The tag is working correctly, the implicit ‘setup’ or ‘fact gathering’ has an ‘always’ tag so you need to explicitly exclude them.
