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

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>

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

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2.4.2.0"><pre class="notranslate"><code class="notranslate">2.4.2.0
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">Mac OS X</p>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto">ansible role's dependency is called only once although it is called twice with defferent parameters.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>


<p dir="auto">roles/foo/meta/main.yml</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="---
dependencies:
  - role: hello
    name: &quot;{{key}}&quot;"><pre class="notranslate">---
<span class="pl-ent">dependencies</span>:
  - <span class="pl-ent">role</span>: <span class="pl-s">hello</span>
    <span class="pl-ent">name</span>: <span class="pl-s"><span class="pl-pds">"</span>{{key}}<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">roles/hello/tasks/main.yml</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="---
- debug:
    var: name"><pre class="notranslate">---
- <span class="pl-ent">debug</span>:
    <span class="pl-ent">var</span>: <span class="pl-s">name</span></pre></div>
<p dir="auto">playbook.yml</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="---
- hosts: localhost
  roles:
    - role: foo
      key: foo
    - role: foo
      key: bar"><pre class="notranslate">---
- <span class="pl-ent">hosts</span>: <span class="pl-s">localhost</span>
  <span class="pl-ent">roles</span>:
    - <span class="pl-ent">role</span>: <span class="pl-s">foo</span>
      <span class="pl-ent">key</span>: <span class="pl-s">foo</span>
    - <span class="pl-ent">role</span>: <span class="pl-s">foo</span>
      <span class="pl-ent">key</span>: <span class="pl-s">bar</span></pre></div>

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

<p dir="auto">When the playbook is run, the role <code class="notranslate">hello</code> is called twice because roles <code class="notranslate">foo</code> and <code class="notranslate">hello</code> are called twice with different parameters.</p>
<p dir="auto"><a href="http://docs.ansible.com/ansible/latest/playbooks_reuse_roles.html#role-duplication-and-execution" rel="nofollow">http://docs.ansible.com/ansible/latest/playbooks_reuse_roles.html#role-duplication-and-execution</a></p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="PLAY [localhost] *****************************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************
ok: [localhost]

TASK [hello : debug] *************************************************************************************************************
ok: [localhost] =&gt; {
    &quot;name&quot;: &quot;foo&quot;
}

TASK [hello : debug] *************************************************************************************************************
ok: [localhost] =&gt; {
    &quot;name&quot;: &quot;bar&quot;
}

PLAY RECAP ***********************************************************************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=0"><pre class="notranslate"><span class="pl-s">PLAY [localhost] *****************************************************************************************************************</span>

<span class="pl-s">TASK [Gathering Facts] ***********************************************************************************************************</span>
<span class="pl-ent">ok</span>: <span class="pl-s">[localhost]</span>

<span class="pl-ent">TASK [hello </span>: <span class="pl-s">debug] *************************************************************************************************************</span>
<span class="pl-ent">ok</span>: <span class="pl-s">[localhost] =&gt; {</span>
    <span class="pl-s"><span class="pl-pds">"</span><span class="pl-ent">name</span><span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>foo<span class="pl-pds">"</span></span>
<span class="pl-s">}</span>

<span class="pl-ent">TASK [hello </span>: <span class="pl-s">debug] *************************************************************************************************************</span>
<span class="pl-ent">ok</span>: <span class="pl-s">[localhost] =&gt; {</span>
    <span class="pl-s"><span class="pl-pds">"</span><span class="pl-ent">name</span><span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>bar<span class="pl-pds">"</span></span>
<span class="pl-s">}</span>

<span class="pl-s">PLAY RECAP ***********************************************************************************************************************</span>
<span class="pl-ent">localhost                  </span>: <span class="pl-s">ok=3    changed=0    unreachable=0    failed=0</span></pre></div>
<h5 dir="auto">ACTUAL RESULTS</h5>

<p dir="auto">The role <code class="notranslate">hello</code> is called only once.</p>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [localhost] *****************************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************
ok: [localhost]

TASK [hello : debug] *************************************************************************************************************
ok: [localhost] =&gt; {
    &quot;name&quot;: &quot;foo&quot;
}

PLAY RECAP ***********************************************************************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=0"><pre class="notranslate"><code class="notranslate">PLAY [localhost] *****************************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************
ok: [localhost]

TASK [hello : debug] *************************************************************************************************************
ok: [localhost] =&gt; {
    "name": "foo"
}

PLAY RECAP ***********************************************************************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=0
</code></pre></div>
<p dir="auto"><code class="notranslate">os_stack</code> will attempt an update if the stack is present. When it does the update HOT parameters are not applied.</p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">os_stack</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.2.0
  config file =
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.2.2.0
  config file =
  configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">SUMMARY</h5>

