Thanks Brian - I didn't know that's possible (it is not documented in the 
default config file) - yes, that actually gets me much closer - THANK YOU 
:-)

However I am now getting another error since ansible does not seem to be 
able to ignore the standard 'login information messages' during the su / 
sesu login process...

Here is what I did:

Edit /etc/ansible/ansible.cfg:

su_exe = /usr/seos/bin/sesu
su_flags = -

the '-' flag will make sure that I also set the users' environment - which 
ultimately triggers the standard welcome login messages etc.

so then when I run this

ansible prime -i inv_file -m ping -u my_real_user -S -R user_to_sesu -k

I get:

servername.com | FAILED => failed to 
parse:                                                                         

*****************************************************************************
* blahblahblah....                                                          
*
*****************************************************************************

Last login time was Aug 31 08:14 !!!
Good Morning my_real_user

Setting up the user_to_sesu environment...

SUDO-SUCCESS-kfpcgrtikenauccyjbtyasaltqglfhzx
{"changed": false, "ping": "pong"}
logout

When I remove the 'su_flags' from the config it all works (because it does 
not really run the login scripts to set the environment etc. But I really 
need to use the 'sesu -' since I need to have the environment setup for the 
command execution...

Is there any way to make things working so that it ignores the all welcome 
login messages during the 'sesu - <user>' operation?

-- 
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/fa7148aa-c547-4ddd-8f18-6f08d02e6489%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to