In Ansible, privileged escalation refers to the process of elevating the permissions of a user or a process to gain higher levels of access or privilege on a remote system when you are performing any taks on managed systems. This is required when performing certain administrative tasks that demand superuser or administrative privileges, such as […]
Q.1 What is Ansible and what are its features? Ansible is an open-source automation tool that helps the deployment, configuration management, and orchestration of IT infrastructure. It is designed to automate repetitive tasks and you can configure lot of things using this tool.It is Agentless. Ansible uses a push-based architecture so it does not require […]
Step1: Install Ansible: # yum install ansible Step2: Generate an SSH key pair on the control node: # ssh-keygen Go for default options for key name and location and leave passphrase blank. Step3: Copy the public key to the remote nodes from control node. # ssh-copy-id username@remote_host (Put username and hostname of remote machines) Step4: […]
# systemctl start docker (Starting Docker service) # systemctl enable docker (Enabling Docker at boot level) # docker –version (Checking Docker version) # docker info (Gives all information about host and containers) # docker run/pull image (images can be downloaded from Docker Hub) # docker run hello-world (Just download and start a test container) # […]
# ansible all -i hosts –list-hosts (To see all hosts in inventory file named hosts) # ansible rl6 -i hosts –list-hosts (To see hosts of host group named rl6 created in inventory) # ansible ungrouped -i hosts –list-hosts (To see ungrouped hosts) # ansible rhel -i hosts –list-hosts (To see group parent to contains children […]
If you have user on multiple servers and want to delete them by taking backup of home directory. You can use below Ansible playbook. This playbook is running by root user. # cat delete_user.yml ## Delete user "test_user" from servers — – hosts: db-hosts remote_user: root gather_facts: no tasks: – name: Take backup of home […]
Recent Blog