docker was installed

This commit is contained in:
James Tombleson 2019-04-06 16:59:58 -07:00
parent 769fc57791
commit 1921d8e077
2 changed files with 20 additions and 8 deletions

2
hosts
View File

@ -1,5 +1,5 @@
[linux]
192.168.0.60 ansible_connection=ssh ansible_user=miharu
192.168.0.60 ansible_connection=ssh ansible_user=ansible
[windows]
192.168.0.2 ansible_connection=winrm ansible_user=ansible

View File

@ -1,5 +1,5 @@
- name: Install Docker
- name: Install Docker CE
hosts: linux
tasks:
@ -13,22 +13,29 @@
become: true
become_method: sudo
apt:
name: install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
state: absent
name: "{{ packages }}"
# state: absent
vars:
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
- name: Install Docker GPG key
become: true
become_method: sudo
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
url: "https://download.docker.com/linux/ubuntu/gpg"
state: present
id: 0EBFCD88
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
- name: Install Docker Repo
become: true
become_method: sudo
apt_repository:
repo: https://download.docker.com/linux/ubuntu/dists/bionic/stable/binary-amd64/
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu/ bionic stable"
state: present
- name: Update Repos
@ -41,4 +48,9 @@
become: true
become_method: sudo
apt:
name: docker-ce docker-ce-cli containerd.io
name: "{{ packages }}"
vars:
packages:
- docker-ce
- docker-ce-cli
- containerd.io