Skip to content

Instantly share code, notes, and snippets.

@rodnaph
Created May 14, 2015 11:14
Show Gist options
  • Save rodnaph/0cdcbf934db4563e26dc to your computer and use it in GitHub Desktop.
Save rodnaph/0cdcbf934db4563e26dc to your computer and use it in GitHub Desktop.
Get local hostname in Ansible
- local_action: command hostname
register: hostname
- debug: msg=hostname.stdout
@vinaykumarhegde
Copy link

Hey, I think the debug statement should use variable:

- debug: msg={{ hostname.stdout }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment