]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
containerized mon
authorHuamin Chen <hchen@redhat.com>
Wed, 13 Jan 2016 19:15:35 +0000 (19:15 +0000)
committerSébastien Han <seb@redhat.com>
Thu, 24 Mar 2016 15:08:20 +0000 (16:08 +0100)
group_vars/all.sample
roles/ceph-mon/tasks/docker/fetch_configs.yml
roles/ceph-mon/tasks/docker/pre_requisite.yml
roles/ceph-mon/tasks/docker/start_docker_monitor.yml
roles/ceph-osd/tasks/docker/fetch_configs.yml
roles/ceph-osd/tasks/docker/pre_requisite.yml
roles/ceph-osd/tasks/docker/start_docker_osd.yml

index 48375f7114f106de385eb5f5f057ee3c1e12cf17..4284df5952a60e50a8e09120175614706ad3ea0c 100644 (file)
@@ -337,4 +337,3 @@ dummy:
 ##########
 
 #docker: false
-
index 56e737aeeda1b99b993b333f426fb7bf9365da7c..48438dface5ce1212dd6be4d165002f2211b71b8 100644 (file)
@@ -3,7 +3,6 @@
   set_fact:
     ceph_config_keys:
       - /etc/ceph/ceph.client.admin.keyring
-      - /etc/ceph/ceph.conf
       - /etc/ceph/monmap
       - /etc/ceph/ceph.mon.keyring
       - /var/lib/ceph/bootstrap-osd/ceph.keyring
@@ -20,7 +19,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 41fb0e7fd85d71c9ea8b0251126f55c62a0514fd..f09655f64cc788a00469d3093f3d254a4d8a3b6f 100644 (file)
@@ -19,6 +19,8 @@
     - docker
     - docker.io
   when: ansible_distribution == 'Ubuntu'
+  tags:
+    with_pkg
 
 - name: install pip and docker on debian
   apt:
@@ -29,6 +31,8 @@
     - python-pip
     - docker-engine
   when: ansible_distribution == 'Debian'
+  tags:
+    with_pkg
 
 - name: install pip and docker on redhat
   yum:
@@ -40,6 +44,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
+
+- 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: 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
 
 # NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
 - name: install docker-py
   pip:
     name: docker-py
     version: 1.1.0
+  tags:
+    with_pkg
index e943fd9afcadefbfcb2b0dc336fa9cbe2813dac4..3d962822d37d826e37339cd9940b04097e89a477 100644 (file)
@@ -1,4 +1,7 @@
 ---
+- name: pull ceph daemon image
+  shell: "docker pull {{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}"
+
 - name: run the ceph Monitor docker image
   docker:
     image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}"
@@ -7,3 +10,10 @@
     state: "running"
     env: "MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=MON,CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }},{{ ceph_mon_extra_envs }}"
     volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
+
+- name: fetch ceph.conf from mon
+  fetch:
+     dest: "{{ playbook_dir }}/{{ fetch_directory }}/{{ fsid}}/etc/ceph/ceph.conf"
+     src: /etc/ceph/ceph.conf
+     flat: yes
+                                    
\ No newline at end of file
index f67200b4449950bab6122f9c4695300603cafa8a..970519807a391676c8c82329d623d9423c421f46 100644 (file)
@@ -5,6 +5,14 @@
       - /etc/ceph/ceph.conf
       - /var/lib/ceph/bootstrap-osd/ceph.keyring
 
+- name: wait for ceph.conf and keys
+  local_action: >
+    wait_for
+    path="{{ playbook_dir }}/{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
+  become: false
+  with_together:
+      - ceph_config_keys
+
 - name: stat for ceph config and keys
   local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
   with_items: ceph_config_keys
@@ -13,9 +21,9 @@
   failed_when: false
   register: statconfig
 
-- name: try to fetch ceph config and keys
+- name: try to copy ceph config and keys
   copy:
-    src: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
+    src: "{{ playbook_dir }}/{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
     dest: "{{ item.0 }}"
     owner: root
     group: root
@@ -23,5 +31,3 @@
   changed_when: false
   with_together:
     - ceph_config_keys
-    - statconfig.results
-  when: item.1.stat.exists == true
index 3f3a982c4482e97272eb47b183ce1b44aa98f41d..a4837f11f3abbd24a5cb7827bcffb2cc47c8b00c 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
+
+- 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: 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
 
 # NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
 - name: install docker-py
   pip:
     name: docker-py
     version: 1.1.0
+  tags:
+    with_pkg
index 847b07ebea7aa697fd2ed6abb989596c7a402ba1..64fccae03ec42c8c9f18f41984a1de0e8e6449ef 100644 (file)
@@ -1,4 +1,8 @@
 ---
+# (rootfs) for reasons I haven't figured out, docker pull and run will fail.
+- name: pull ceph daemon image
+  shell: "docker pull {{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}"
+
 - name: run the ceph osd docker image
   docker:
     image: "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}"