<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">Variable expansion/core.</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto">Tried with both 1.9.x and 2.1.x, but different failures occur (see below for details).</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 1.9.6
  configured module search path = None"><pre class="notranslate"><code class="notranslate">ansible 1.9.6
  configured module search path = None
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.1.0.0
  config file = 
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.1.0.0
  config file = 
  configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">Only the <strong>ANSIBLE_HOSTS</strong> to point to correct inventory.</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Gentoo 64-bit, Ansible installed via virtualenv, local actions only.</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Nested variables from group_vars are not fully expanded when used in handler names.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<ol dir="auto">
<li>Create a simple role (useful to allow duplicates for testing) that has single task which triggers a handler that contains variable expansion in its name, for example <code class="notranslate">Handler {{ myvar }}</code>.</li>
<li>Create a group vars file that defines a single variable (not the <code class="notranslate">myvar</code> one).</li>
<li>Run a playbook that invokes the role by passing in the variable value. The value should reference the variable defined in group_vars. For example <code class="notranslate">myvar: "this_is_{{ blah }}"</code>.</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# ./test.yml
- hosts: localhost
  roles:
    - role: sample
      myvar: &quot;not_nested&quot;
    - role: sample
      myvar: &quot;nested_with_{{ inlinevar }}&quot;
    - role: sample
      anothervar: anothervar
      myvar: &quot;nested_with_{{ anothervar }}&quot;

# ./hosts
localhost ansible_connection=local

# ./group_vars/all.yml

---

inlinevar: &quot;inline_variable&quot;

# ./roles/sample/meta/main.yml

---

allow_duplicates: yes

# ./roles/sample/tasks/main.yml

---

- debug: msg=&quot;Triggering change with myvar set to {{ myvar }}&quot;
  changed_when: True
  notify:
    - &quot;Notify handler {{ myvar }}&quot;

# ./roles/sample/handlers/main.yml

---

- name: &quot;Notify handler {{ myvar }}&quot;
  debug: msg=&quot;Handler got notified with myvar set to {{ myvar }}&quot;"><pre class="notranslate"><code class="notranslate"># ./test.yml
- hosts: localhost
  roles:
    - role: sample
      myvar: "not_nested"
    - role: sample
      myvar: "nested_with_{{ inlinevar }}"
    - role: sample
      anothervar: anothervar
      myvar: "nested_with_{{ anothervar }}"

# ./hosts
localhost ansible_connection=local

# ./group_vars/all.yml

---

inlinevar: "inline_variable"

# ./roles/sample/meta/main.yml

---

allow_duplicates: yes

# ./roles/sample/tasks/main.yml

---

- debug: msg="Triggering change with myvar set to {{ myvar }}"
  changed_when: True
  notify:
    - "Notify handler {{ myvar }}"

# ./roles/sample/handlers/main.yml

---

- name: "Notify handler {{ myvar }}"
  debug: msg="Handler got notified with myvar set to {{ myvar }}"
</code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">When handlers are run, all variables, including nested ones, have been fully expanded. Example output would be:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="NOTIFIED: [sample | Notify handler nested_with_inline_variable] *************** 
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;Handler got notified with myvar set to nested_with_inline_variable&quot;
}"><pre class="notranslate"><code class="notranslate">NOTIFIED: [sample | Notify handler nested_with_inline_variable] *************** 
ok: [localhost] =&gt; {
    "msg": "Handler got notified with myvar set to nested_with_inline_variable"
}
</code></pre></div>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">With Ansible 1.9.6:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [localhost] ************************************************************** 

GATHERING FACTS *************************************************************** 
&lt;localhost&gt; REMOTE_MODULE setup
&lt;localhost&gt; EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1466243767.71-214122205397002 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1466243767.71-214122205397002 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1466243767.71-214122205397002']
&lt;localhost&gt; PUT /tmp/tmpSYEsgV TO /home/branko/.ansible/tmp/ansible-tmp-1466243767.71-214122205397002/setup
&lt;localhost&gt; EXEC ['/bin/sh', '-c', u'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /home/branko/.ansible/tmp/ansible-tmp-1466243767.71-214122205397002/setup; rm -rf /home/branko/.ansible/tmp/ansible-tmp-1466243767.71-214122205397002/ &gt;/dev/null 2&gt;&amp;1']
ok: [localhost]

TASK: [sample | debug msg=&quot;Triggering change with myvar set to not_nested&quot;] *** 
changed: [localhost] =&gt; {
    &quot;changed&quot;: true, 
    &quot;msg&quot;: &quot;Triggering change with myvar set to not_nested&quot;
}

