Created
May 13, 2016 00:33
-
-
Save willthames/d0209bd4c8c3664c1490b1bb24b4dc00 to your computer and use it in GitHub Desktop.
ansible register test
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
ansible-playbook hostname.yml -e hosts=some_ansible_group -vv |
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: "{{hosts}}" | |
tasks: | |
- name: get hostname | |
command: hostname | |
register: hostname | |
- name: print hostname | |
debug: var=hostname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment