소스 검색

Add CentOS support to the docker-storage-setup role

This let's us use the role on CentOS systems, as well as RHEL. In addition, it
installs docker and makes sure it's restarted (as opposed to just "started"
which has no effect when docker is already running).
Tomas Sedovic 7 년 전
부모
커밋
5a6c192782
1개의 변경된 파일17개의 추가작업 그리고 1개의 파일을 삭제
  1. 17 1
      roles/docker-storage-setup/tasks/main.yaml

+ 17 - 1
roles/docker-storage-setup/tasks/main.yaml

@@ -25,5 +25,21 @@
     - ansible_distribution_version | version_compare('7.4', '<')
     - ansible_distribution == "RedHat"
 
+- block:
+    - name: create the docker-storage-setup config file for CentOS
+      template:
+        src: "{{ role_path }}/templates/docker-storage-setup-dm.j2"
+        dest: /etc/sysconfig/docker-storage-setup
+        owner: root
+        group: root
+        mode: 0644
+
+  # TODO(shadower): Find out which CentOS version supports overlayfs2
+  when:
+    - ansible_distribution == "CentOS"
+
+- name: Install Docker
+  package: name=docker state=present
+
 - name: start docker
-  service: name=docker state=started enabled=true
+  service: name=docker state=restarted enabled=true