Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Login to linux ansible remote server enabled with LDAP using SSH?

Here is the scnario which we tried last week with Pranav Goel in order to login the Ansible remote server which is enlabe with LDAP and become a su to execute any playbook tasks. Here are the steps given as below;

Inventory:

[code]
[root@ussltcovm498 ansible]# cat inventory
hostname.demo.com ansible_user=adname\\aduser ansible_ssh_pass=password ansible_become_pass=password
[/code]

Ansible Configuration File)

[code]
[privilege_escalation]
become=True
become_method=su
become_user=oracle
#become_ask_pass=True
[/code]

Note:
In order to pass LDAP user use “\\”

Command to Check:

[code]ansible all -i inventory -m command -a “whoami”[/code]

 

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x