Commit e08bd6f3 authored by Jeff Bean's avatar Jeff Bean Committed by Eric Paris

Configure docker daemon

parent 45bdfeac
...@@ -14,6 +14,14 @@ cluster_name: kube.local ...@@ -14,6 +14,14 @@ cluster_name: kube.local
# If a password is needed to sudo to root that password must be set here # If a password is needed to sudo to root that password must be set here
#ansible_sudo_pass: password #ansible_sudo_pass: password
# A list of insecure registrys you night need to define
insecure_registrys:
# - "gcr.io"
# If you need a proxy for the docker daemon define these here
#http_proxy: "http://proxy.example.com:3128"
#https_proxy: "http://proxy.example.com:3128"
# Kubernetes internal network for services. # Kubernetes internal network for services.
# Kubernetes services will get fake IP addresses from this range. # Kubernetes services will get fake IP addresses from this range.
# This range must not conflict with anything in your infrastructure. These # This range must not conflict with anything in your infrastructure. These
......
no_proxy: "localhost,127.0.0.0/8,::1,/var/run/docker.sock"
\ No newline at end of file
---
- name: restart docker
service: name=docker state=restarted
---
- name: Generic | Install Docker
action: "{{ ansible_pkg_mgr }}"
args:
name: docker
state: latest
---
- include: generic-install.yml
when: not is_atomic
- name: Turn down docker logging
lineinfile: dest=/etc/sysconfig/docker regexp=^OPTIONS= line=OPTIONS="--selinux-enabled --log-level=warn"
notify:
- restart docker
- name: Install http_proxy into docker-network
lineinfile: dest=/etc/sysconfig/docker-network regexp=^HTTP_PROXY= line=HTTP_PROXY="{{ http_proxy }}"
when: http_proxy is defined
notify:
- restart docker
- name: Install https_proxy into docker-network
lineinfile: dest=/etc/sysconfig/docker-network regexp=^HTTPS_PROXY= line=HTTPS_PROXY="{{ https_proxy }}"
when: https_proxy is defined
notify:
- restart docker
- name: Install no-proxy into docker-network
lineinfile: dest=/etc/sysconfig/docker-network regexp=^NO_PROXY= line=NO_PROXY="{{ no_proxy }}"
when: no_proxy is defined
notify:
- restart docker
- name: Add any insecure registrys to docker config
lineinfile: dest=/etc/sysconfig/docker regexp=^INSECURE_REGISTRY= line=INSECURE_REGISTRY='{% for reg in insecure_registrys %}--insecure-registry="{{ reg }}" {% endfor %}'
when: insecure_registrys is defined and insecure_registrys > 0
notify:
- restart docker
- name: Enable Docker
service: name=docker enabled=yes state=started
---
dependencies:
- { role: common }
- { role: kubernetes }
---
dependencies:
- { role: docker }
- { role: kubernetes }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment