<h5 dir="auto">Issue Type:</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">Ansible Version:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.1.0 (devel 2db3f290ba) last updated 2016/02/24 13:31:18 (GMT +200)
  lib/ansible/modules/core: (detached HEAD 7162623e86) last updated 2016/02/24 13:31:26 (GMT +200)
  lib/ansible/modules/extras: (detached HEAD f5e798f13c) last updated 2016/02/24 13:31:29 (GMT +200)
  config file = 
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.1.0 (devel 2db3f290ba) last updated 2016/02/24 13:31:18 (GMT +200)
  lib/ansible/modules/core: (detached HEAD 7162623e86) last updated 2016/02/24 13:31:26 (GMT +200)
  lib/ansible/modules/extras: (detached HEAD f5e798f13c) last updated 2016/02/24 13:31:29 (GMT +200)
  config file = 
  configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">Ansible Configuration:</h5>
<p dir="auto">None.</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Control machine: OS X 10.11.3<br>
Managed OS: Debian Wheezy</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">I have a domain that I want to be appended to all hosts in the inventory. To reduce duplication, I thought I'd set ansible_host={{inventory_hostname}}.osf.credativ.lan.</p>
<p dir="auto">Unfortunately, this breaks with delegation. Ansible connects to the play host, not to the host I delegated to, because of the template evaluation.</p>
<p dir="auto">I found this issue on GitHub: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="69570091" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/10781" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/10781/hovercard" href="https://github.com/ansible/ansible/issues/10781">#10781</a>. It seems like a related problem at least, but to me it's not clear from the issue status whether it had been fixed or not.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">Playbook:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- hosts: osf4-management1
  gather_facts: no
  tasks:
    - ping:
    - ping:
      delegate_to: osf4-nfs1"><pre class="notranslate"><code class="notranslate">- hosts: osf4-management1
  gather_facts: no
  tasks:
    - ping:
    - ping:
      delegate_to: osf4-nfs1
</code></pre></div>
<p dir="auto">Inventory:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="osf4-management1
osf4-nfs1

[all:vars]
ansible_host={{inventory_hostname}}.osf.credativ.lan"><pre class="notranslate"><code class="notranslate">osf4-management1
osf4-nfs1

[all:vars]
ansible_host={{inventory_hostname}}.osf.credativ.lan
</code></pre></div>
<p dir="auto">Command:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ansible-playbook -i hosts playbook.yml -vvv"><pre class="notranslate"><code class="notranslate">$ ansible-playbook -i hosts playbook.yml -vvv
</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<ul dir="auto">
<li>The first task executes on osf4-management1.osf.credativ.lan</li>
<li>The second task executes on osf4-nfs1.osf.credativ.lan</li>
</ul>
<h5 dir="auto">Actual Results:</h5>
<ul dir="auto">
<li>The first task executes on osf4-management1.osf.credativ.lan</li>
<li>The second task executes on osf4-management1.osf.credativ.lan</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="No config file found; using defaults

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

PLAY ***************************************************************************

TASK [ping] ********************************************************************
task path: /Users/mga/Documents/Arbeitsmittel/Ansible-Bug mit ansible_host Template/playbook.yml:4
&lt;osf4-management1.osf.credativ.lan&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;osf4-management1.osf.credativ.lan&gt; SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/mga/.ansible/cp/ansible-ssh-%h-%p-%r -tt osf4-management1.osf.credativ.lan '/bin/sh -c '&quot;'&quot;'( umask 22 &amp;&amp; mkdir -p &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1456317417.59-102056864626582 `&quot; &amp;&amp; echo &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1456317417.59-102056864626582 `&quot; )'&quot;'&quot;''
&lt;osf4-management1.osf.credativ.lan&gt; PUT /var/folders/0w/8d7_0wfn4_5_rytt3201v0k00000gn/T/tmpyww60G TO /home/mga/.ansible/tmp/ansible-tmp-1456317417.59-102056864626582/ping
&lt;osf4-management1.osf.credativ.lan&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/mga/.ansible/cp/ansible-ssh-%h-%p-%r '[osf4-management1.osf.credativ.lan]'
&lt;osf4-management1.osf.credativ.lan&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;osf4-management1.osf.credativ.lan&gt; SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/mga/.ansible/cp/ansible-ssh-%h-%p-%r -tt osf4-management1.osf.credativ.lan '/bin/sh -c '&quot;'&quot;'LANG=de_DE.UTF-8 LC_ALL=de_DE.UTF-8 LC_MESSAGES=de_DE.UTF-8 /usr/bin/python /home/mga/.ansible/tmp/ansible-tmp-1456317417.59-102056864626582/ping; rm -rf &quot;/home/mga/.ansible/tmp/ansible-tmp-1456317417.59-102056864626582/&quot; &gt; /dev/null 2&gt;&amp;1'&quot;'&quot;''
ok: [osf4-management1] =&gt; {&quot;changed&quot;: false, &quot;invocation&quot;: {&quot;module_args&quot;: {&quot;data&quot;: null}, &quot;module_name&quot;: &quot;ping&quot;}, &quot;ping&quot;: &quot;pong&quot;}

