made more generic to allow support of other architectures

This commit is contained in:
Denis Pitzalis 2018-01-23 17:16:49 +01:00
parent 1c18c9b94f
commit 77b2a56e90
2 changed files with 16 additions and 24 deletions

View File

@ -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

View File

@ -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 }}"