I have an ssh access to the box but to run certain commands I need to do sudo su - and enter the password. Then I can run all the commands under that user.
How can i achieve this ansible. I tried become and sudo nothing worked for me.
Can someone provide me a working example?
this is what working for me ...
become: yes
become_method: sudo
become_user: myuser
become_flags: 'su -c'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With