I've run into a bit of a brick wall with Ansible.

As part of my playbook I've created an "application daemon" user. This user 
is responsible for running any software deployed to the provisioned 
machine. Its not a sudoer.

I'm trying to execute some post deployment tasks and one of them is to run 
a program I've installed as the application user. Everything else in the 
playbook is executed as root (using sudo from vagrant user) e.g.

---
- hosts: vagrant
  sudo: true
  sudo_user: root

To run the program I'm using the shell module e.g.

-      shell: node cli <job-name>
       sudo_user: <appuser>
       sudo: true

However, it hangs.

I can verify that it works normally by sshing to my vm as vagrant and then 
sudo to <appuser>. I'm using the -i flag to ensure <appuser> environment is 
loaded (~/.profile)

I'm fairly positive the issue lies with it still asking me for a password.

If I dont sudo in the task, then it will run it as root but the 
environmental variables I need are not set.

Can anyone elighten me at the actual command Ansible runs when using the 
sudo flag?

Any help would be greatly appreciated!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/745232c5-d416-4e60-b857-5f324b45e25e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to