A playbook contains a lot of things like tasks, handlers, templates, files, variables, etc. So, over a period of time, it grows in size and then it becomes really difficult to understand. For example, when you have songs on...
Category - Ansible
In the previous article, we created locally NTP configuration files for Debian and RedHat OS based servers and there, we updated the NTP related lines as seen below. Now, suppose if we have multiple data centers in...
This is in continuation to the articles of Ansible. In the previous article, we have seen how we can set up the local NTP configuration file and how we can deploy it to the servers to get the benefit of setting up the...
Here we are going to write a playbook to deploy NTP service. NTP keeps the system time in check so that it doesn’t drift because if the servers time is not in sync, then there could be a lot of issues as all our log files...
Before we discuss variables, why do you think we need variables? Re-usability is one of the most important reasons for using variables in a playbook. We are going to update the existing playbook show above and we will...
Create database and add a user in MariaDB database In this, we are going to see how we can create a database and add a user in the MariaDB database. There are lots of database modules in Ansible that we can use and they can be...
As of now we are keeping our password in the inventory file, which is not at all a good practice. Let’s remove our passwords from there and login via key based login which is the ideal approach. ssh-keygen This...
Printing Fact Variables using debug module Now let’s learn how to fetch any value from a json output. Later in the blog we will be doing that. A json is a form of dictionary in python. Dictionary can have a key value...
Playbooks are the files where the Ansible code is written. Playbooks are written in YAML format. YAML stands for Yet Another Markup Language. Playbooks are one of the core features of Ansible and tell Ansible what to execute...
Till now we have seen that we can manage the configuration of ansible at path /etc/ansible/ansible.cfg file. You can create your own configuration file. The order of the configuration file will be as follows with the defined...