I’m trying to setup Ansible to access our infrastructure from and admin account. With not much success.
I need to login to our RedHat servers with my user “my_user”. then we need to switch to a admin user “sudo su - admin_user”
ssh my_user@server1.com (doesn't need a password)
From Server1.com
sudo su - admin_user (requires password)
thanks
--------- Tried ---------
→ Tried adding to playbook yaml file
---
- hosts: test
become: true
become_user: admin_user
→ Error fatal: [server1.com] => Missing become password
→ Tried adding to ansible.cfg file
[privilege_escalation]
become=True
become_method='sudo'
become_user='admin_user'
become_ask_pass=true
→ Error fatal: [server1.com] => Internal Error: this module does not support running commands via ‘sudo’