my ansible_ssh_user is root, but I want a particular role to use a particular user.
For example, create a directory with this remote_user as owner and group. I know I can set the owner-permission using file module, but I was expecting the following to work
- hosts: webservers
remote_user: “meow”
roles: - clone_repo
tasks:
- name: write directory
file: path=/home/meow/dir state=directory
In addition to directory creation, clone_repo actually clone a repo. But remote_user is not actually used. They are root/root.
Did I misread the doc? http://docs.ansible.com/playbooks_intro.html#hosts-and-users
Thanks