<p dir="auto">when using the "yum" module to install a package in RHEL6, I just get this error:</p>
<p dir="auto">fatal: [jofo-mgmt1] =&gt; failed to parse: This system is not registered with RHN.</p>
<p dir="auto">RHN support will be disabled.</p>
<p dir="auto">{"changed": true}</p>
<p dir="auto">These lines are always printed by yum on the machine, unless the RHN plugin is disabled with "--disableplugin=rhnplugin", or, I guess, by registering the machine with RHN. However, the latter would probably be impractical since it's actually a disposable VM in a opennebula cluster.</p>
<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Vladimir-csp/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Vladimir-csp">@Vladimir-csp</a> on 2016-06-12T09:45:24Z</p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">copy<br>
template</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.1.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.1.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
</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">As was suggested in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="31218546" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/6929" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/6929/hovercard" href="https://github.com/ansible/ansible/issues/6929">#6929</a>, I am opening new issue on this matter<br>
Please add 'state' parameter for template and copy modules, so items could be removed with the same task by using condition or variable override.</p>
<h5 dir="auto">STEPS TO REPRODUCE</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">EXPECTED RESULTS</h5>

<p dir="auto">Something like this should be possible</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: govern foo template
  template: src=foo dest=/etc/foo state=&quot;{% if enable_foo == true %}present{% else %}absent{% endif%}&quot;"><pre class="notranslate"><code class="notranslate">- name: govern foo template
  template: src=foo dest=/etc/foo state="{% if enable_foo == true %}present{% else %}absent{% endif%}"
</code></pre></div>
<p dir="auto">On second thought, file, copy, and template modules could be merged together into file module to make some cool things like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: linked template
  file: template=foo.conf state=link src=../bar/bar.conf dest=/etc/foo/foo.conf
# makes link /etc/foo/foo.conf &gt; /etc/bar/bar.conf,
# templates  /etc/foo/foo.conf  from foo.conf effectively writing to  /etc/bar/bar.conf."><pre class="notranslate"><code class="notranslate">- name: linked template
  file: template=foo.conf state=link src=../bar/bar.conf dest=/etc/foo/foo.conf
# makes link /etc/foo/foo.conf &gt; /etc/bar/bar.conf,
# templates  /etc/foo/foo.conf  from foo.conf effectively writing to  /etc/bar/bar.conf.
</code></pre></div>
<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">Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="159818844" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-core/issues/3934" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-core/issues/3934/hovercard" href="https://github.com/ansible/ansible-modules-core/issues/3934">ansible/ansible-modules-core#3934</a></p>