TASK [ping] ********************************************************************
task path: /Users/mga/Documents/Arbeitsmittel/Ansible-Bug mit ansible_host Template/playbook.yml:5
&lt;osf4-management1.osf.credativ.lan&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;osf4-management1.osf.credativ.lan&gt; SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/mga/.ansible/cp/ansible-ssh-%h-%p-%r -tt osf4-management1.osf.credativ.lan '/bin/sh -c '&quot;'&quot;'( umask 22 &amp;&amp; mkdir -p &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1456317417.91-272755064275497 `&quot; &amp;&amp; echo &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1456317417.91-272755064275497 `&quot; )'&quot;'&quot;''
&lt;osf4-management1.osf.credativ.lan&gt; PUT /var/folders/0w/8d7_0wfn4_5_rytt3201v0k00000gn/T/tmpRFvwTK TO /home/mga/.ansible/tmp/ansible-tmp-1456317417.91-272755064275497/ping
&lt;osf4-management1.osf.credativ.lan&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/mga/.ansible/cp/ansible-ssh-%h-%p-%r '[osf4-management1.osf.credativ.lan]'
&lt;osf4-management1.osf.credativ.lan&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;osf4-management1.osf.credativ.lan&gt; SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/mga/.ansible/cp/ansible-ssh-%h-%p-%r -tt osf4-management1.osf.credativ.lan '/bin/sh -c '&quot;'&quot;'LANG=de_DE.UTF-8 LC_ALL=de_DE.UTF-8 LC_MESSAGES=de_DE.UTF-8 /usr/bin/python /home/mga/.ansible/tmp/ansible-tmp-1456317417.91-272755064275497/ping; rm -rf &quot;/home/mga/.ansible/tmp/ansible-tmp-1456317417.91-272755064275497/&quot; &gt; /dev/null 2&gt;&amp;1'&quot;'&quot;''
ok: [osf4-management1 -&gt; {{inventory_hostname}}.osf.credativ.lan] =&gt; {&quot;changed&quot;: false, &quot;invocation&quot;: {&quot;module_args&quot;: {&quot;data&quot;: null}, &quot;module_name&quot;: &quot;ping&quot;}, &quot;ping&quot;: &quot;pong&quot;}

PLAY RECAP *********************************************************************
osf4-management1           : ok=2    changed=0    unreachable=0    failed=0   
"><pre class="notranslate"><code class="notranslate">No config file found; using defaults

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

PLAY ***************************************************************************

