Question : To manage all servers within the stack using Ansible, the Nautilus DevOps team is planning to use a common sudo user among all servers. Ansible will be able to use this to perform different tasks on each server. This is not finalized yet, but the team has decided to first perform testing. The DevOps team has already installed Ansible on jump host using yum, and they now have the following requirement:
On jump host make appropriate changes so that Ansible can use john as the default ssh user for all hosts. Make changes in Ansible's default configuration only —please do not try to create a new config.
1. Switch to Root user on jump server itself
thor@jump_host
/$ sudo su - We trust you
have received the usual lecture from the local System Administrator.
It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great
responsibility. [sudo] password
for thor: [root@jump_host
~]# |
2. Go through the ansible configuration file and add remote user as per the task
[root@jump_host
~]# cat /etc/ansible/ansible.cfg |grep remote_user -B5 # SSH timeout #timeout = 10 # default user to use for playbooks if user is not specified #
(/usr/bin/ansible will use current user as default) #remote_user =
root [root@jump_host
~]# [root@jump_host
~]# vi /etc/ansible/ansible.cfg [root@jump_host
~]# [root@jump_host
~]# cat /etc/ansible/ansible.cfg |grep remote_user –B5 # SSH timeout #timeout = 10
[root@jump_host
~]# |
Happy Learning!!!!
0 Comments