Hi!

I've split some tasks in two roles, one with plays requiring sudo and
the other with plays not requiring it (hence run as 'ubuntu').

I have a top level playbook that maps the same group of hosts to both
roles, the first enabling sudo, the second disabling it, like this:

site.yml:
---
- name: Configure foo (sudo)
  hosts: some_group
  sudo: yes
  roles:
    - somerole-sudo

- name: Configure foo
  hosts: some_group
  sudo: no
  roles:
    - somerole

Well, 'somerole' uses the var 'ansible_user_id'.  If I remove the play
requiring sudo,
ansible_user_id evaluates correctly to 'ubuntu'.  But if I run the
whole playbook, ansible_user_id evaluates to 'root', even though the
play where it is evaluated says sudo: no.

It seems that once a host has run a play with sudo, ansible_user_id
gets 'tainted', and subsequent plays don't refresh its value.

Is this a bug, or am I missing something?


Thanks a bunch!

-- 
pancho horrillo
DevOps engineer

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to