Issue 1:
Issue Type:

Bug Report

Ansible Version:

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

Ansible Configuration:

None.

Environment:

Control machine: OS X 10.11.3

Managed OS: Debian Wheezy

Summary:

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.

Unfortunately, this breaks with delegation. Ansible connects to the play host, not to the host I delegated to, because of the template evaluation.

I found this issue on GitHub: #10781. 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.

Steps To Reproduce:

Playbook:

- hosts: osf4-management1
gather_facts: no
tasks:
- ping:
- ping:
delegate_to: osf4-nfs1

Inventory:

osf4-management1
osf4-nfs1

[all:vars]
ansible_host={{inventory_hostname}}.osf.credativ.lan

Command:

$ ansible-playbook -i hosts playbook.yml -vvv

Expected Results:

The first task executes on osf4-management1.osf.credativ.lan

The second task executes on osf4-nfs1.osf.credativ.lan

Actual Results:

The first task executes on osf4-management1.osf.credativ.lan

The second task executes on osf4-management1.osf.credativ.lan

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
<osf4-management1.osf.credativ.lan> ESTABLISH SSH CONNECTION FOR USER: None
<osf4-management1.osf.credativ.lan> 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 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1456317417.59-102056864626582 `" && echo "` echo $HOME/.ansible/tmp/ansible-tmp-1456317417.59-102056864626582 `" )'"'"''
<osf4-management1.osf.credativ.lan> PUT /var/folders/0w/8d7_0wfn4_5_rytt3201v0k00000gn/T/tmpyww60G TO /home/mga/.ansible/tmp/ansible-tmp-1456317417.59-102056864626582/ping
<osf4-management1.osf.credativ.lan> 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]'
<osf4-management1.osf.credativ.lan> ESTABLISH SSH CONNECTION FOR USER: None
<osf4-management1.osf.credativ.lan> 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/" > /dev/null 2>&1'"'"''
ok: [osf4-management1] => {"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
<osf4-management1.osf.credativ.lan> ESTABLISH SSH CONNECTION FOR USER: None
<osf4-management1.osf.credativ.lan> 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 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1456317417.91-272755064275497 `" && echo "` echo $HOME/.ansible/tmp/ansible-tmp-1456317417.91-272755064275497 `" )'"'"''
<osf4-management1.osf.credativ.lan> PUT /var/folders/0w/8d7_0wfn4_5_rytt3201v0k00000gn/T/tmpRFvwTK TO /home/mga/.ansible/tmp/ansible-tmp-1456317417.91-272755064275497/ping
<osf4-management1.osf.credativ.lan> 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]'
<osf4-management1.osf.credativ.lan> ESTABLISH SSH CONNECTION FOR USER: None
<osf4-management1.osf.credativ.lan> 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/" > /dev/null 2>&1'"'"''
ok: [osf4-management1 -> {{inventory_hostname}}.osf.credativ.lan] => {"changed": false, "invocation": {"module_args": {"data": null}, "module_name": "ping"}, "ping": "pong"}

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

Issue 2:
ISSUE TYPE

Bug Report

ANSIBLE VERSION

2.0.0-0.6.rc1

COMPONENT NAME

service_module

It was mentioned as became available in ansible 2.0 in doc: http://docs.ansible.com/ansible/service_module.html . It also was work as described.

In recent versions (2.0.0-0.6.rc1) it produce error:

fatal: [egais.db.slave1]: FAILED! => {"changed": false, "failed": true, "msg": "unsupported parameter for module: must_exist"}

And doc does not contain it.

Is that dropped? Why?