TASK [ping] ********************************************************************
task path: /Users/mga/Documents/Arbeitsmittel/Ansible-Bug mit ansible_host Template/playbook.yml:4
&lt;osf4-management1.osf.credativ.lan&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;osf4-management1.osf.credativ.lan&gt; SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/mga/.ansible/cp/ansible-ssh-%h-%p-%r -tt osf4-management1.osf.credativ.lan '/bin/sh -c '"'"'( umask 22 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1456317417.59-102056864626582 `" &amp;&amp; echo "` echo $HOME/.ansible/tmp/ansible-tmp-1456317417.59-102056864626582 `" )'"'"''
&lt;osf4-management1.osf.credativ.lan&gt; PUT /var/folders/0w/8d7_0wfn4_5_rytt3201v0k00000gn/T/tmpyww60G TO /home/mga/.ansible/tmp/ansible-tmp-1456317417.59-102056864626582/ping
&lt;osf4-management1.osf.credativ.lan&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/mga/.ansible/cp/ansible-ssh-%h-%p-%r '[osf4-management1.osf.credativ.lan]'
&lt;osf4-management1.osf.credativ.lan&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;osf4-management1.osf.credativ.lan&gt; SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/mga/.ansible/cp/ansible-ssh-%h-%p-%r -tt osf4-management1.osf.credativ.lan '/bin/sh -c '"'"'LANG=de_DE.UTF-8 LC_ALL=de_DE.UTF-8 LC_MESSAGES=de_DE.UTF-8 /usr/bin/python /home/mga/.ansible/tmp/ansible-tmp-1456317417.59-102056864626582/ping; rm -rf "/home/mga/.ansible/tmp/ansible-tmp-1456317417.59-102056864626582/" &gt; /dev/null 2&gt;&amp;1'"'"''
ok: [osf4-management1] =&gt; {"changed": false, "invocation": {"module_args": {"data": null}, "module_name": "ping"}, "ping": "pong"}

TASK [ping] ********************************************************************
task path: /Users/mga/Documents/Arbeitsmittel/Ansible-Bug mit ansible_host Template/playbook.yml:5
&lt;osf4-management1.osf.credativ.lan&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;osf4-management1.osf.credativ.lan&gt; SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/mga/.ansible/cp/ansible-ssh-%h-%p-%r -tt osf4-management1.osf.credativ.lan '/bin/sh -c '"'"'( umask 22 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1456317417.91-272755064275497 `" &amp;&amp; echo "` echo $HOME/.ansible/tmp/ansible-tmp-1456317417.91-272755064275497 `" )'"'"''
&lt;osf4-management1.osf.credativ.lan&gt; PUT /var/folders/0w/8d7_0wfn4_5_rytt3201v0k00000gn/T/tmpRFvwTK TO /home/mga/.ansible/tmp/ansible-tmp-1456317417.91-272755064275497/ping
&lt;osf4-management1.osf.credativ.lan&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/mga/.ansible/cp/ansible-ssh-%h-%p-%r '[osf4-management1.osf.credativ.lan]'
&lt;osf4-management1.osf.credativ.lan&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;osf4-management1.osf.credativ.lan&gt; SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/mga/.ansible/cp/ansible-ssh-%h-%p-%r -tt osf4-management1.osf.credativ.lan '/bin/sh -c '"'"'LANG=de_DE.UTF-8 LC_ALL=de_DE.UTF-8 LC_MESSAGES=de_DE.UTF-8 /usr/bin/python /home/mga/.ansible/tmp/ansible-tmp-1456317417.91-272755064275497/ping; rm -rf "/home/mga/.ansible/tmp/ansible-tmp-1456317417.91-272755064275497/" &gt; /dev/null 2&gt;&amp;1'"'"''
ok: [osf4-management1 -&gt; {{inventory_hostname}}.osf.credativ.lan] =&gt; {"changed": false, "invocation": {"module_args": {"data": null}, "module_name": "ping"}, "ping": "pong"}

PLAY RECAP *********************************************************************
osf4-management1           : ok=2    changed=0    unreachable=0    failed=0   

</code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto">2.0.0-0.6.rc1</p>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">service_module</p>
<p dir="auto">It was mentioned as became available in ansible 2.0 in doc: <a href="http://docs.ansible.com/ansible/service_module.html" rel="nofollow">http://docs.ansible.com/ansible/service_module.html</a> . It also was work as described.</p>
<p dir="auto">In recent versions (2.0.0-0.6.rc1) it produce error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fatal: [egais.db.slave1]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;failed&quot;: true, &quot;msg&quot;: &quot;unsupported parameter for module: must_exist&quot;}"><pre class="notranslate"><code class="notranslate">fatal: [egais.db.slave1]: FAILED! =&gt; {"changed": false, "failed": true, "msg": "unsupported parameter for module: must_exist"}
</code></pre></div>
<p dir="auto">And doc does not contain it.</p>
<p dir="auto">Is that dropped? Why?</p>