mirror of
https://github.com/geerlingguy/ansible-role-docker.git
synced 2025-09-21 17:51:38 +02:00
added support for login into hub via proxy
This commit is contained in:
parent
dd0c6e0f8e
commit
641957761d
@ -17,3 +17,12 @@ docker_apt_repository: "deb https://download.docker.com/linux/{{ ansible_distrib
|
||||
docker_yum_repo_url: https://download.docker.com/linux/centos/docker-{{ docker_edition }}.repo
|
||||
docker_yum_repo_enable_edge: 0
|
||||
docker_yum_repo_enable_test: 0
|
||||
|
||||
# configure corporate proxy
|
||||
docker_http_proxy: ""
|
||||
docker_no_proxy: "localhost,127.0.0.1,localaddress,.localdomain.com"
|
||||
|
||||
#login into docker hub
|
||||
docker_hub_username: ""
|
||||
docker_hub_password: ""
|
||||
docker_hub_email: ""
|
||||
|
@ -38,3 +38,27 @@
|
||||
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