Skip to content

Instantly share code, notes, and snippets.

@nrb

nrb/inventory.ini Secret

Last active Nov 30, 2016
Embed
What would you like to do?
Trying out ansible's group-of-groups behavior, where the top-level group also includes hosts. Targeting groups B &C do *not* include the parent and chidlren; targetting group A appears to get all hosts correctly.
[groupA]
containerA ansible_host=10.3.114
groupB
groupC
[groupB]
containerB ansible_host=10.3.45
[groupC]
containerC ansible_host=10.0.3.60
NAME STATE IPV4 IPV6 AUTOSTART
------------------------------------------------
containerA RUNNING 10.0.3.114 - NO
containerB RUNNING 10.0.3.45 - NO
containerC RUNNING 10.0.3.60 - NO
root@nrb-ord-aio:~# ansible -m ping -i inventory groupA
containerC | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 10.0.3.60 port 22: Connection refused\r\n",
"unreachable": true
}
containerA | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 10.3.114 port 22: Connection timed out\r\n",
"unreachable": true
}
containerB | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 10.3.45 port 22: Connection timed out\r\n",
"unreachable": true
}
root@nrb-ord-aio:~# ansible -m ping -i inventory groupC
containerC | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 10.0.3.60 port 22: Connection refused\r\n",
"unreachable": true
}
root@nrb-ord-aio:~# ansible -m ping -i inventory groupB
containerB | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 10.3.45 port 22: Connection timed out\r\n",
"unreachable": true
}
root@nrb-ord-aio:~# ansible -m ping -i inventory containerA
containerA | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 10.3.114 port 22: Connection timed out\r\n",
"unreachable": true
}
root@nrb-ord-aio:~# ansible -m ping -i inventory containerC
containerC | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 10.0.3.60 port 22: Connection refused\r\n",
"unreachable": true
}
root@nrb-ord-aio:~# ansible -m ping -i inventory containerB
containerB | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 10.3.45 port 22: Connection timed out\r\n",
"unreachable": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment