Created
December 8, 2017 14:03
-
-
Save linuxsimba/f826473338befaf5dc52c56631e7a8cb to your computer and use it in GitHub Desktop.
fake password vault example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: mylist | |
gather_facts: no | |
pre_tasks: | |
- name: get file name | |
set_fact: | |
fake_vault_file: "{{ inventory_hostname}}.txt" | |
- name: get host specific creds from "fake" password vault | |
set_fact: | |
creds: "{{ lookup('file', fake_vault_file) | from_yaml }}" | |
- name: set username | |
set_fact: | |
ansible_user: "{{ creds.username }}" | |
- name: set ssh_private_key_file | |
set_fact: | |
ansible_ssh_private_key_file: "{{ creds.ssh_private_cred_file }}" | |
- name: run setup | |
setup: | |
tasks: | |
- command: "ls" | |
register: command_output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
No config file found; using defaults | |
PLAYBOOK: playbook.yml ********************************************************************************** | |
1 plays in playbook.yml | |
PLAY [mylist] ******************************************************************************************* | |
TASK [get file name] ************************************************************************************ | |
task path: /home/Downloads/test_lookup/playbook.yml:5 | |
ok: [ts001] => { | |
"ansible_facts": { | |
"fake_vault_file": "ts001.txt" | |
}, | |
"changed": false | |
} | |
ok: [ts002] => { | |
"ansible_facts": { | |
"fake_vault_file": "ts002.txt" | |
}, | |
"changed": false | |
} | |
TASK [get host specific creds from "fake" password vault] *********************************************** | |
task path: /home/Downloads/test_lookup/playbook.yml:8 | |
ok: [ts001] => { | |
"ansible_facts": { | |
"creds": { | |
"ssh_private_cred_file": "/home/skamithi/ansible-test-scale/keys/ansible_test", | |
"username": "root" | |
} | |
}, | |
"changed": false | |
} | |
ok: [ts002] => { | |
"ansible_facts": { | |
"creds": { | |
"ssh_private_cred_file": "/home/skamithi/ansible-test-scale/keys/ansible_test", | |
"username": "root" | |
} | |
}, | |
"changed": false | |
} | |
TASK [set username] ************************************************************************************* | |
task path: /home/Downloads/test_lookup/playbook.yml:11 | |
ok: [ts001] => { | |
"ansible_facts": { | |
"ansible_user": "root" | |
}, | |
"changed": false | |
} | |
ok: [ts002] => { | |
"ansible_facts": { | |
"ansible_user": "root" | |
}, | |
"changed": false | |
} | |
TASK [set ssh_private_key_file] ************************************************************************* | |
task path: /home/Downloads/test_lookup/playbook.yml:14 | |
ok: [ts001] => { | |
"ansible_facts": { | |
"ansible_ssh_private_key_file": "/home/skamithi/ansible-test-scale/keys/ansible_test" | |
}, | |
"changed": false | |
} | |
ok: [ts002] => { | |
"ansible_facts": { | |
"ansible_ssh_private_key_file": "/home/skamithi/ansible-test-scale/keys/ansible_test" | |
}, | |
"changed": false | |
} | |
TASK [run setup] **************************************************************************************** | |
task path: /home/Downloads/test_lookup/playbook.yml:17 | |
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/system/setup.py | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/system/setup.py | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9001 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/95aae85c81 localhost '/bin/sh -c '"'"'echo ~ && sleep 0'"'"'' | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9002 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/1566199dbc localhost '/bin/sh -c '"'"'echo ~ && sleep 0'"'"'' | |
<localhost> (0, '/root\n', '') | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9001 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/95aae85c81 localhost '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1512741771.07-81286776313225 `" && echo ansible-tmp-1512741771.07-81286776313225="` echo /root/.ansible/tmp/ansible-tmp-1512741771.07-81286776313225 `" ) && sleep 0'"'"'' | |
<localhost> (0, '/root\n', '') | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9002 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/1566199dbc localhost '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1512741771.07-131686884773972 `" && echo ansible-tmp-1512741771.07-131686884773972="` echo /root/.ansible/tmp/ansible-tmp-1512741771.07-131686884773972 `" ) && sleep 0'"'"'' | |
<localhost> (0, 'ansible-tmp-1512741771.07-81286776313225=/root/.ansible/tmp/ansible-tmp-1512741771.07-81286776313225\n', '') | |
<localhost> PUT /tmp/tmpH7hO8h TO /root/.ansible/tmp/ansible-tmp-1512741771.07-81286776313225/setup.py | |
<localhost> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9001 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/95aae85c81 '[localhost]' | |
<localhost> (0, 'ansible-tmp-1512741771.07-131686884773972=/root/.ansible/tmp/ansible-tmp-1512741771.07-131686884773972\n', '') | |
<localhost> PUT /tmp/tmpUwvKGn TO /root/.ansible/tmp/ansible-tmp-1512741771.07-131686884773972/setup.py | |
<localhost> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9002 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/1566199dbc '[localhost]' | |
<localhost> (0, 'sftp> put /tmp/tmpH7hO8h /root/.ansible/tmp/ansible-tmp-1512741771.07-81286776313225/setup.py\n', '') | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9001 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/95aae85c81 localhost '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1512741771.07-81286776313225/ /root/.ansible/tmp/ansible-tmp-1512741771.07-81286776313225/setup.py && sleep 0'"'"'' | |
<localhost> (0, 'sftp> put /tmp/tmpUwvKGn /root/.ansible/tmp/ansible-tmp-1512741771.07-131686884773972/setup.py\n', '') | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9002 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/1566199dbc localhost '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1512741771.07-131686884773972/ /root/.ansible/tmp/ansible-tmp-1512741771.07-131686884773972/setup.py && sleep 0'"'"'' | |
<localhost> (0, '', '') | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9001 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/95aae85c81 -tt localhost '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1512741771.07-81286776313225/setup.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1512741771.07-81286776313225/" > /dev/null 2>&1 && sleep 0'"'"'' | |
<localhost> (0, '', '') | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9002 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/1566199dbc -tt localhost '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1512741771.07-131686884773972/setup.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1512741771.07-131686884773972/" > /dev/null 2>&1 && sleep 0'"'"'' | |
<localhost> (0, '\r\n{"invocation": {"module_args": {"filter": "*", "gather_subset": ["all"], "fact_path": "/etc/ansible/facts.d", "gather_timeout": 10}}, "changed": false, "ansible_facts": {"ansible_product_serial": "PF0G7X2U", "ansible_form_factor": "Notebook", "ansible_product_version": "Lenovo YOGA 900-13ISK", "ansible_fips": false, "ansible_service_mgr": "sshd", "ansible_swaptotal_mb": 16287, "module_setup": true, "ansible_memtotal_mb": 15954, "ansible_architecture": "x86_64", "ansible_distribution_version": "7.11", "ansible_domain": "", "ansible_date_time": {"weekday_number": "5", "iso8601_basic_short": "20171208T140251", "tz": "UTC", "weeknumber": "49", "hour": "14", "year": "2017", "minute": "02", "tz_offset": "+0000", "month": "12", "epoch": "1512741771", "iso8601_micro": "2017-12-08T14:02:51.386794Z", "weekday": "Friday", "time": "14:02:51", "date": "2017-12-08", "iso8601": "2017-12-08T14:02:51Z", "day": "08", "iso8601_basic": "20171208T140251386719", "second": "51"}, "ansible_real_user_id": <localhost> (0, '\r\n{"invocation": {"module_args": {"filter": "*", "gather_subset": ["all"], "fact_path": "/etc/ansible/facts.d", "gather_timeout": 10}}, "changed": false, "ansible_facts": {"ansible_product_serial": "PF0G7X2U", "ansible_form_factor": "Notebook", "ansible_product_version": "Lenovo YOGA 900-13ISK", "ansible_fips": false, "ansible_service_mgr": "sshd", "ansible_swaptotal_mb": 16287, "module_setup": true, "ansible_memtotal_mb": 15954, "ansible_architecture": "x86_64", "ansible_distribution_version": "7.11", "ansible_domain": "", "ansible_date_time": {"weekday_number": "5", "iso8601_basic_short": "20171208T140251", "tz": "UTC", "weeknumber": "49", "hour": "14", "year": "2017", "minute": "02", "tz_offset": "+0000", "month": "12", "epoch": "1512741771", "iso8601_micro": "2017-12-08T14:02:51.380432Z", "weekday": "Friday", "time": "14:02:51", "date": "2017-12-08", "iso8601": "2017-12-08T14:02:51Z", "day": "08", "iso8601_basic": "20171208T140251380363", "second": "51"}, "ansible_real_user_id": 0, "ansible_processor_cores": 2, "ansible_virtualization_role": "guest", "ansible_dns": {"nameservers": ["8.8.8.8", "8.8.4.4"]}, "ansible_processor_vcpus": 4, "ansible_bios_version": "C6CN35WW", "ansible_processor": ["GenuineIntel", "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", "GenuineIntel", "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", "GenuineIntel", "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", "GenuineIntel", "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz"], "ansible_virtualization_type": "docker", "ansible_lo": {"features": {}, "mtu": 65536, "device": "lo", "promisc": false, "ipv4": {"broadcast": "host", "netmask": "255.0.0.0", "network": "127.0.0.0", "address": "127.0.0.1"}, "active": true, "type": "loopback"}, "ansible_userspace_bits": "64", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLfwQvQbkeb4QYSQD9OQdSDocf9To5G+Lg+cU2L8B73iR9y70GvaW0DRQckoJn8lmzn3anrIz9L53nnXlIXxo3U=", "ansible_default_ipv4": {"macaddress": "02:42:c0:a8:65:03", "network": "192.168.101.0", "mtu": 1500, "broadcast": "global", "alias": "eth0", "netmask": "255.255.255.0", "address": "192.168.101.3", "interface": "eth0", "type": "ether", "gateway": "192.168.101.1"}, "ansible_swapfree_mb": 16287, "ansible_default_ipv6": {}, "ansible_distribution_release": "wheezy", "ansible_system_vendor": "LENOVO", "ansible_apparmor": {"status": "disabled"}, "ansible_cmdline": {"BOOT_IMAGE": "/vmlinuz-4.8.1-040801-generic", "quiet": true, "splash": true, "vt.handoff": "7", "ro": true, "root": "/dev/mapper/ubuntu--gnome--vg-root"}, "ansible_effective_user_id": 0, "ansible_mounts": [{"uuid": "N/A", "size_total": 10725883904, "mount": "/", "size_available": 10072256512, "fstype": "xfs", "device": "/dev/mapper/docker-253:0-21111739-de45807405f85df914643539bcfa9e94a9ce2314da7efb3c3ecea5c3a7ffcc43", "options": "rw,relatime,nouuid,attr2,inode64,logbsize=64k,sunit=128,swidth=128,noquota,bind"}, {"uuid": "N/A", "size_total": 486328623104, "mount": "/etc/resolv.conf", "size_available": 147571826688, "fstype": "ext4", "device": "/dev/mapper/ubuntu--gnome--vg-root", "options": "rw,relatime,errors=remount-ro,data=ordered,bind"}, {"uuid": "N/A", "size_total": 486328623104, "mount": "/etc/hostname", "size_available": 147571826688, "fstype": "ext4", "device": "/dev/mapper/ubuntu--gnome--vg-root", "options": "rw,relatime,errors=remount-ro,data=ordered,bind"}, {"uuid": "N/A", "size_total": 486328623104, "mount": "/etc/hosts", "size_available": 147571826688, "fstype": "ext4", "device": "/dev/mapper/ubuntu--gnome--vg-root", "options": "rw,relatime,errors=remount-ro,data=ordered,bind"}], "ansible_selinux": false, "ansible_os_family": "Debian", "ansible_userspace_architecture": "x86_64", "ansible_product_uuid": "9FBDEA59-BC00-11E5-9614-507B9DA52F9D", "ansible_kernel": "4.8.1-040801-generic", "ansible_product_name": "80MK", "ansible_pkg_mgr": "apt", "ansible_memfree_mb": 4469, "ansible_devices": {"sda": {"scheduler_mode": "", "rotational": "0", "vendor": "ATA", "sectors": "1000215216", "sas_device_handle": null, "sas_address": null, "host": "", "sectorsize": "512", "removable": "0", "support_discard": "512", "model": "LITEON CV1-8B512", "partitions": {"sda2": {"sectorsize": 512, "uuid": null, "sectors": "499712", "start": "1050624", "holders": [], "size": "244.00 MB"}, "sda3": {"sectorsize": 512, "uuid": null, "sectors": "998664192", "start": "1550336", "holders": ["ubuntu--gnome--vg-swap_1", "ubuntu--gnome--vg-root"], "size": "476.20 GB"}, "sda1": {"sectorsize": 512, "uuid": null, "sectors": "1048576", "start": "2048", "holders": [], "size": "512.00 MB"}}, "holders": [], "size": "476.94 GB"}}, "ansible_user_uid": 0, "ansible_user_id": "root", "ansible_distribution": "Debian", "ansible_env": {"TERM": "xterm-256color", "SHELL": "/bin/bash", "MAIL": "/var/mail/root", "SHLVL": "1", "PYTHONPATH": "/tmp/ansible_3BJG01/ansible_modlib.zip", "SSH_CLIENT": "192.168.101.1 42116 22", "PWD": "/root", "LOGNAME": "root", "USER": "root", "SSH_TTY": "/dev/pts/0", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11", "SSH_CONNECTION": "192.168.101.1 42116 192.168.101.3 22", "HOME": "/root", "_": "/bin/sh"}, "ansible_distribution_major_version": "7", "ansible_user_dir": "/root", "ansible_processor_count": 1, "ansible_hostname": "4107dfe5457e", "ansible_effective_group_id": 0, "ansible_real_group_id": 0, "ansible_bios_date": "12/17/2015", "ansible_all_ipv6_addresses": [], "ansible_interfaces": ["lo", "eth0"], "ansible_uptime_seconds": 338726, "ansible_machine_id": "40beb5eb909e171860ceee669da56e1d", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCt7zSolUMG83NkFdV/9Wqv34Hgukxk9VnZSWINuX9LBJju3jakabvxGT0erOKmtk6trwBROoj8ztpZ3GxTJT52TIqkcv0RstiNR1+rkwkdm4xc7vsGGZHrtku+V3/1jqbZohEvIc3qiWqxeUIwLx/4J+mXfdvNAjb+FKqTMaMXCnh8fR9l4oND6kNXEUjHSRkwLe7PoqYTXZB47j/JaiQokBRLZCStgrsnkX9/UcD05KRsYkP7n6BmQQlhoaq7v7BeRj9rpWYym93CUkhCtzT2BsgrvHs1OzVMZRCHfJWpH3pxHdrHkx7+Qn/KSJNm/0YetrN1NhVWCfoG/syeMU29", "ansible_gather_subset": ["hardware", "network", "virtual"], "ansible_user_gecos": "root", "ansible_python": {"executable": "/usr/bin/python", "version": {"micro": 3, "major": 2, "releaselevel": "final", "serial": 0, "minor": 7}, "type": "CPython", "has_sslcontext": false, "version_info": [2, 7, 3, "final", 0]}, "ansible_memory_mb": {"real": {"total": 15954, "used": 11485, "free": 4469}, "swap": {"cached": 0, "total": 16287, "free": 16287, "used": 0}, "nocache": {"used": 4968, "free": 10986}}, "ansible_processor_threads_per_core": 2, "ansible_fqdn": "4107dfe5457e", "ansible_user_gid": 0, "ansible_eth0": {"macaddress": "02:42:c0:a8:65:03", "features": {}, "type": "ether", "mtu": 1500, "device": "eth0", "promisc": false, "ipv4": {"broadcast": "global", "netmask": "255.255.255.0", "network": "192.168.101.0", "address": "192.168.101.3"}, "active": true, "speed": 10000}, "ansible_nodename": "4107dfe5457e", "ansible_system": "Linux", "ansible_user_shell": "/bin/bash", "ansible_machine": "x86_64", "ansible_ssh_host_key_dsa_public": "AAAAB3NzaC1kc3MAAACBAIJetcXcX7VKuEbUdbKD4YMVC+i4lCE59199ZQP6vCxnYnGOECIBbDZuUWtKzsXbbNGg0nEehrITYhpQ4vbIhSzStdG3VUOj/k+5M+aJ0, "ansible_processor_cores": 2, "ansible_virtualization_role": "guest", "ansible_dns": {"nameservers": ["8.8.8.8", "8.8.4.4"]}, "ansible_processor_vcpus": 4, "ansible_bios_version": "C6CN35WW", "ansible_processor": ["GenuineIntel", "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", "GenuineIntel", "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", "GenuineIntel", "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", "GenuineIntel", "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz"], "ansible_virtualization_type": "docker", "ansible_lo": {"features": {}, "mtu": 65536, "device": "lo", "promisc": false, "ipv4": {"broadcast": "host", "netmask": "255.0.0.0", "network": "127.0.0.0", "address": "127.0.0.1"}, "active": true, "type": "loopback"}, "ansible_userspace_bits": "64", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLfwQvQbkeb4QYSQD9OQdSDocf9To5G+Lg+cU2L8B73iR9y70GvaW0DRQckoJn8lmzn3anrIz9L53nnXlIXxo3U=", "ansible_default_ipv4": {"macaddress": "02:42:c0:a8:65:02", "network": "192.168.101.0", "mtu": 1500, "broadcast": "global", "alias": "eth0", "netmask": "255.255.255.0", "address": "192.168.101.2", "interface": "eth0", "type": "ether", "gateway": "192.168.101.1"}, "ansible_swapfree_mb": 16287, "ansible_default_ipv6": {}, "ansible_distribution_release": "wheezy", "ansible_system_vendor": "LENOVO", "ansible_apparmor": {"status": "disabled"}, "ansible_cmdline": {"BOOT_IMAGE": "/vmlinuz-4.8.1-040801-generic", "quiet": true, "splash": true, "vt.handoff": "7", "ro": true, "root": "/dev/mapper/ubuntu--gnome--vg-root"}, "ansible_effective_user_id": 0, "ansible_mounts": [{"uuid": "N/A", "size_total": 10725883904, "mount": "/", "size_available": 10072252416, "fstype": "xfs", "device": "/dev/mapper/docker-253:0-21111739-e01bf9559ad73d8d7f8feb4bd095414f557d7e125a727d9a004c8eebed584220", "options": "rw,relatime,nouuid,attr2,inode64,logbsize=64k,sunit=128,swidth=128,noquota,bind"}, {"uuid": "N/A", "size_total": 486328623104, "mount": "/etc/resolv.conf", "size_available": 147571826688, "fstype": "ext4", "device": "/dev/mapper/ubuntu--gnome--vg-root", "options": "rw,relatime,errors=remount-ro,data=ordered,bind"}, {"uuid": "N/A", "size_total": 486328623104, "mount": "/etc/hostname", "size_available": 147571826688, "fstype": "ext4", "device": "/dev/mapper/ubuntu--gnome--vg-root", "options": "rw,relatime,errors=remount-ro,data=ordered,bind"}, {"uuid": "N/A", "size_total": 486328623104, "mount": "/etc/hosts", "size_available": 147571826688, "fstype": "ext4", "device": "/dev/mapper/ubuntu--gnome--vg-root", "options": "rw,relatime,errors=remount-ro,data=ordered,bind"}], "ansible_selinux": false, "ansible_os_family": "Debian", "ansible_userspace_architecture": "x86_64", "ansible_product_uuid": "9FBDEA59-BC00-11E5-9614-507B9DA52F9D", "ansible_kernel": "4.8.1-040801-generic", "ansible_product_name": "80MK", "ansible_pkg_mgr": "apt", "ansible_memfree_mb": 4469, "ansible_devices": {"sda": {"scheduler_mode": "", "rotational": "0", "vendor": "ATA", "sectors": "1000215216", "sas_device_handle": null, "sas_address": null, "host": "", "sectorsize": "512", "removable": "0", "support_discard": "512", "model": "LITEON CV1-8B512", "partitions": {"sda2": {"sectorsize": 512, "uuid": null, "sectors": "499712", "start": "1050624", "holders": [], "size": "244.00 MB"}, "sda3": {"sectorsize": 512, "uuid": null, "sectors": "998664192", "start": "1550336", "holders": ["ubuntu--gnome--vg-swap_1", "ubuntu--gnome--vg-root"], "size": "476.20 GB"}, "sda1": {"sectorsize": 512, "uuid": null, "sectors": "1048576", "start": "2048", "holders": [], "size": "512.00 MB"}}, "holders": [], "size": "476.94 GB"}}, "ansible_user_uid": 0, "ansible_user_id": "root", "ansible_distribution": "Debian", "ansible_env": {"TERM": "xterm-256color", "SHELL": "/bin/bash", "MAIL": "/var/mail/root", "SHLVL": "1", "PYTHONPATH": "/tmp/ansible_XrmPlF/ansible_modlib.zip", "SSH_CLIENT": "192.168.101.1 53100 22", "PWD": "/root", "LOGNAME": "root", "USER": "root", "SSH_TTY": "/dev/pts/0", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11", "SSH_CONNECTION": "192.168.101.1 53100 192.168.101.2 22", "HOME": "/root", "_": "/bin/sh"}, "ansible_distribution_major_version": "7", "ansible_user_dir": "/root", "ansible_processor_count": 1, "ansible_hostname": "b22aee49beb6", "ansible_effective_group_id": 0, "ansible_real_group_id": 0, "ansible_bios_date": "12/17/2015", "ansible_all_ipv6_addresses": [], "ansible_interfaces": ["lo", "eth0"], "ansible_uptime_seconds": 338726, "ansible_machine_id": "40beb5eb909e171860ceee669da56e1d", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCt7zSolUMG83NkFdV/9Wqv34Hgukxk9VnZSWINuX9LBJju3jakabvxGT0erOKmtk6trwBROoj8ztpZ3GxTJT52TIqkcv0RstiNR1+rkwkdm4xc7vsGGZHrtku+V3/1jqbZohEvIc3qiWqxeUIwLx/4J+mXfdvNAjb+FKqTMaMXCnh8fR9l4oND6kNXEUjHSRkwLe7PoqYTXZB47j/JaiQokBRLZCStgrsnkX9/UcD05KRsYkP7n6BmQQlhoaq7v7BeRj9rpWYym93CUkhCtzT2BsgrvHs1OzVMZRCHfJWpH3pxHdrHkx7+Qn/KSJNm/0YetrN1NhVWCfoG/syeMU29", "ansible_gather_subset": ["hardware", "network", "virtual"], "ansible_user_gecos": "root", "ansible_python": {"executable": "/usr/bin/python", "version": {"micro": 3, "major": 2, "releaselevel": "final", "serial": 0, "minor": 7}, "type": "CPython", "has_sslcontext": false, "version_info": [2, 7, 3, "final", 0]}, "ansible_memory_mb": {"real": {"total": 15954, "used": 11485, "free": 4469}, "swap": {"cached": 0, "total": 16287, "free": 16287, "used": 0}, "nocache": {"used": 4968, "free": 10986}}, "ansible_processor_threads_per_core": 2, "ansible_fqdn": "b22aee49beb6", "ansible_user_gid": 0, "ansible_eth0": {"macaddress": "02:42:c0:a8:65:02", "features": {}, "type": "ether", "mtu": 1500, "device": "eth0", "promisc": false, "ipv4": {"broadcast": "global", "netmask": "255.255.255.0", "network": "192.168.101.0", "address": "192.168.101.2"}, "active": true, "speed": 10000}, "ansible_nodename": "b22aee49beb6", "ansible_system": "Linux", "ansible_user_shell": "/bin/bash", "ansible_machine": "x86_64", "ansible_ssh_host_key_dsa_public": "AAAAB3NzaC1kc3MAAACBAIJetcXcX7VKuEbUdbKD4YMVC+i4lCE59199ZQP6vCxnYnGOECIBbDZuUWtKzsXbbNGg0nEehrITYhpQ4vbIhSzStdG3VUOj/k+5M+aJAHwTkD29rCNEdINgLr1HwVOBS9RFYNW5gc54X9hHhULsYbsIs0uX6rCvkQ+xsUJok0G/AAAAFQCDvYlQkQaKQ9iWh2Aw30sx+BxoxwAAAIAV8C9KZEZ2kwAD4PHdnD56FbO3GWrMQlIftvmeNF1+5IdnEEis/2TY8biNEcZdIi+adclrQ9g0gD2ss2CaxdzypnHiRBe5dbXb6UskNFUleLhA0Rg4jGGz5nqojCq1rLbq7MiDtV5fW4u97BdgT+et3OrMUAN2ygQ/DXismH+lTwAAAIAJUG1KAvtOhK5Xpis2Dw+JxIsOGI0de112sC9+MDLIyuMqxEzLE2bR7Tq7jTN3JesRxYlxu/sGD6cTjR/9U8aazRzQ7n2v73xe+e+CfE2dQvhbzauArQl5tg6w5aeyRZmTcgXXr8qh9PyXiwVXKhRY6nOQjtYthiivIXOV5dRCzA==", "ansible_all_ipv4_addresses": ["192.168.101.3"], "ansible_python_version": "2.7.3"}}\r\n', 'Shared connection to localhost closed.\r\n') | |
AHwTkD29rCNEdINgLr1HwVOBS9RFYNW5gc54X9hHhULsYbsIs0uX6rCvkQ+xsUJok0G/AAAAFQCDvYlQkQaKQ9iWh2Aw30sx+BxoxwAAAIAV8C9KZEZ2kwAD4PHdnD56FbO3GWrMQlIftvmeNF1+5IdnEEis/2TY8biNEcZdIi+adclrQ9g0gD2ss2CaxdzypnHiRBe5dbXb6UskNFUleLhA0Rg4jGGz5nqojCq1rLbq7MiDtV5fW4u97BdgT+et3OrMUAN2ygQ/DXismH+lTwAAAIAJUG1KAvtOhK5Xpis2Dw+JxIsOGI0de112sC9+MDLIyuMqxEzLE2bR7Tq7jTN3JesRxYlxu/sGD6cTjR/9U8aazRzQ7n2v73xe+e+CfE2dQvhbzauArQl5tg6w5aeyRZmTcgXXr8qh9PyXiwVXKhRY6nOQjtYthiivIXOV5dRCzA==", "ansible_all_ipv4_addresses": ["192.168.101.2"], "ansible_python_version": "2.7.3"}}\r\n', 'Shared connection to localhost closed.\r\n') | |
ok: [ts001] | |
ok: [ts002] | |
META: ran handlers | |
TASK [command] ****************************************************************************************** | |
task path: /home/Downloads/test_lookup/playbook.yml:21 | |
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/commands/command.py | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/commands/command.py | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9001 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/95aae85c81 localhost '/bin/sh -c '"'"'echo ~ && sleep 0'"'"'' | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9002 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/1566199dbc localhost '/bin/sh -c '"'"'echo ~ && sleep 0'"'"'' | |
<localhost> (0, '/root\n', '') | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9001 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/95aae85c81 localhost '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1512741772.42-147545180450820 `" && echo ansible-tmp-1512741772.42-147545180450820="` echo /root/.ansible/tmp/ansible-tmp-1512741772.42-147545180450820 `" ) && sleep 0'"'"'' | |
<localhost> (0, '/root\n', '') | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9002 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/1566199dbc localhost '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1512741772.42-127490514965823 `" && echo ansible-tmp-1512741772.42-127490514965823="` echo /root/.ansible/tmp/ansible-tmp-1512741772.42-127490514965823 `" ) && sleep 0'"'"'' | |
<localhost> (0, 'ansible-tmp-1512741772.42-147545180450820=/root/.ansible/tmp/ansible-tmp-1512741772.42-147545180450820\n', '') | |
<localhost> (0, 'ansible-tmp-1512741772.42-127490514965823=/root/.ansible/tmp/ansible-tmp-1512741772.42-127490514965823\n', '') | |
<localhost> PUT /tmp/tmpVd0NHl TO /root/.ansible/tmp/ansible-tmp-1512741772.42-147545180450820/command.py | |
<localhost> PUT /tmp/tmpldYUSN TO /root/.ansible/tmp/ansible-tmp-1512741772.42-127490514965823/command.py | |
<localhost> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9001 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/95aae85c81 '[localhost]' | |
<localhost> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9002 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/1566199dbc '[localhost]' | |
<localhost> (0, 'sftp> put /tmp/tmpVd0NHl /root/.ansible/tmp/ansible-tmp-1512741772.42-147545180450820/command.py\n', '') | |
<localhost> (0, 'sftp> put /tmp/tmpldYUSN /root/.ansible/tmp/ansible-tmp-1512741772.42-127490514965823/command.py\n', '') | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9001 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/95aae85c81 localhost '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1512741772.42-147545180450820/ /root/.ansible/tmp/ansible-tmp-1512741772.42-147545180450820/command.py && sleep 0'"'"'' | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9002 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/1566199dbc localhost '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1512741772.42-127490514965823/ /root/.ansible/tmp/ansible-tmp-1512741772.42-127490514965823/command.py && sleep 0'"'"'' | |
<localhost> (0, '', '') | |
<localhost> (0, '', '') | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> ESTABLISH SSH CONNECTION FOR USER: root | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9001 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/95aae85c81 -tt localhost '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1512741772.42-147545180450820/command.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1512741772.42-147545180450820/" > /dev/null 2>&1 && sleep 0'"'"'' | |
<localhost> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o Port=9002 -o 'IdentityFile="/home/skamithi/ansible-test-scale/keys/ansible_test"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/skamithi/.ansible/cp/1566199dbc -tt localhost '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1512741772.42-127490514965823/command.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1512741772.42-127490514965823/" > /dev/null 2>&1 && sleep 0'"'"'' | |
<localhost> (0, '\r\n{"changed": true, "end": "2017-12-08 14:02:52.697494", "stdout": "", "cmd": ["ls"], "rc": 0, "start": "2017-12-08 14:02:52.588000", "stderr": "", "delta": "0:00:00.109494", "invocation": {"module_args": {"warn": true, "executable": null, "_uses_shell": false, "_raw_params": "ls", "removes": null, "creates": null, "chdir": null}}, "warnings": []}\r\n', 'Shared connection to localhost closed.\r\n') | |
<localhost> (0, '\r\n{"changed": true, "end": "2017-12-08 14:02:52.698267", "stdout": "", "cmd": ["ls"], "rc": 0, "start": "2017-12-08 14:02:52.587348", "stderr": "", "delta": "0:00:00.110919", "invocation": {"module_args": {"warn": true, "executable": null, "_uses_shell": false, "_raw_params": "ls", "removes": null, "creates": null, "chdir": null}}, "warnings": []}\r\n', 'Shared connection to localhost closed.\r\n') | |
changed: [ts002] => { | |
"changed": true, | |
"cmd": [ | |
"ls" | |
], | |
"delta": "0:00:00.110919", | |
"end": "2017-12-08 14:02:52.698267", | |
"invocation": { | |
"module_args": { | |
"_raw_params": "ls", | |
"_uses_shell": false, | |
"chdir": null, | |
"creates": null, | |
"executable": null, | |
"removes": null, | |
"warn": true | |
} | |
}, | |
"rc": 0, | |
"start": "2017-12-08 14:02:52.587348", | |
"stderr": "", | |
"stderr_lines": [], | |
"stdout": "", | |
"stdout_lines": [] | |
} | |
changed: [ts001] => { | |
"changed": true, | |
"cmd": [ | |
"ls" | |
], | |
"delta": "0:00:00.109494", | |
"end": "2017-12-08 14:02:52.697494", | |
"invocation": { | |
"module_args": { | |
"_raw_params": "ls", | |
"_uses_shell": false, | |
"chdir": null, | |
"creates": null, | |
"executable": null, | |
"removes": null, | |
"warn": true | |
} | |
}, | |
"rc": 0, | |
"start": "2017-12-08 14:02:52.588000", | |
"stderr": "", | |
"stderr_lines": [], | |
"stdout": "", | |
"stdout_lines": [] | |
} | |
META: ran handlers | |
META: ran handlers | |
PLAY RECAP ********************************************************************************************** | |
ts001 : ok=6 changed=1 unreachable=0 failed=0 | |
ts002 : ok=6 changed=1 unreachable=0 failed=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment