<p dir="auto">Currently, the meta/main.yml file in roles supports controlling whether duplicate dependencies will be allowed based on the <code class="notranslate">allow_duplicates</code> field at the root level.  However, it's possible that some dependencies should not be duplicated, while others within the same file should be.</p>
<p dir="auto"><strong>Implementation:</strong> <code class="notranslate">allow_duplicates</code> could remain at the root level, while <code class="notranslate">allow_duplicate</code> could be passed in each dependency block to override the root setting.</p>
<p dir="auto"><strong>Use case:</strong> A role to install an application from a git repo depends on nginx and PHP, and so is dependent upon the 'webserver' role.  If a server runs more than one application, webserver itself should not be loaded again.</p>
<p dir="auto">However, another 'application_release' role may be responsible for following a long series of steps to install an application, such as cloning/updating it from git, running make, copying this release into a new folder, symlinking a 'current_release' folder to the new release, deleting old releases, etc.  This role is appropriate for application-specific roles to load more than once, with different variables to control the git repo, version, application name, etc.</p>
<p dir="auto">In the above, one would require the 'webserver' dependency to not be duplicated, but the 'appliaction_release' role be duplicated as often as other roles require it.</p>
<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">aci_ap but I guess similar for other aci_* modules</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.4.2.0
  config file = /home/dhamann/ddsdnlab.at/ansible_aci_buildout/ansible.cfg
  configured module search path = [u'/home/dhamann/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.12 (default, Nov 20 2017, 18:23:56) [GCC 5.4.0 20160609]
"><pre class="notranslate"><code class="notranslate">ansible 2.4.2.0
  config file = /home/dhamann/ddsdnlab.at/ansible_aci_buildout/ansible.cfg
  configured module search path = [u'/home/dhamann/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.12 (default, Nov 20 2017, 18:23:56) [GCC 5.4.0 20160609]

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

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="DEFAULT_STDOUT_CALLBACK(/home/dhamann/ddsdnlab.at/ansible_aci_buildout/ansible.cfg) = skippy
RETRY_FILES_ENABLED(/home/dhamann/ddsdnlab.at/ansible_aci_buildout/ansible.cfg) = False"><pre class="notranslate"><code class="notranslate">DEFAULT_STDOUT_CALLBACK(/home/dhamann/ddsdnlab.at/ansible_aci_buildout/ansible.cfg) = skippy
RETRY_FILES_ENABLED(/home/dhamann/ddsdnlab.at/ansible_aci_buildout/ansible.cfg) = False
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">N/A</p>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto">aci_ap module will fail for parameters contianing quotes (double or single)</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="    - name: Add Application Network Profile
      tags:
        - network
        - application
        - anp
        - test
      aci_ap:
        host: &quot;{{ apic_hostname }}&quot;
        username: &quot;{{ apic_username }}&quot;
        password: &quot;{{ apic_password }}&quot;
        validate_certs: false
        ap: legacy
        tenant: SDNLAB
        description: This ANP contains &quot;legacy&quot; networks
        state: present
      delegate_to: localhost"><pre class="notranslate">    - <span class="pl-ent">name</span>: <span class="pl-s">Add Application Network Profile</span>
      <span class="pl-ent">tags</span>:
        - <span class="pl-s">network</span>
        - <span class="pl-s">application</span>
        - <span class="pl-s">anp</span>
        - <span class="pl-s">test</span>
      <span class="pl-ent">aci_ap</span>:
        <span class="pl-ent">host</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ apic_hostname }}<span class="pl-pds">"</span></span>
        <span class="pl-ent">username</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ apic_username }}<span class="pl-pds">"</span></span>
        <span class="pl-ent">password</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ apic_password }}<span class="pl-pds">"</span></span>
        <span class="pl-ent">validate_certs</span>: <span class="pl-c1">false</span>
        <span class="pl-ent">ap</span>: <span class="pl-s">legacy</span>
        <span class="pl-ent">tenant</span>: <span class="pl-s">SDNLAB</span>
        <span class="pl-ent">description</span>: <span class="pl-s">This ANP contains "legacy" networks</span>
        <span class="pl-ent">state</span>: <span class="pl-s">present</span>
      <span class="pl-ent">delegate_to</span>: <span class="pl-s">localhost</span></pre></div>

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

