Last active
July 28, 2016 14:56
-
-
Save rektide/6f17061652898fddd57845857c149756 to your computer and use it in GitHub Desktop.
become changes ansible_ssh_user
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: all | |
tasks: | |
# this is created with my username in my homedir | |
- file: path=~/ansible-become-test state=directory owner="{{ansible_ssh_user}}" | |
# this is owned by root | |
- file: path=/opt/ansible-become-test state=directory owner="{{ansible_ssh_user}}" | |
become: True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ansible_user is also not populated. ansible_env.USER was suggested by @agaffney. i'm not sure what populated ansible_user_id but it appears to have the value i want in the very limited set of conditions i've tried.