# Using --skip-tags does not skip the tags which are intended

**URL:** <https://forum.ansible.com/t/using-skip-tags-does-not-skip-the-tags-which-are-intended/4616>\
**Category:** Get Help\
**Tags:** vmware, playbook\
**Created:** [March 28, 2024, 3:31pm UTC](https://forum.ansible.com/t/using-skip-tags-does-not-skip-the-tags-which-are-intended/4616 "2024-03-28T15:31:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bostonmacosx](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bostonmacosx/32/2662_2.png) [@bostonmacosx](https://forum.ansible.com/u/bostonmacosx)\
**Post date:** [March 28, 2024, 3:31pm UTC](https://forum.ansible.com/t/using-skip-tags-does-not-skip-the-tags-which-are-intended/4616/1 "2024-03-28T15:31:58Z")

</div>

**Using --skip-tags does not skip the tags which are intended**

Maybe I’m not understanding how skip-tags is supposed to work but in VAGRANT since there is no VMWARE provisioning I was going to skip those tags in the playbook however still getting an error on the TASKS labeled with those tags.

**Versioning:**

> ansible-playbook [core 2.16.5]  
> config file = /vagrant/ansible.cfg  
> configured module search path = [‘/home/vagrant/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
> ansible python module location = /home/vagrant/.local/lib/python3.11/site-packages/ansible  
> ansible collection location = /home/vagrant/.ansible/collections:/usr/share/ansible/collections  
> executable location = /home/vagrant/.local/bin/ansible-playbook  
> python version = 3.11.5 (main, Sep 22 2023, 15:34:29) [GCC 8.5.0 20210514 (Red Hat 8.5.0-20)] (/usr/bin/python3.11)  
> jinja version = 3.1.3  
> libyaml = True

```auto
~/.local/bin/ansible-playbook --limit=127.0.0.1 -i vagrant duoproxy.yml --skip-tags vmware-manage-tags --connection=local

```

After running the above

```auto
Using /vagrant/ansible.cfg as config file
[WARNING]: Unable to parse /vagrant/vagrant as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does
not match 'all'

```

Updated my playbook for vagrant run:

```auto
---
- hosts: localhost
#- hosts: duoproxy
  become: yes
  roles:
    - role: common
    - role: duoproxy

```

Runs a lot of other tasks then odds out with the below which is supposed to be a SKIPPED tag.

```auto
TASK [vmware-manage-tags : query current guest tags settings] ***********************************************
fatal: [127.0.0.1 -> localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'vmware_vcenter_host'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'vmware_vcenter_host'\n\nThe error appears to be in 
'/vagrant/roles/vmware-manage-tags/tasks/vmware-manage-tags.yml': line 18, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: query current guest tags settings\n ^ here\n"}

```

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [March 28, 2024, 3:41pm UTC](https://forum.ansible.com/t/using-skip-tags-does-not-skip-the-tags-which-are-intended/4616/2 "2024-03-28T15:41:07Z")

</div>

Hi, perhaps it is due to the way to add tags to tasks.  
How are you tagging your tasks? Also, are you using `include_tasks` in your roles?

---

<div class="post-metadata">

**Author:** ![bostonmacosx](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bostonmacosx/32/2662_2.png) [@bostonmacosx](https://forum.ansible.com/u/bostonmacosx)\
**Post date:** [March 28, 2024, 4:08pm UTC](https://forum.ansible.com/t/using-skip-tags-does-not-skip-the-tags-which-are-intended/4616/3 "2024-03-28T16:08:41Z")

</div>

It was an ID-010-T problem…

The tags were using underscores and the tasks were using hyphens…

Too man hours looking at a screen… going to have to talk to our Ansible maintainer about this…

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [April 27, 2024, 4:09pm UTC](https://forum.ansible.com/t/using-skip-tags-does-not-skip-the-tags-which-are-intended/4616/4 "2024-04-27T16:09:21Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
