Ansible is the simplest IT automation engine that automates infrastructure, applications, and many other needs. Ansible uses YAML (Ain't Markup Language) – a very simple language, to establish Ansible playbooks. An Ansible playbook is composed of one or more 'plays' in an ordered list. The terms 'playbook' and 'play' are sports analogies. Each play executes part of the overall goal of the playbook, running one or more tasks. Each task calls an Ansible module.
We are converting the Jenkins server to be an Ansible server as well. Hence, we can create a Jenkins project named Ansible Installation:
- This is the Jenkins script to install Ansible:
sudo apt update -y
echo Y | sudo apt install -y ansible
# set the remote PostgreSQL IP 192.168.0.191
sudo sh -c 'sudo echo "[postgres]" > /etc/ansible/hosts'
sudo sh -c 'sudo echo "192.168.0.191 ansible_user=vagrant...