it should be as simple as using `become: no`
here i demonstrate with a simple test:
- hosts: nyx
become: yes
tasks:
- shell: whoami
register: me
- debug: msg="{{me.stdout}}"
- shell: whoami
become: no
register: me
- debug: msg="{{me.stdout}}"
ANSIBLE_NOCOWS=1 ansible-playbook play.yml -K
SUDO password:
PLAY ***************************************************************************
TASK [setup] *******************************************************************
ok: [nyx]
TASK [command] *****************************************************************
changed: [nyx]
TASK [debug] *******************************************************************
ok: [nyx] => {
"msg": "root"
}
TASK [command] *****************************************************************
changed: [nyx]
TASK [debug] *******************************************************************
ok: [nyx] => {
"msg": "bcoca"
}
PLAY RECAP *********************************************************************
nyx : ok=5 changed=2 unreachable=0 failed=0
--
Brian Coca
--
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/CAJ5XC8kNP%3Do0XPBE2nDdXeBTu89Luw6%3DQHR4OK8h57kQmXwoQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.