Skip to content

Instantly share code, notes, and snippets.

@ederparaiso
Created November 27, 2018 21:07
Show Gist options
  • Save ederparaiso/a76878fd73a6d05a7c73df40114570da to your computer and use it in GitHub Desktop.
Save ederparaiso/a76878fd73a6d05a7c73df40114570da to your computer and use it in GitHub Desktop.
provision docker with ansible
- hosts: host-list
sudo: yes
tasks:
- name: "Installing Docker Prerequisite packages"
yum:
name: "{{ item }}"
state: latest
with_items:
- yum-utils
- device-mapper-persistent-data
- lvm2
- name: "Configuring docker-ce repo"
get_url:
url: https://download.docker.com/linux/centos/docker-ce.repo
dest: /etc/yum.repos.d/docker-ce.repo
mode: 0644
- name: "Installing Docker latest version"
yum:
name: docker-ce
state: present
- name: "Starting and Enabling Docker service"
service:
name: docker
state: started
enabled: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment