]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
containerize rgw and restapi
authorHuamin Chen <hchen@redhat.com>
Fri, 22 Jan 2016 19:10:41 +0000 (19:10 +0000)
committerSébastien Han <seb@redhat.com>
Thu, 24 Mar 2016 15:10:42 +0000 (16:10 +0100)
Signed-off-by: Huamin Chen <hchen@redhat.com>
roles/ceph-restapi/tasks/docker/fetch_configs.yml
roles/ceph-restapi/tasks/docker/pre_requisite.yml
roles/ceph-rgw/tasks/docker/fetch_configs.yml
roles/ceph-rgw/tasks/docker/pre_requisite.yml
roles/ceph-rgw/tasks/docker/start_docker_rgw.yml

index 919bf0a5c1ed22d78be5f43320f6a0043c9fff00..2faf8ade5289a289f50751ba698dfb1ea5fa3ec6 100644 (file)
@@ -15,7 +15,7 @@
 
 - name: try to fetch ceph config and keys
   copy:
-    src: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
+    src: "{{ playbook_dir }}/{{ fetch_directory }}/{{ fsid }}/{{ item.0 }}"
     dest: "{{ item.0 }}"
     owner: root
     group: root
index 3eef686899afeabcc494659302a8333bd35cb917..f2d9ecd70cdffb7877caa52606e1c1e1816bd4ce 100644 (file)
@@ -9,6 +9,8 @@
     - docker
     - docker.io
   when: ansible_distribution == 'Ubuntu'
+  tags:
+    with_pkg
 
 - name: install pip and docker on debian
   apt:
@@ -19,6 +21,8 @@
     - python-pip
     - docker-engine
   when: ansible_distribution == 'Debian'
+  tags:
+    with_pkg
 
 - name: install pip and docker on redhat
   yum:
@@ -30,6 +34,8 @@
   when:
     ansible_os_family == 'RedHat' and
     ansible_pkg_mgr == "yum"
+  tags:
+    with_pkg
 
 - name: install pip and docker on redhat
   dnf:
   when:
     ansible_os_family == 'RedHat' and
     ansible_pkg_mgr == "dnf"
+  tags:
+    with_pkg
 
-# NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
-- name: install docker-py
+- name: install epel-release on redhat
+  yum:
+    name: epel-release
+    state: present
+  when: ansible_os_family == 'RedHat'
+  tags:
+    with_pkg
+
+# NOTE (jimcurtis): need at least version 1.9.0 of six or we get:
+# re:NameError: global name 'DEFAULT_DOCKER_API_VERSION' is not defined
+- name: install six
   pip:
-    name: docker-py
-    version: 1.1.0
+    name: six
+    version: 1.9.0
+  tags:
+    with_pkg
+
+- name: pause after docker install before starting (on openstack vms)
+  pause: seconds=5
+  when: ceph_docker_on_openstack
+  tags:
+    with_pkg
+
+- name: start docker service
+  service:
+    name: docker
+    state: started
+    enabled: yes
+  tags:
+    with_pkg
index bd65d7d8f4fc89dd9f4cf81f3eb7346f4e36e1f3..45dd3bebcd40db0d1fc14a5c9aabe29ed56524f3 100644 (file)
@@ -15,7 +15,7 @@
 
 - name: try to fetch ceph config and keys
   copy:
-    src: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
+    src: "{{ playbook_dir }}/{{ fetch_directory }}/{{ fsid }}/{{ item.0 }}"
     dest: "{{ item.0 }}"
     owner: root
     group: root
index c0a98451a11f87a2fd8347fbb8c41231192603c2..d288e6f58e3d73e3ef06ca97c149e2ea7d54ba5d 100644 (file)
@@ -17,6 +17,8 @@
     - docker
     - docker.io
   when: ansible_distribution == 'Ubuntu'
+  tags:
+    with_pkg
 
 - name: install pip and docker on debian
   apt:
@@ -27,6 +29,8 @@
     - python-pip
     - docker-engine
   when: ansible_distribution == 'Debian'
+  tags:
+    with_pkg
 
 - name: install pip and docker on redhat
   yum:
@@ -38,6 +42,8 @@
   when:
     ansible_os_family == 'RedHat' and
     ansible_pkg_mgr == "yum"
+  tags:
+    with_pkg
 
 - name: install pip and docker on redhat
   dnf:
   when:
     ansible_os_family == 'RedHat' and
     ansible_pkg_mgr == "dnf"
+  tags:
+    with_pkg
 
-# NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
-- name: install docker-py
+- name: install epel-release on redhat
+  yum:
+    name: epel-release
+    state: present
+  when: ansible_os_family == 'RedHat'
+  tags:
+    with_pkg
+
+# NOTE (jimcurtis): need at least version 1.9.0 of six or we get:
+# re:NameError: global name 'DEFAULT_DOCKER_API_VERSION' is not defined
+- name: install six
   pip:
-    name: docker-py
-    version: 1.1.0
+    name: six
+    version: 1.9.0
+  tags:
+    with_pkg
+
+- name: pause after docker install before starting (on openstack vms)
+  pause: seconds=5
+  when: ceph_docker_on_openstack
+  tags:
+    with_pkg
+
+- name: start docker service
+  service:
+    name: docker
+    state: started
+    enabled: yes
+  tags:
+    with_pkg
index 65781fbba341b8ab4d22cbee38c2a57565de58c2..ce551848a5f00922e2d9d3cc3a0e8a6302279db3 100644 (file)
@@ -1,10 +1,13 @@
 ---
+- name: pull ceph daemon image
+  shell: "docker pull {{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}"
+
 - name: run the rados gateway docker image
   docker:
     image: "{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}"
     name: ceph-{{ ansible_hostname }}-rgw
-    expose=: "{{ ceph_rgw_civetweb_port }}"
+    expose: "{{ ceph_rgw_civetweb_port }}"
     ports: "{{ ceph_rgw_civetweb_port }}:{{ ceph_rgw_civetweb_port }}"
     state: running
-    env=: "CEPH_DAEMON=RGW,{{ ceph_rgw_docker_extra_env }}"
+    env: "CEPH_DAEMON=RGW,{{ ceph_rgw_docker_extra_env }}"
     volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"