I'm trying to use Ansible to provision a Vagrant box and a EC2 server. It works fine on the Vagrant box when using --connection=local, but it seems to just ignore the sudo: True line
When I do this:
---
- hosts: remote
vars_files:
- vars.yml
gather_facts: false
sudo: True
remote_user: root
tasks:
- name: test
file: state=directory path=~/test
It creates the directory in the normal user's home directory, owned by the normal user. The user doesn't have a password, and I can use commands with sudo without being prompted for one. What am I missing?
root's home dir? - Mxxsudocommand works...You can easily see that by logging to that server and from your ~/ runsudo mkdir test. You'll see that it's created exactly where you are, not in root's ~/. - Mxx