Skip to content

Commit

Permalink
docker-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
JanSkalny committed Jul 12, 2020
1 parent 79a1499 commit 4447ef7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docker-proxy/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- name: reload systemd
systemd:
daemon_reload: yes

- name: restart docker
service:
name: docker
state: restarted

14 changes: 14 additions & 0 deletions docker-proxy/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- name: prepare systemd override directory
file:
path: "/etc/systemd/system/docker.service.d"
state: directory

- name: deploy proxy.conf
template:
src: "proxy.conf"
dest: "/etc/systemd/system/docker.service.d/proxy.conf"
tags: configure
notify:
- reload systemd
- restart docker

5 changes: 5 additions & 0 deletions docker-proxy/templates/proxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Service]
Environment="HTTP_PROXY={{ proxy_env.http_proxy | default("") }}"
Environment="HTTPS_PROXY={{ proxy_env.https_proxy | default("") }}"
Environment="NO_PROXY={{ proxy_env.no_proxy | default("localhost") }}"

0 comments on commit 4447ef7

Please sign in to comment.