From 1921d8e0774c32be4f403a69614a2bcfa95d448e Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Sat, 6 Apr 2019 16:59:58 -0700 Subject: [PATCH] docker was installed --- hosts | 2 +- playbook/linux/{ => docker}/InstallDocker.yml | 26 ++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) rename playbook/linux/{ => docker}/InstallDocker.yml (54%) diff --git a/hosts b/hosts index 6aad057..475d187 100644 --- a/hosts +++ b/hosts @@ -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 diff --git a/playbook/linux/InstallDocker.yml b/playbook/linux/docker/InstallDocker.yml similarity index 54% rename from playbook/linux/InstallDocker.yml rename to playbook/linux/docker/InstallDocker.yml index b48ae8c..3ac542e 100644 --- a/playbook/linux/InstallDocker.yml +++ b/playbook/linux/docker/InstallDocker.yml @@ -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 \ No newline at end of file + name: "{{ packages }}" + vars: + packages: + - docker-ce + - docker-ce-cli + - containerd.io