$ ansible-playbook -i hosts -c local playbook.yml
PLAY [main[0]] *******************************************************************************************************************************************************************************************************************************
TASK [Gathering Facts] ***********************************************************************************************************************************************************************************************************************
ok: [127.0.0.1]
TASK [command] *******************************************************************************************************************************************************************************************************************************
changed: [127.0.0.1]
TASK [debug] *********************************************************************************************************************************************************************************************************************************
ok: [127.0.0.1] => {
"msg": "0.0.0.0"
}
PLAY RECAP ***********************************************************************************************************************************************************************************************************************************
127.0.0.1 : ok=3 changed=1 unreachable=0 failed=0
Created
January 26, 2019 18:04
-
-
Save mageddo/9bc10b8f5c49f4d69b3146d8b62c7e35 to your computer and use it in GitHub Desktop.
This file contains 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
[main] | |
127.0.0.1 private_ip=0.0.0.0 | |
192.168.0.53 private_ip=0.0.0.0 |
This file contains 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: main[0] | |
tasks: | |
- command: echo "Hey Asshole" | |
register: out | |
- debug: | |
msg: "{{ hostvars[groups['main'][1]].private_ip}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment