format all entries and fix issues with default value of insecure_registrys
# TODO(jchaloup): This needs to go under install.yml, it is installation source dependent
- name: Create config file directory
- file: path={{ docker_config_dir }} state=directory
+ file:
+ path: "{{ docker_config_dir }}"
+ state: directory
tags: install
- name: Install docker
# TODO(jchaloup): This needs to go under install.yml, it is installation source dependent
- name: Verify docker config files exists
- file: path={{ docker_config_dir }}/{{ item }} state=touch
+ file:
+ path: "{{ docker_config_dir }}/{{ item }}"
+ state: touch
changed_when: false
with_items:
- docker
tags: install
- name: Turn down docker logging
- lineinfile: dest={{ docker_config_dir }}/docker regexp=^OPTIONS= line=OPTIONS="--selinux-enabled --log-level=warn"
+ lineinfile:
+ dest: "{{ docker_config_dir }}/docker"
+ regexp: "^OPTIONS="
+ line: 'OPTIONS="--selinux-enabled --log-level=warn"'
notify:
- restart docker
when: docker_use_upstart
tags: configure
- name: Install http_proxy into docker(-network)
- lineinfile: dest={{ docker_config_net }} regexp="^{{ docker_env_export }}http_proxy=" line="{{docker_env_export}}http_proxy={{ http_proxy }}"
+ lineinfile:
+ dest: "{{ docker_config_net }}"
+ regexp: "^{{ docker_env_export }}http_proxy="
+ line: "{{docker_env_export}}http_proxy={{ http_proxy }}"
when: http_proxy is defined
notify:
- restart docker
tags: configure
- name: Install https_proxy into docker(-network)
- lineinfile: dest={{ docker_config_net }} regexp="^{{ docker_env_export }}https_proxy=" line="{{ docker_env_export }}https_proxy={{ https_proxy }}"
+ lineinfile:
+ dest: "{{ docker_config_net }}"
+ regexp: "^{{ docker_env_export }}https_proxy="
+ line: "{{ docker_env_export }}https_proxy={{ https_proxy }}"
when: https_proxy is defined
notify:
- restart docker
tags: configure
- name: Install no-proxy into docker(-network)
- lineinfile: dest={{ docker_config_net }} regexp="^{{ docker_env_export }}no_proxy=" line="{{ docker_env_export }}no_proxy={{ no_proxy }}"
+ lineinfile:
+ dest: "{{ docker_config_net }}"
+ regexp: "^{{ docker_env_export }}no_proxy="
+ line: "{{ docker_env_export }}no_proxy={{ no_proxy }}"
when: no_proxy is defined
notify:
- restart docker
tags: configure
+- debug:
+ msg: "{{ insecure_registrys|default([], True) }}"
+
- name: Add any insecure registrys to docker config
- lineinfile: dest={{ docker_config_dir }}/docker regexp="^INSECURE_REGISTRY=" line="INSECURE_REGISTRY={% for reg in insecure_registrys %}--insecure-registry={{ reg }} {% endfor %}"
- when:
- - insecure_registrys is defined
- - insecure_registrys|length > 0
+ lineinfile:
+ dest: "{{ docker_config_dir }}/docker"
+ regexp: "^INSECURE_REGISTRY="
+ line: "INSECURE_REGISTRY={% for reg in insecure_registrys %}--insecure-registry={{ reg }} {% endfor %}"
+ when: insecure_registrys | default([], True) | length > 0
notify:
- restart docker
tags: configure
