Skip to content

Instantly share code, notes, and snippets.

@cjauvin
Created August 26, 2015 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjauvin/b156773f25a67c7246e5 to your computer and use it in GitHub Desktop.
Save cjauvin/b156773f25a67c7246e5 to your computer and use it in GitHub Desktop.
- name: Run whoami to get ssh user
command: whoami
register: whoami_output
- name: Set user fact
set_fact:
user: "{{ whoami_output.stdout }}"
- name: test it!
debug: msg="{{ user }}" # should be vagrant on a VM, or your remote user for whatever else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment