I have a git directory that is owned by a user that I cannot ssh as. I'm currently using sudo_user: user
which is working but does not seem to be setting $HOME correctly. My user account has github in the ~/.ssh/known_hosts file but it is being added to my ~ssh_user/.ssh/known_hosts file (from the accept_hostkey=yes).
http://docs.ansible.com/git_module.html
- hosts: myhost
sudo_user: user
tasks:
- name: git
git: [email protected]:user/repo.git dest=/home/user/repo update=no accept_hostkey=yes
Is there something I need to do to tell ansible to use $HOME correctly?
I'm running on Solaris off of Joyent but I don't think that's directly applicable to this problem.
add sudo_flags in your ansible.cfg file
[defaults]
sudo_flags = -i
this will run you sudo user's login script to populate environemt variables like $HOME
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With