<p dir="auto">I currently have this in group_vars/all.yml -</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible_connection_type: '{{ ansible_connection | default(&quot;ssh&quot;) }}'"><pre class="notranslate"><code class="notranslate">ansible_connection_type: '{{ ansible_connection | default("ssh") }}'
</code></pre></div>
<p dir="auto">In previous versions of Ansible (including 2.0 from git before it was released), this meant I could do this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- include: configure-armhf.yml ansible_connection=chroot"><pre class="notranslate"><code class="notranslate">- include: configure-armhf.yml ansible_connection=chroot
</code></pre></div>
<p dir="auto">And my tasks would run in chroot.</p>
<p dir="auto">In version 2.0.0.2 this is now ignored :( - Any ideas?</p>
<p dir="auto"><em>From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/javadevmtl/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/javadevmtl">@javadevmtl</a> on June 7, 2016 21:10</em></p>

<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">New module</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Latest"><pre class="notranslate"><code class="notranslate">Latest
</code></pre></div>
<p dir="auto">Hi the default IIS module are ok for doing simple tasks. But the moment you need to configure anything complex you need to dive into using appcmd command.</p>
<p dir="auto">For instance I have the following playbook command that registers an ISAPi DLL with IIS. The command works fine, but on secondary run because the task doesn't recognize the semantics of the command line it returns a failure. Basically it complains of a duplicate.</p>
<p dir="auto">The command runs good on the first try:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    - name: Allow ISAPI DLL
      ignore_errors: yes
      raw: c:/Windows/System32/inetsrv/appcmd.exe set config -section:system.webServer/security/isapiCgiRestriction /+&quot;[path='path-to-dll.dll',allowed='True',groupId='SomeGroupId',description='My DLL']&quot; /commit:apphost"><pre class="notranslate"><code class="notranslate">    - name: Allow ISAPI DLL
      ignore_errors: yes
      raw: c:/Windows/System32/inetsrv/appcmd.exe set config -section:system.webServer/security/isapiCgiRestriction /+"[path='path-to-dll.dll',allowed='True',groupId='SomeGroupId',description='My DLL']" /commit:apphost
</code></pre></div>
<p dir="auto">On second run:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ERROR ( message:New add object missing required attributes. Cannot add duplicate collection entry of type 'add' with unique key attribute 'path' set to 'path-to-dll.dll',,. )]"><pre class="notranslate"><code class="notranslate">[ERROR ( message:New add object missing required attributes. Cannot add duplicate collection entry of type 'add' with unique key attribute 'path' set to 'path-to-dll.dll',,. )]
</code></pre></div>
<p dir="auto">We can ignore the error, but it would be nice if it could integrate natively with Ansible states such as "present", etc...</p>
<p dir="auto">Here is some more info on appcmd: <a href="http://www.iis.net/learn/get-started/getting-started-with-iis/getting-started-with-appcmdexe" rel="nofollow">http://www.iis.net/learn/get-started/getting-started-with-iis/getting-started-with-appcmdexe</a></p>
<p dir="auto">Basically it's a command line interface that lets you configure any part of IIS, which lends itself well for Ansible :)</p>
<p dir="auto"><em>Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="159025458" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-extras/issues/2386" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-extras/issues/2386/hovercard" href="https://github.com/ansible/ansible-modules-extras/issues/2386">ansible/ansible-modules-extras#2386</a></em></p>