summaryrefslogtreecommitdiffstats
path: root/roles/docker/tasks/configure.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/docker/tasks/configure.yml')
-rw-r--r--roles/docker/tasks/configure.yml63
1 files changed, 63 insertions, 0 deletions
diff --git a/roles/docker/tasks/configure.yml b/roles/docker/tasks/configure.yml
new file mode 100644
index 0000000..5d29291
--- /dev/null
+++ b/roles/docker/tasks/configure.yml
@@ -0,0 +1,63 @@
+---
+#- name: Remove docker
+# yum: name="{{ item }}" state="absent"
+# with_items: [ docker, docker-client, docker-common ]
+
+- name: install docker
+ include_tasks: install.yml
+
+- name: start docker
+ service: name="docker" state="started"
+
+- name: Configure bridge-nf-call-iptables with sysctl
+ sysctl: name="net.bridge.bridge-nf-call-iptables" value=1 state=present sysctl_set=yes
+
+- name: Configure bridge-nf-call-ip6tables with sysctl
+ sysctl: name="net.bridge.bridge-nf-call-ip6tables" value=1 state=present sysctl_set=yes
+
+- name: Determine if loopback
+ shell: docker info | grep 'Data file:.*loop'
+ register: loop_device_check
+ failed_when: false
+ changed_when: loop_device_check.rc == 0
+
+- set_fact: docker_reinit="{{ (loop_device_check.rc == 0) or (vg == '') or (docker_setup_root and ((root_vg == '') or (vg != root_vg))) or (docker_storage_vg is defined and (docker_storage_vg != vg)) }}"
+ vars:
+ lv: "{{ ansible_lvm['lvs'][docker_lv] | default({}) }}"
+ vg: "{{ lv['vg'] | default('') }}"
+ root_lv: "{{ ansible_lvm['lvs'][docker_root_lv] | default({}) }}"
+ root_vg: "{{ root_lv['vg'] | default('') }}"
+
+- debug: msg="Re-initializing - {{ docker_reinit }}, Loopback check - {{ loop_device_check.stderr }}"
+ when: loop_device_check.stderr
+
+- import_tasks: storage.yml
+ when: docker_reinit
+
+- name: extend vg
+ lvol: vg="{{ ansible_lvm['lvs'][docker_lv]['vg'] }}" lv="{{ docker_lv }}" size="{{ docker_volume_size }}"
+ when:
+ - not docker_reinit
+ - docker_volume_size is defined
+
+- name: extend root vg
+ lvol: vg="{{ ansible_lvm['lvs'][docker_root_lv]['vg'] }}" lv="{{ docker_root_lv }}" size="{{ docker_root_volume_size }}"
+ when:
+ - not docker_reinit
+ - docker_setup_root
+ - docker_root_volume_size is defined
+
+# By default there is systemd driver installed. It is removed during OpenShift installation, but is still there during prepare stage
+# The parameters to docker can be set trough OpenShift and currently are moved there.
+#- name: Limit size of container log files
+# ghetto_json:
+# path: "/etc/docker/daemon.json"
+# log-driver: "json-file"
+# log-opts.max-size: "{{ docker_max_log_size }}"
+# log-opts.max-file: "{{ docker_max_log_files }}"
+# notify:
+# - restart docker
+
+- name: start docker
+ service: name="docker" enabled=yes state=started
+ \ No newline at end of file