<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">ansible galaxy tags</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.1.0
  config file = 
  configured module search path = Default w/o overrides
"><pre class="notranslate"><code class="notranslate">ansible 2.2.1.0
  config file = 
  configured module search path = Default w/o overrides

</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<h5 dir="auto">OS / ENVIRONMENT</h5>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Lot of duplicate tags in ansible galaxy</p>
<p dir="auto">fixing this issue will permit a better visibility of roles, less pages, easier to find a role.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Download all page of tags :</p>

<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="max=$(curl &quot;https://galaxy.ansible.com/api/v1/tags/?page=1&amp;format=json&quot; | jq '.num_pages')
&gt; /tmp/1.json
for i in $(seq 1 $max );do curl &quot;https://galaxy.ansible.com/api/v1/tags/?page=${i}&amp;format=json&quot; &gt;&gt; /tmp/1.json; done"><pre class="notranslate"><span class="pl-s">max=$(curl "https://galaxy.ansible.com/api/v1/tags/?page=1&amp;format=json" | jq '.num_pages')</span>
<span class="pl-s">&gt; /tmp/1.json</span>
<span class="pl-s">for i in $(seq 1 $max );do curl "https://galaxy.ansible.com/api/v1/tags/?page=${i}&amp;format=json" &gt;&gt; /tmp/1.json; done</span></pre></div>
<p dir="auto">See few duplicates :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cat /tmp/1.json | jq -r '.results[].name' | grep -i raspberry
raspberry
raspberrypi
RaspberryPi
RaspberryPI

cat /tmp/1.son | jq -r '.results[].name' | grep -i ec2
ec2
EC2

"><pre class="notranslate"><code class="notranslate">cat /tmp/1.json | jq -r '.results[].name' | grep -i raspberry
raspberry
raspberrypi
RaspberryPi
RaspberryPI

cat /tmp/1.son | jq -r '.results[].name' | grep -i ec2
ec2
EC2


</code></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">cat /tmp/1.json | jq -r '.results[].name' | grep -i raspberry<br>
raspberrypi</p>
<p dir="auto">cat /tmp/1 | jq -r '.results[].name' | grep -i ec2<br>
ec2</p>
<h5 dir="auto">ACTUAL RESULTS</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate">
</code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">core</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2.4.3.0"><pre class="notranslate"><code class="notranslate">2.4.3.0
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">It seems that ansible will always throw an warning if a host group is empty and there is no way to avoid getting this warning if the group is empty.</p>
<p dir="auto">This goes even more verbose when list of groups is specified.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>


<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#!/usr/bin/env ansible-playbook -i hosts
---
- hosts: empty-group
  tasks:
    - debug: msg=&quot;foo&quot;"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span>!/usr/bin/env ansible-playbook -i hosts</span>
---
- <span class="pl-ent">hosts</span>: <span class="pl-s">empty-group</span>
  <span class="pl-ent">tasks</span>:
    - <span class="pl-ent">debug</span>: <span class="pl-s">msg="foo"</span></pre></div>
<p dir="auto">With hosts:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="localhost

[empty-group]"><pre class="notranslate"><code class="notranslate">localhost

[empty-group]
</code></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">No warning.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" [WARNING]: Could not match supplied host pattern, ignoring: empty-group


PLAY [empty-group] *******************************************************************************************************************************************************************************************************************************************
skipping: no hosts matched

PLAY RECAP ***************************************************************************************************************************************************************************************************************************************************"><pre class="notranslate"><code class="notranslate"> [WARNING]: Could not match supplied host pattern, ignoring: empty-group


PLAY [empty-group] *******************************************************************************************************************************************************************************************************************************************
skipping: no hosts matched

PLAY RECAP ***************************************************************************************************************************************************************************************************************************************************
</code></pre></div>