<h5 dir="auto">Issue Type: Feature Idea</h5>
<h5 dir="auto">Ansible Version: 1.6.2</h5>
<h5 dir="auto">Environment: Ubuntu 12.04</h5>
<h5 dir="auto">Summary:</h5>
<p dir="auto">I would like the ability to have a dependent role's status re-evaluated each time it is called. That way, if a dependent role is called multiple times (e.g by different dependent roles), it won't get skipped.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">When developing a set of roles for apache, I've run into this issue:<br>
<a href="https://groups.google.com/forum/#!topic/Ansible-project/xcjUnfFKK6A" rel="nofollow">https://groups.google.com/forum/#!topic/Ansible-project/xcjUnfFKK6A</a></p>
<p dir="auto">The basic setup of these roles is 4 different roles for apache:<br>
apache2 - this is the base role that contains the apache2 config, installs and configures apache<br>
apache2-php - this role adds mod_php, php.ini, etc<br>
apache2-ssl - this role adds an SSL certificate and forces all traffic to SSL<br>
apache2-all - includes all of the above</p>
<p dir="auto">This is nice because some servers only need a subset of this functionality, so I can just include the appropriate features as needed. I've bundled these together using role dependencies, e.g apache2-php/meta/main.yml contains the following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dependencies:
  - { role: apache2 }"><pre class="notranslate"><code class="notranslate">dependencies:
  - { role: apache2 }
</code></pre></div>
<p dir="auto">This is nice because then I need to only maintain the apache template file in a single location, inside of the apache2 role, and just set variables in the other roles if I want to add/change content on it.</p>
<p dir="auto">This works well, except that in order for the variables to be overridden and included together at the correct point, I have this situation in the apache2-ssl meta/main.yml files:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dependencies:
  - { role: apache2-php, when: include_php == True }
  - { role: apache2, when: include_php == False }"><pre class="notranslate"><code class="notranslate">dependencies:
  - { role: apache2-php, when: include_php == True }
  - { role: apache2, when: include_php == False }
</code></pre></div>
<p dir="auto">I would like to be able to add a variable that allows resetting the dependent role's status, e.g</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dependencies:
  - { role: apache2-php, when: include_php == True }
  - { role: apache2, reset_dependents: True, when: include_php == False }"><pre class="notranslate"><code class="notranslate">dependencies:
  - { role: apache2-php, when: include_php == True }
  - { role: apache2, reset_dependents: True, when: include_php == False }
</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">The problem is that if include_php == False, then the first role dependency (apache2-php), is skipped. What seems to be happening is it recursively marks everything in the apache2 role as skipped as well, including the handler I use to reload apache after updating the config. Then, when it arrives at the second role dependency (apache2), it skips executing any of the handlers in the apache2 role even if they are NOTIFIED because they were marked as skipped previously.</p>
<p dir="auto">Would it be possible to add a variable that would reset a role so that whether or not it should be skipped is evaluated each time it is called (similar to the existing allow_duplicates variable)?</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">The apache2 handler that reloads the apache config is skipped (when called via the apache2 depedent role above), even if there are changes because it was already marked as skipped by the dependent apache2-php call (which was skipped).</p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto"><code class="notranslate">vmware</code></p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto"><code class="notranslate">ansible 2.5.0 (devel 466e1b289b) last updated 2018/01/26 10:22:19 (GMT +200)</code></p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">There is currently a module called <code class="notranslate">vmware_resource_pool</code> to create a new VMware resource pool. A VM can subsequently be assigned to the newly created resource pool by using the <code class="notranslate">resource_pool</code> option of the <code class="notranslate">vmware_guest</code> module.</p>
<p dir="auto">It is also possible to assign a VM to a "VM and Template" folder using the <code class="notranslate">folder</code> option of the <code class="notranslate">vmware_guest</code> module. There appears however to be no way to also create such a "VM and Template" folder using the Ansible VMware cloud modules. This means that this is a manual step that has to be performed using the VMware user interface or needs to be automated through some other means.</p>
<p dir="auto">I propose adding a new module called <code class="notranslate">vmware_vm_folder</code> in order to create a new "VM and Template" folder so that this can also be automated before placing a number of VMs inside the newly created folder using a playbook.</p>