mirror of
https://github.com/geerlingguy/ansible-role-docker.git
synced 2025-09-21 17:51:38 +02:00
made more generic to allow support of other architectures
This commit is contained in:
parent
1c18c9b94f
commit
77b2a56e90
@ -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
|
||||
|
@ -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 }}"
|
||||
|
Loading…
Reference in New Issue
Block a user