Hi,
My hosts file:
[ebs]
xx.xx.xx.xx
[source]
xx.xx.xx.xx
playbook:
Hi,
My hosts file:
[ebs]
xx.xx.xx.xx
[source]
xx.xx.xx.xx
playbook:
Hello,
If you set your hosts to ‘source’ the playbook will only be able to be run on hosts listed under the [source] group, therefore you cant delegate to a host not in the group you’re telling it to look at
Further Example:
Hosts file:
[group1]
server1
server2
[group2]
server3
server4
Playbook:
But, in my case what can be the value for the delegate_to
like:
delegate_to: xx.xx.xx.xx # ip address ?? then it will became static .
is there any option to provide like
delegate_to: group2[1] ??
let us say host file look like:
[source]
xx.xx.xx.xx
xx.xx.xx.xx
i tried the other way like:
hosts: source[0]
by the way i tried like this:
script is running but it stuck’s at:
PLAY [oraclesource[0]] ***************************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************************************
ok: [10.210.8.149]
TASK [copy file from 147 to 149 from 141] ********************************************************************************************
this is where the program is being idle
I’m not sure totally how running an inventory dynamically with a [1] etc. works.
Have you tried running that last part with a -vvvv option? It looks like its now got to the point where it knows about the host but is hanging copying the file. So your inventory should be okay if its got past there
getting this…
<10.210.8.150> ESTABLISH SSH CONNECTION FOR USER: root
<10.210.8.150> SSH: EXEC sshpass -d11 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o User=root -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o ControlPath=/root/.ansible/cp/a26ba33a59 10.210.8.150 ‘/bin/sh -c ‘"’“‘chmod u+x /root/.ansible/tmp/ansible-tmp-1515147067.67-174395529194101/ /root/.ansible/tmp/ansible-tmp-1515147067.67-174395529194101/synchronize.py && sleep 0’”’“‘’
<10.210.8.150> (0, ‘’, ‘’)
<10.210.8.150> ESTABLISH SSH CONNECTION FOR USER: root
<10.210.8.150> SSH: EXEC sshpass -d11 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o User=root -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o ControlPath=/root/.ansible/cp/a26ba33a59 -tt 10.210.8.150 '/bin/sh -c '”‘"’/usr/bin/python /root/.ansible/tmp/ansible-tmp-1515147067.67-174395529194101/synchronize.py; rm -rf “/root/.ansible/tmp/ansible-tmp-1515147067.67-174395529194101/” > /dev/null 2>&1 && sleep 0’“'”‘’