name: "Creating folder and copying html file" The above command is important to get run on the nodes so as to install some important libraries required for ansible to perform some further tasks. Now, this block is gonna start the docker service. In this above block the command for installing docker is gonna run on all the target nodes. name: "installing docker package"Ĭommand: "yum install docker-ce -nobest -y" This block will configure the repository needed to install docker and the repository will get configured on all the target nodes as stated in the first line. There are several blocks of code which needs to be added and will explain there roll here. Now directly jumping inside the yml code of playbook. Step 2: In this step we are gonna focusing on writing the playbook. The left one is the host while the right one is the target node. Just create a simple yml file and inside it write the required information in a simple format as stated above.Īnd after adding the IP(s) in the inventory file try to ping, so that we can check that the connection between the host and the target nodes are proper or not. IP(s) of the systems on which are gonna install docker through playbook. Step 1: First create a inventory file inside which we will write the IP(s) of the target nodes i.e. Hoping that you have already installed ansible on the host node. □ Copy the html code in /var/www/html directory and start the web serverĪll these steps will be performed on redhat linux. □ Run the docker container and expose it to the public □ Pull the httpd server image from the Docker Hub Lets quickly have a look on our agenda: □Write an Ansible PlayBook that does the following operations in the managed nodes: Installing, configuring, launching, and starting docker services are the topics which are gonna covered in this article.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |