[jeff@lx00010300p ansible-production3]$ ansible -i hosts -m ping all
lx00011010d | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
lx00016141d | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
[jeff@lx00010300p ansible-production3]$ ansible -i hosts -m ping oracle
lx00011010d | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
[ifreling@lx00010300p ansible-production3]$ cat group_vars/oracle
---
users:
- username: roy
name: Roy
[ifreling@lx00010300p ansible-production3]$ cat group_vars/all
---
users:
- username: jeff
name: Jeff
[ifreling@lx00010300p ansible-production3]$ ansible-inventory -i hosts --list --vars
{
"_meta": {
"hostvars": {
"lx00011010d": {
"users": [
{
"name": "Roy",
"username": "roy"
}
]
},
"lx00016141d": {
"users": [
{
"name": "Jeff",
"username": "jeff"
}
]
}
}
},
"all": {
"children": [
"oracle",
"ungrouped",
"webmethods"
]
},
"oracle": {
"hosts": [
"lx00011010d"
]
},
"webmethods": {
"hosts": [
"lx00016141d"
]
}
}
[ifreling@lx00010300p ansible-production3]$ ansible-playbook -i hosts site.yml -C
PLAY [all] *********************************************************************************************************************************************************************
TASK [Gathering Facts] *********************************************************************************************************************************************************
ok: [lx00011010d]
ok: [lx00016141d]
TASK [singleplatform-eng.users : Creating groups] ******************************************************************************************************************************
TASK [singleplatform-eng.users : Per-user group creation] **********************************************************************************************************************
changed: [lx00011010d] => (item={u'username': u'roy', u'name': u'Roy'})
changed: [lx00016141d] => (item={u'username': u'jeff', u'name': u'Jeff'})
TASK [singleplatform-eng.users : User creation] ********************************************************************************************************************************
changed: [lx00011010d] => (item={u'username': u'roy', u'name': u'Roy'})
changed: [lx00016141d] => (item={u'username': u'jeff', u'name': u'Jeff'})
TASK [singleplatform-eng.users : SSH keys] *************************************************************************************************************************************
TASK [singleplatform-eng.users : Setup user profiles] **************************************************************************************************************************
skipping: [lx00011010d] => (item={u'username': u'roy', u'name': u'Roy'})
skipping: [lx00016141d] => (item={u'username': u'jeff', u'name': u'Jeff'})
TASK [singleplatform-eng.users : Deleted user removal] *************************************************************************************************************************
TASK [singleplatform-eng.users : Deleted per-user group removal] ***************************************************************************************************************
PLAY [oracle] ******************************************************************************************************************************************************************
TASK [Gathering Facts] *********************************************************************************************************************************************************
ok: [lx00011010d]
TASK [singleplatform-eng.users : Creating groups] ******************************************************************************************************************************
TASK [singleplatform-eng.users : Per-user group creation] **********************************************************************************************************************
changed: [lx00011010d] => (item={u'username': u'roy', u'name': u'Roy'})
TASK [singleplatform-eng.users : User creation] ********************************************************************************************************************************
changed: [lx00011010d] => (item={u'username': u'roy', u'name': u'Roy'})
TASK [singleplatform-eng.users : SSH keys] *************************************************************************************************************************************
TASK [singleplatform-eng.users : Setup user profiles] **************************************************************************************************************************
skipping: [lx00011010d] => (item={u'username': u'roy', u'name': u'Roy'})
TASK [singleplatform-eng.users : Deleted user removal] *************************************************************************************************************************
TASK [singleplatform-eng.users : Deleted per-user group removal] ***************************************************************************************************************
PLAY RECAP *********************************************************************************************************************************************************************
lx00011010d : ok=6 changed=4 unreachable=0 failed=0 skipped=10 rescued=0 ignored=0
lx00016141d : ok=3 changed=2 unreachable=0 failed=0 skipped=5 rescued=0 ignored=0