From 77b2a56e902ade0a83f6a58f20356a954faa5566 Mon Sep 17 00:00:00 2001 From: Denis Pitzalis Date: Tue, 23 Jan 2018 17:16:49 +0100 Subject: [PATCH] made more generic to allow support of other architectures --- tasks/main.yml | 16 ++++++++++++++++ tasks/setup-Debian.yml | 24 ------------------------ 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index ba197cf..a77dbe5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,6 +8,22 @@ - name: Install Docker. package: name={{ docker_package }} state={{ docker_package_state }} +- name: Docker | Configure Proxy - Ubuntu systemd + when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '16.04' + blockinfile: + path: /lib/systemd/system/docker.service + insertafter: '^\[Service\]$' + content: | + Environment="HTTP_PROXY={{ docker_http_proxy }}" + Environment="HTTPS_PROXY={{ docker_http_proxy }}" + Environment="NO_PROXY={{ docker_no_proxy }}" + +- name: Docker | Log into DockerHub + docker_login: + username: "{{ docker_hub_username }}" + password: "{{ docker_hub_password }}" + email: "{{ docker_hub_email }}" + - name: Ensure Docker is started and enabled at boot. service: name: docker diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index f8edf47..d0be48d 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -38,27 +38,3 @@ repo: "{{ docker_apt_repository }}" state: present update_cache: yes - -- name: Docker | Configure Proxy - Ubuntu systemd - when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '16.04' - blockinfile: - path: /lib/systemd/system/docker.service - insertafter: '^\[Service\]$' - content: | - Environment="HTTP_PROXY={{ docker_http_proxy }}" - Environment="HTTPS_PROXY={{ docker_http_proxy }}" - Environment="NO_PROXY={{ docker_no_proxy }}" - -- name: Docker | Reload configuration - systemd: - name: docker - enabled: yes - masked: no - daemon_reload: yes - state: restarted - -- name: Docker | Log into DockerHub - docker_login: - username: "{{ docker_hub_username }}" - password: "{{ docker_hub_password }}" - email: "{{ docker_hub_email }}"