languageopk.blogg.se

Docker rhel 8
Docker rhel 8









docker rhel 8

It should be created outside the install_docker role’s directory. We now just have to write a main playbook to use this ansible role. Now, let’s change our directory to vars and put the following code into its main.yml – -ĭocker_repo: "" 4. Now, let’s add the following code in the main.yml inside the same directory –. So, now we have 4 yaml files to get our task done. The code is – - name: Add user vagrant to docker group Lastly, let’s write a file named addUser.yml to add the user. It contains the following code – - name: Install Docker Next file into the line is installDocker.yml which will install and start the docker service. Write the following code in this file – - name: Add Docker repo Next, create a file addRepo.yml which will add and enable the official docker repository.

docker rhel 8

Write the following code in it – - name: Install required packages Then create a file installPackages.yml which will install all the required packages. Now, let’s start writing our yaml files one by one. The role structure would look like this – 3. Create a role $ ansible-galaxy init install_docker Create a directory $ mkdir ansible & cd ansible 2. Now, let’s follow a step by step approach to create our role to install Docker. We can create an Ansible role using the following command – $ ansible-galaxy init This enhances reuse-ability and promotes modularisation of configuration. We can break a complex Ansible playbook into fully independent or interdependent collections of files, tasks, templates, variables, and modules. Roles are a feature in Ansible that simplifies the playbook. Hi everyone! Today in this blog, we will be installing Docker by creating an Ansible role.











Docker rhel 8