<h5 dir="auto">STEPS TO REPRODUCE</h5>
<ul dir="auto">
<li>create a Heat Template (hot) yaml file with parameters</li>
<li>Run play to create stack</li>
<li>Run play again and<br>
** if the parameter was mandatory you get a 400 bad request<br>
** if the parameter has a default it will use this instead</li>
</ul>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- name: create stack
  register: stack_create
  os_stack:
    name: test-stack
    state: present
    template: &quot;../heat/teststack.yaml&quot;
    parameters:
      default_net: 7acd9647-4b84-4edd-b618-123f6cb82c3f
      server_flavor: m1.medium"><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">create stack</span>
  <span class="pl-ent">register</span>: <span class="pl-s">stack_create</span>
  <span class="pl-ent">os_stack</span>:
    <span class="pl-ent">name</span>: <span class="pl-s">test-stack</span>
    <span class="pl-ent">state</span>: <span class="pl-s">present</span>
    <span class="pl-ent">template</span>: <span class="pl-s"><span class="pl-pds">"</span>../heat/teststack.yaml<span class="pl-pds">"</span></span>
    <span class="pl-ent">parameters</span>:
      <span class="pl-ent">default_net</span>: <span class="pl-s">7acd9647-4b84-4edd-b618-123f6cb82c3f</span>
      <span class="pl-ent">server_flavor</span>: <span class="pl-s">m1.medium</span></pre></div>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="heat_template_version: 2015-10-15

parameters:
  server_flavor:
    type: string
    description: size of the server instances

  default_net:
    type: string
    description: Id of default-net
    default: 7acd9647-4b84-4edd-b618-123f6cb82c3f
..."><pre class="notranslate"><span class="pl-ent">heat_template_version</span>: <span class="pl-c1">2015-10-15</span>

<span class="pl-ent">parameters</span>:
  <span class="pl-ent">server_flavor</span>:
    <span class="pl-ent">type</span>: <span class="pl-s">string</span>
    <span class="pl-ent">description</span>: <span class="pl-s">size of the server instances</span>

  <span class="pl-ent">default_net</span>:
    <span class="pl-ent">type</span>: <span class="pl-s">string</span>
    <span class="pl-ent">description</span>: <span class="pl-s">Id of default-net</span>
    <span class="pl-ent">default</span>: <span class="pl-s">7acd9647-4b84-4edd-b618-123f6cb82c3f</span>
...</pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Stack update with parameters</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">Debug shows the parameters, but they appear to be omitted from the API call. Below is 400 because there was no default for <code class="notranslate">server_flavor</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fatal: [localhost]: FAILED! =&gt; {
    &quot;changed&quot;: false,
    &quot;failed&quot;: true,
    &quot;invocation&quot;: {
        &quot;module_args&quot;: {
            &quot;api_timeout&quot;: null,
            &quot;auth&quot;: null,
            &quot;auth_type&quot;: null,
            &quot;availability_zone&quot;: null,
            &quot;cacert&quot;: null,
            &quot;cert&quot;: null,
            &quot;cloud&quot;: null,
            &quot;endpoint_type&quot;: &quot;public&quot;,
            &quot;environment&quot;: null,
            &quot;key&quot;: null,
            &quot;name&quot;: &quot;test-stack&quot;,
            &quot;parameters&quot;: {
                &quot;default_net&quot;: &quot;7acd9647-4b84-4edd-b618-123f6cb82c3f&quot;,
                &quot;server_flavor&quot;: &quot;m1.medium&quot;
            },
            &quot;region_name&quot;: null,
            &quot;rollback&quot;: false,
            &quot;state&quot;: &quot;present&quot;,
            &quot;template&quot;: &quot;../heat/teststack.yaml&quot;,
            &quot;timeout&quot;: 3600,
            &quot;verify&quot;: true,
            &quot;wait&quot;: true
        },
        &quot;module_name&quot;: &quot;os_stack&quot;
    },
    &quot;msg&quot;: &quot;(400) Client Error: Bad Request"><pre class="notranslate"><code class="notranslate">fatal: [localhost]: FAILED! =&gt; {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_args": {
            "api_timeout": null,
            "auth": null,
            "auth_type": null,
            "availability_zone": null,
            "cacert": null,
            "cert": null,
            "cloud": null,
            "endpoint_type": "public",
            "environment": null,
            "key": null,
            "name": "test-stack",
            "parameters": {
                "default_net": "7acd9647-4b84-4edd-b618-123f6cb82c3f",
                "server_flavor": "m1.medium"
            },
            "region_name": null,
            "rollback": false,
            "state": "present",
            "template": "../heat/teststack.yaml",
            "timeout": 3600,
            "verify": true,
            "wait": true
        },
        "module_name": "os_stack"
    },
    "msg": "(400) Client Error: Bad Request
</code></pre></div>
<p dir="auto">** if the parameter has a default it will use this instead<br>
If <code class="notranslate">server_flavour</code> has the following the instances will resize</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    default: m1.small"><pre class="notranslate"><code class="notranslate">    default: m1.small
</code></pre></div>