TASK: [sample | debug msg=&quot;Triggering change with myvar set to nested_with_{{ inlinevar }}&quot;] *** 
changed: [localhost] =&gt; {
    &quot;changed&quot;: true, 
    &quot;msg&quot;: &quot;Triggering change with myvar set to nested_with_inline_variable&quot;
}

TASK: [sample | debug msg=&quot;Triggering change with myvar set to nested_with_anothervar&quot;] *** 
changed: [localhost] =&gt; {
    &quot;changed&quot;: true, 
    &quot;msg&quot;: &quot;Triggering change with myvar set to nested_with_anothervar&quot;
}

NOTIFIED: [sample | Notify handler not_nested] ******************************** 
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;Handler got notified with myvar set to not_nested&quot;
}

NOTIFIED: [sample | Notify handler nested_with_{{ inlinevar }}] *************** 
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;Handler got notified with myvar set to nested_with_inline_variable&quot;
}

NOTIFIED: [sample | Notify handler nested_with_anothervar] ******************** 
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;Handler got notified with myvar set to nested_with_anothervar&quot;
}

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

GATHERING FACTS *************************************************************** 
&lt;localhost&gt; REMOTE_MODULE setup
&lt;localhost&gt; EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1466243767.71-214122205397002 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1466243767.71-214122205397002 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1466243767.71-214122205397002']
&lt;localhost&gt; PUT /tmp/tmpSYEsgV TO /home/branko/.ansible/tmp/ansible-tmp-1466243767.71-214122205397002/setup
&lt;localhost&gt; EXEC ['/bin/sh', '-c', u'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /home/branko/.ansible/tmp/ansible-tmp-1466243767.71-214122205397002/setup; rm -rf /home/branko/.ansible/tmp/ansible-tmp-1466243767.71-214122205397002/ &gt;/dev/null 2&gt;&amp;1']
ok: [localhost]

TASK: [sample | debug msg="Triggering change with myvar set to not_nested"] *** 
changed: [localhost] =&gt; {
    "changed": true, 
    "msg": "Triggering change with myvar set to not_nested"
}

TASK: [sample | debug msg="Triggering change with myvar set to nested_with_{{ inlinevar }}"] *** 
changed: [localhost] =&gt; {
    "changed": true, 
    "msg": "Triggering change with myvar set to nested_with_inline_variable"
}

TASK: [sample | debug msg="Triggering change with myvar set to nested_with_anothervar"] *** 
changed: [localhost] =&gt; {
    "changed": true, 
    "msg": "Triggering change with myvar set to nested_with_anothervar"
}

NOTIFIED: [sample | Notify handler not_nested] ******************************** 
ok: [localhost] =&gt; {
    "msg": "Handler got notified with myvar set to not_nested"
}

NOTIFIED: [sample | Notify handler nested_with_{{ inlinevar }}] *************** 
ok: [localhost] =&gt; {
    "msg": "Handler got notified with myvar set to nested_with_inline_variable"
}

NOTIFIED: [sample | Notify handler nested_with_anothervar] ******************** 
ok: [localhost] =&gt; {
    "msg": "Handler got notified with myvar set to nested_with_anothervar"
}

PLAY RECAP ******************************************************************** 
localhost                  : ok=7    changed=3    unreachable=0    failed=0   
</code></pre></div>
<p dir="auto">With Ansible 2.1.0 (notice that the handler is not executed at all):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="No config file found; using defaults
Loaded callback default of type stdout, v2.0

PLAYBOOK: test.yml *************************************************************
1 plays in test.yml

PLAY [localhost] ***************************************************************

