Skip to content
Snippets Groups Projects
Commit f8ffe537 authored by Antoine Legrand's avatar Antoine Legrand
Browse files

Merge pull request #124 from rackn/centos-fixes

Update docker for CentOS issues in AWS and general variables
parents 6eff3f0f 6163fe16
No related branches found
No related tags found
No related merge requests found
...@@ -47,6 +47,15 @@ ...@@ -47,6 +47,15 @@
with_items: docker_package_info.pkgs with_items: docker_package_info.pkgs
when: docker_package_info.pkgs|length > 0 when: docker_package_info.pkgs|length > 0
- name: Centos needs xfs storage type for devicemapper if used
lineinfile:
dest: /etc/sysconfig/docker-storage
line: "DOCKER_STORAGE_OPTIONS='--storage-opt dm.fs=xfs'"
regexp: '^DOCKER_STORAGE_OPTIONS=.*$'
state: present
backup: yes
when: ansible_os_family == "RedHat"
- meta: flush_handlers - meta: flush_handlers
- name: ensure docker service is started and enabled - name: ensure docker service is started and enabled
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
- name: Set docker daemon options - name: Set docker daemon options
template: template:
src: docker src: docker
dest: "/etc/default/docker" dest: "{{ '/etc/sysconfig/docker-network' if ansible_os_family == 'RedHat' else '/etc/default/docker' }}"
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
......
# Deployed by Ansible # Deployed by Ansible
{% if init_system == "sysvinit" and kube_network_plugin == "flannel" and ansible_os_family == "Debian" %} {% if init_system == "sysvinit" and kube_network_plugin == "flannel" and ansible_os_family == "Debian" %}
DOCKER_OPTS="--bip={{ flannel_subnet }} --mtu={{ flannel_mtu }}" DOCKER_OPTS="--bip={{ flannel_subnet }} --mtu={{ flannel_mtu }}"
{% elif kube_network_plugin == "flannel" and ansible_os_family == "RedHat" %}
DOCKER_NETWORK_OPTIONS="--bip={{ flannel_subnet }} --mtu={{ flannel_mtu }}"
{% elif kube_network_plugin == "flannel" %} {% elif kube_network_plugin == "flannel" %}
OPTIONS="--bip={{ flannel_subnet }} --mtu={{ flannel_mtu }}" OPTIONS="--bip={{ flannel_subnet }} --mtu={{ flannel_mtu }}"
{% endif %} {% endif %}
...@@ -11,7 +11,13 @@ Requires=docker.socket ...@@ -11,7 +11,13 @@ Requires=docker.socket
[Service] [Service]
Type=notify Type=notify
{% if ansible_os_family == "RedHat" %}
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-network
EnvironmentFile=-/etc/sysconfig/docker-storage
{% elif ansible_os_family == "Debian" %}
EnvironmentFile=-/etc/default/docker EnvironmentFile=-/etc/default/docker
{% endif %}
Environment=GOTRACEBACK=crash Environment=GOTRACEBACK=crash
ExecStart=/usr/bin/docker daemon \ ExecStart=/usr/bin/docker daemon \
$OPTIONS \ $OPTIONS \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment