# Limitations for tags in Ansible

**URL:** <https://forum.ansible.com/t/limitations-for-tags-in-ansible/30951>\
**Category:** Ansible Developer\
**Created:** [August 5, 2019, 8:46am UTC](https://forum.ansible.com/t/limitations-for-tags-in-ansible/30951 "2019-08-05T08:46:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Derek\_Chan](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@Derek\_Chan](https://forum.ansible.com/u/Derek_Chan)\
**Post date:** [August 5, 2019, 8:46am UTC](https://forum.ansible.com/t/limitations-for-tags-in-ansible/30951/1 "2019-08-05T08:46:44Z")

</div>

Hi everyone, I am planning to use ansible to execute a long list of task but I would like users to select which task to execute with the help of some GUI from Python. Is there any limitations of the number of tags I can specify in the CLI?

E.g ansible-playbook example.yml --tags “configuration,packages,test1,test2,test3,test4,test5,test6,…,test100”

Will ansible be able to run all of the tags specificed in the command above?

---

<div class="post-metadata">

**Author:** ![Sebastian\_Meyer](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@Sebastian\_Meyer](https://forum.ansible.com/u/Sebastian_Meyer)\
**Post date:** [August 5, 2019, 9:57am UTC](https://forum.ansible.com/t/limitations-for-tags-in-ansible/30951/2 "2019-08-05T09:57:54Z")

</div>

Hi,

> Is there any limitations of the number of tags I can specify  
> in the CLI?
> 
> E.g ansible-playbook example.yml --tags  
> "configuration,packages,test1,test2,test3,test4,test5,test6,...,test100"
> 
> Will ansible be able to run all of the tags specificed in the command above?

I just tested this for 15k tags in a playbook and 12k specified on the  
commandline and it takes some time, but it works.

To reproduce:

cat test.tmpl  
&nbsp;&nbsp;&nbsp;&nbsp;- name: Task TASKID  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;debug:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg: Task TASKID  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tags:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- tagTASKID

for i in {1..15000}; do sed s/TASKID/$i/ test.tmpl \>\> test.yaml; done

Add the following lines to the beginning of test.yaml:

---

<div class="post-metadata">

**Author:** ![Derek\_Chan](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@Derek\_Chan](https://forum.ansible.com/u/Derek_Chan)\
**Post date:** [August 7, 2019, 3:34am UTC](https://forum.ansible.com/t/limitations-for-tags-in-ansible/30951/3 "2019-08-07T03:34:35Z")

</div>

Hi Sebastian,

Thanks for your input regarding this issue, it didn’t cross my mind to write a script to generate a test.

-Derek