TASK [setup] *******************************************************************
&lt;localhost&gt; ESTABLISH LOCAL CONNECTION FOR USER: branko
&lt;localhost&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1466243803.88-148745907678470 `&quot; &amp;&amp; echo ansible-tmp-1466243803.88-148745907678470=&quot;` echo $HOME/.ansible/tmp/ansible-tmp-1466243803.88-148745907678470 `&quot; ) &amp;&amp; sleep 0'
&lt;localhost&gt; PUT /tmp/tmp_w1mcm TO /home/branko/.ansible/tmp/ansible-tmp-1466243803.88-148745907678470/setup
&lt;localhost&gt; EXEC /bin/sh -c 'LANG=en_US.utf8 LC_ALL=en_US.utf8 LC_MESSAGES=en_US.utf8 /usr/bin/python /home/branko/.ansible/tmp/ansible-tmp-1466243803.88-148745907678470/setup; rm -rf &quot;/home/branko/.ansible/tmp/ansible-tmp-1466243803.88-148745907678470/&quot; &gt; /dev/null 2&gt;&amp;1 &amp;&amp; sleep 0'
ok: [localhost]

TASK [sample : debug] **********************************************************
task path: /home/branko/projects/anstest/roles/sample/tasks/main.yml:3
NOTIFIED HANDLER Notify handler not_nested
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;Triggering change with myvar set to not_nested&quot;
}

TASK [sample : debug] **********************************************************
task path: /home/branko/projects/anstest/roles/sample/tasks/main.yml:3
NOTIFIED HANDLER Notify handler nested_with_inline_variable
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;Triggering change with myvar set to nested_with_inline_variable&quot;
}

TASK [sample : debug] **********************************************************
task path: /home/branko/projects/anstest/roles/sample/tasks/main.yml:3
NOTIFIED HANDLER Notify handler nested_with_anothervar
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;Triggering change with myvar set to nested_with_anothervar&quot;
}

RUNNING HANDLER [sample : Notify handler not_nested] ***************************
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;Handler got notified with myvar set to not_nested&quot;
}

RUNNING HANDLER [sample : Notify handler nested_with_anothervar] ***************
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;Handler got notified with myvar set to nested_with_anothervar&quot;
}

PLAY RECAP *********************************************************************
localhost                  : ok=6    changed=3    unreachable=0    failed=0   "><pre class="notranslate"><code class="notranslate">No config file found; using defaults
Loaded callback default of type stdout, v2.0

PLAYBOOK: test.yml *************************************************************
1 plays in test.yml

PLAY [localhost] ***************************************************************

TASK [setup] *******************************************************************
&lt;localhost&gt; ESTABLISH LOCAL CONNECTION FOR USER: branko
&lt;localhost&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1466243803.88-148745907678470 `" &amp;&amp; echo ansible-tmp-1466243803.88-148745907678470="` echo $HOME/.ansible/tmp/ansible-tmp-1466243803.88-148745907678470 `" ) &amp;&amp; sleep 0'
&lt;localhost&gt; PUT /tmp/tmp_w1mcm TO /home/branko/.ansible/tmp/ansible-tmp-1466243803.88-148745907678470/setup
&lt;localhost&gt; EXEC /bin/sh -c 'LANG=en_US.utf8 LC_ALL=en_US.utf8 LC_MESSAGES=en_US.utf8 /usr/bin/python /home/branko/.ansible/tmp/ansible-tmp-1466243803.88-148745907678470/setup; rm -rf "/home/branko/.ansible/tmp/ansible-tmp-1466243803.88-148745907678470/" &gt; /dev/null 2&gt;&amp;1 &amp;&amp; sleep 0'
ok: [localhost]

TASK [sample : debug] **********************************************************
task path: /home/branko/projects/anstest/roles/sample/tasks/main.yml:3
NOTIFIED HANDLER Notify handler not_nested
ok: [localhost] =&gt; {
    "msg": "Triggering change with myvar set to not_nested"
}

TASK [sample : debug] **********************************************************
task path: /home/branko/projects/anstest/roles/sample/tasks/main.yml:3
NOTIFIED HANDLER Notify handler nested_with_inline_variable
ok: [localhost] =&gt; {
    "msg": "Triggering change with myvar set to nested_with_inline_variable"
}

TASK [sample : debug] **********************************************************
task path: /home/branko/projects/anstest/roles/sample/tasks/main.yml:3
NOTIFIED HANDLER Notify handler nested_with_anothervar
ok: [localhost] =&gt; {
    "msg": "Triggering change with myvar set to nested_with_anothervar"
}

RUNNING HANDLER [sample : Notify handler not_nested] ***************************
ok: [localhost] =&gt; {
    "msg": "Handler got notified with myvar set to not_nested"
}

RUNNING HANDLER [sample : Notify handler nested_with_anothervar] ***************
ok: [localhost] =&gt; {
    "msg": "Handler got notified with myvar set to nested_with_anothervar"
}

PLAY RECAP *********************************************************************
localhost                  : ok=6    changed=3    unreachable=0    failed=0   
</code></pre></div>
<p dir="auto">Split changelog into file per release, it is getting unwieldy, also it would be nice to create ToC and sunset the RELEASES.txt as it is mostly duplicate information.</p>
<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Feature Idea</li>
<li>Documentation Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>

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

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2.5"><pre class="notranslate"><code class="notranslate">2.5
</code></pre></div>