<h5 dir="auto">ISSUE TYPE</h5>
<p dir="auto">Feature Idea</p>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">yum module</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto">2.3</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/halberom/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/halberom">@halberom</a> on 2015-12-10T12:46:34Z<br>
version<br>
ansible v2, devel</p>
<p dir="auto">issue<br>
when changing multiple yum repos (e.g. in a common/base role), it can be necessary to clean the cache so yum will refresh and any future actions will get the updated meta.</p>
<p dir="auto">current<br>
it's necessary to either run a shell/command,</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- command: yum clean all"><pre class="notranslate"><code class="notranslate">- command: yum clean all
</code></pre></div>
<p dir="auto">which currently gives a warning <code class="notranslate">[WARNING]: Consider using yum module rather than running yum</code></p>
<p dir="auto">Or put <code class="notranslate">update_cache: yes</code> in at least one yum (present, installed, latest) task after the repo changes.  If there isn't such a yum task after repo changes, then we don't get the updates.  Which means we'd need to put <code class="notranslate">update_cache: yes</code> elsewhere we use yum - which is likely overkill.</p>
<p dir="auto">desired</p>
<ul dir="auto">
<li>the ability to use update_cache as a standalone action</li>
<li>(optional) a param to <code class="notranslate">clean XYZ</code>.</li>
</ul>
<p dir="auto">Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="121475660" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-core/issues/2667" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-core/issues/2667/hovercard" href="https://github.com/ansible/ansible-modules-core/issues/2667">ansible/ansible-modules-core#2667</a></p>
<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>

<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.1.0
  config file = /opt/uss/ansible/config/2.3.1.cfg
  configured module search path = [u'/usr/share/ansible']
  python version = 2.7.5 (default, Oct 11 2015, 17:47:16) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]"><pre class="notranslate"><code class="notranslate">ansible 2.3.1.0
  config file = /opt/uss/ansible/config/2.3.1.cfg
  configured module search path = [u'/usr/share/ansible']
  python version = 2.7.5 (default, Oct 11 2015, 17:47:16) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<h5 dir="auto">OS / ENVIRONMENT</h5>

<h5 dir="auto">SUMMARY</h5>

<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=""><pre class="notranslate"></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>

<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>
<p dir="auto">From the original issue:</p>
<p dir="auto">version<br>
<code class="notranslate">ansible v2, devel</code></p>
<p dir="auto">issue<br>
when changing multiple yum repos (e.g. in a common/base role), it can be necessary to clean the cache so yum will refresh and any future actions will get the updated meta.</p>
<p dir="auto">current<br>
it's necessary to either run a shell/command,</p>
<ul dir="auto">
<li>command: yum clean all</li>
</ul>
<p dir="auto">which currently gives a warning [WARNING]: Consider using yum module rather than running yum</p>
<p dir="auto">Or put update_cache: yes in at least one yum (present, installed, latest) task after the repo changes. If there isn't such a yum task after repo changes, then we don't get the updates. Which means we'd need to put update_cache: yes elsewhere we use yum - which is likely overkill.</p>
<p dir="auto">desired</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="the ability to use update_cache as a standalone action
(optional) a param to `clean XYZ`."><pre class="notranslate"><code class="notranslate">the ability to use update_cache as a standalone action
(optional) a param to `clean XYZ`.
</code></pre></div>
<h3 dir="auto">LINK: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="121475660" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-core/issues/2667" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-core/issues/2667/hovercard" href="https://github.com/ansible/ansible-modules-core/issues/2667">ansible/ansible-modules-core#2667</a></h3>