<p dir="auto">Now that I think about it I'm not sure if this is even feasible to fix in Ansible, but since I already started with this bug report, please let me know what you think. It seems to me that APIC does not accept quotes (even properly escaped) in json payload. Should the aci modules therefore remove quotes from strings it passes on to APIC?</p>
<h5 dir="auto">ACTUAL RESULTS</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fatal: [apic.ddsdnlab.at -&gt; localhost]: FAILED! =&gt; {
    &quot;changed&quot;: false, 
    &quot;config&quot;: {
        &quot;fvAp&quot;: {
            &quot;attributes&quot;: {
                &quot;descr&quot;: &quot;This ANP contains \&quot;legacy\&quot; networks&quot;
            }
        }
    }, 
    &quot;error_code&quot;: &quot;801&quot;, 
    &quot;error_text&quot;: &quot;property descr of uni/tn-SDNLAB/ap-legacy failed validation for value 'This ANP contains \&quot;legacy\&quot; networks'&quot;, 
    &quot;existing&quot;: [
        {
            &quot;fvAp&quot;: {
                &quot;attributes&quot;: {
                    &quot;descr&quot;: &quot;This ANP contains legacy networks&quot;, 
                    &quot;dn&quot;: &quot;uni/tn-SDNLAB/ap-legacy&quot;, 
                    &quot;name&quot;: &quot;legacy&quot;, 
                    &quot;nameAlias&quot;: &quot;&quot;, 
                    &quot;ownerKey&quot;: &quot;&quot;, 
                    &quot;ownerTag&quot;: &quot;&quot;, 
                    &quot;prio&quot;: &quot;unspecified&quot;
                }
            }
        }
    ], 
    &quot;filter_string&quot;: &quot;?rsp-prop-include=config-only&quot;, 
    &quot;imdata&quot;: [
        {
            &quot;error&quot;: {
                &quot;attributes&quot;: {
                    &quot;code&quot;: &quot;801&quot;, 
                    &quot;text&quot;: &quot;property descr of uni/tn-SDNLAB/ap-legacy failed validation for value 'This ANP contains \&quot;legacy\&quot; networks'&quot;
                }
            }
        }
    ], 
    &quot;invocation&quot;: {
        &quot;module_args&quot;: {
            &quot;ap&quot;: &quot;legacy&quot;, 
            &quot;description&quot;: &quot;This ANP contains \&quot;legacy\&quot; networks&quot;, 
            &quot;host&quot;: &quot;apic.ddsdnlab.at&quot;, 
            &quot;hostname&quot;: &quot;apic.ddsdnlab.at&quot;, 
            &quot;method&quot;: null, 
            &quot;password&quot;: &quot;VALUE_SPECIFIED_IN_NO_LOG_PARAMETER&quot;, 
            &quot;protocol&quot;: &quot;https&quot;, 
            &quot;state&quot;: &quot;present&quot;, 
            &quot;tenant&quot;: &quot;SDNLAB&quot;, 
            &quot;timeout&quot;: 30, 
            &quot;use_proxy&quot;: true, 
            &quot;use_ssl&quot;: true, 
            &quot;username&quot;: &quot;apic:Local\\\\ansible&quot;, 
            &quot;validate_certs&quot;: false
        }
    }, 
    &quot;method&quot;: &quot;POST&quot;, 
    &quot;msg&quot;: &quot;Request failed: 801 property descr of uni/tn-SDNLAB/ap-legacy failed validation for value 'This ANP contains \&quot;legacy\&quot; networks'&quot;, 
    &quot;proposed&quot;: {
        &quot;fvAp&quot;: {
            &quot;attributes&quot;: {
                &quot;descr&quot;: &quot;This ANP contains \&quot;legacy\&quot; networks&quot;, 
                &quot;name&quot;: &quot;legacy&quot;
            }
        }
    }, 
    &quot;response&quot;: &quot;HTTP Error 400: Bad Request&quot;, 
    &quot;status&quot;: 400, 
    &quot;totalCount&quot;: &quot;1&quot;, 
    &quot;url&quot;: &quot;https://apic.ddsdnlab.at/api/mo/uni/tn-[SDNLAB]/ap-[legacy].json&quot;
}
"><pre class="notranslate"><code class="notranslate">fatal: [apic.ddsdnlab.at -&gt; localhost]: FAILED! =&gt; {
    "changed": false, 
    "config": {
        "fvAp": {
            "attributes": {
                "descr": "This ANP contains \"legacy\" networks"
            }
        }
    }, 
    "error_code": "801", 
    "error_text": "property descr of uni/tn-SDNLAB/ap-legacy failed validation for value 'This ANP contains \"legacy\" networks'", 
    "existing": [
        {
            "fvAp": {
                "attributes": {
                    "descr": "This ANP contains legacy networks", 
                    "dn": "uni/tn-SDNLAB/ap-legacy", 
                    "name": "legacy", 
                    "nameAlias": "", 
                    "ownerKey": "", 
                    "ownerTag": "", 
                    "prio": "unspecified"
                }
            }
        }
    ], 
    "filter_string": "?rsp-prop-include=config-only", 
    "imdata": [
        {
            "error": {
                "attributes": {
                    "code": "801", 
                    "text": "property descr of uni/tn-SDNLAB/ap-legacy failed validation for value 'This ANP contains \"legacy\" networks'"
                }
            }
        }
    ], 
    "invocation": {
        "module_args": {
            "ap": "legacy", 
            "description": "This ANP contains \"legacy\" networks", 
            "host": "apic.ddsdnlab.at", 
            "hostname": "apic.ddsdnlab.at", 
            "method": null, 
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", 
            "protocol": "https", 
            "state": "present", 
            "tenant": "SDNLAB", 
            "timeout": 30, 
            "use_proxy": true, 
            "use_ssl": true, 
            "username": "apic:Local\\\\ansible", 
            "validate_certs": false
        }
    }, 
    "method": "POST", 
    "msg": "Request failed: 801 property descr of uni/tn-SDNLAB/ap-legacy failed validation for value 'This ANP contains \"legacy\" networks'", 
    "proposed": {
        "fvAp": {
            "attributes": {
                "descr": "This ANP contains \"legacy\" networks", 
                "name": "legacy"
            }
        }
    }, 
    "response": "HTTP Error 400: Bad Request", 
    "status": 400, 
    "totalCount": "1", 
    "url": "https://apic.ddsdnlab.at/api/mo/uni/tn-[SDNLAB]/ap-[legacy].json"
}

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