Ansible : Fix Package Dependency Error

- hosts: awsnode
tasks:
- name: Download the docker repo.
get_url:
url: "https://download.docker.com/linux/rhel/docker-ce.repo"
dest: "/etc/yum.repos.d"
# There is issue on above docker-ce.repo URLS, the packages not avaialble under rhel, it's available under centos.
# Below steps will first replace the existing repo file's rhel string with centos.
- name: Replace the rhel keyword in repo file with centos.
replace:
path: "/etc/yum.repos.d/docker-ce.repo"
regexp: 'rhel'
replace: 'centos'
- name: Install Docker Software
package:
name: "docker-ce"
state: present
- name: Start docker service
service:
name: "docker"
state: "started"
- name: Pull docker Image name ubuntu
docker_image:
name: ubuntu
tag: 14.04
- name: Install pip command to install python library.
package:
name: "python38-pip"
state: present
- name: Install docker-py python Library.
pip:
name: "docker-py"

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store