]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Refact code
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 12 Apr 2017 17:57:33 +0000 (19:57 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 24 May 2017 13:55:41 +0000 (15:55 +0200)
`ceph-docker-common`:
  At the moment there is a lot of duplicated tasks in each
  `./roles/ceph-<role>/tasks/docker/main.yml` that could be refactored in
  `./roles/ceph-docker-common/tasks/main.yml`.

`*_containerized_deployment` variables:
  All `*_containerized_deployment` have been refactored to a single
  variable `containerized_deployment`

duplicate `cephx` variables in `group_vars/* have been removed.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
defaults/main.yml
tasks/docker/fetch_image.yml [deleted file]
tasks/facts.yml
tasks/generate_cluster_fsid.yml
templates/ceph.conf.j2

index d64009490abd8f91022ee68b201224e4eaff4e8a..699aa8b27c2bce1786334660e4992750950f7368 100644 (file)
@@ -378,10 +378,10 @@ docker: false
 ceph_docker_image: "ceph/daemon"
 ceph_docker_image_tag: latest
 
-# Do not comment the following variables mon_containerized_deployment_* here. These variables are being used
+# Do not comment the following variables containerized_deployment_* here. These variables are being used
 # by ceph.conf.j2 template. so it should always be defined
-mon_containerized_deployment_with_kv: false
-mon_containerized_deployment: false
+containerized_deployment_with_kv: false
+containerized_deployment: false
 mon_containerized_default_ceph_conf_with_kv: false
 
 # Confiure the type of NFS gatway access.  At least one must be enabled for an
diff --git a/tasks/docker/fetch_image.yml b/tasks/docker/fetch_image.yml
deleted file mode 100644 (file)
index 57c76ed..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
----
-# Normal case - pull image from registry
-- name: "pull {{ ceph_docker_image }} image"
-  command: "docker pull {{ ceph_docker_registry}}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
-  changed_when: false
-  when: ceph_docker_dev_image is undefined or not ceph_docker_dev_image
-
-# Dev case - export local dev image and send it across
-- name: export local ceph dev image
-  local_action: command docker save -o "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar" "{{ ceph_docker_username }}/{{ ceph_docker_imagename }}:{{ ceph_docker_image_tag }}"
-  when: ceph_docker_dev_image is defined and ceph_docker_dev_image
-  run_once: true
-
-- name: copy ceph dev image file
-  copy:
-    src: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
-    dest: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
-  when: ceph_docker_dev_image is defined and ceph_docker_dev_image
-
-- name: load ceph dev image
-  command: "docker load -i /tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
-  when: ceph_docker_dev_image is defined and ceph_docker_dev_image
-
-- name: remove tmp ceph dev image file
-  command: "rm /tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
-  when: ceph_docker_dev_image is defined and ceph_docker_dev_image
index 0e444e00ff45890011d9facfd222d11fa5c3e25a..2056ce9dcd40842ea3edcc777d972a831d1c0d69 100644 (file)
@@ -87,4 +87,3 @@
   when:
     - rbd_client_directory_mode is not defined
       or not rbd_client_directory_mode
-
index bd4d2abe5375eb75c642c663fe2b5d546e8786c0..5f49612cacde2152fb5c2e999b79572401763d13 100644 (file)
@@ -22,3 +22,8 @@
   become: false
   always_run: true
   when: generate_fsid
+
+- name: set fsid fact when generate_fsid = true
+  set_fact:
+    fsid: "{{ cluster_uuid.stdout }}"
+  when: generate_fsid
index d9b3df1592b411419f4c4bdb16bac9906ddc368d..59ff882e9f6cd384f9321c9b2bdd451356ee4b4a 100644 (file)
@@ -11,7 +11,7 @@ auth supported = none
 {% if ip_version == 'ipv6'  %}
 ms bind ipv6 = true
 {% endif %}
-{% if not mon_containerized_deployment_with_kv and not mon_containerized_deployment %}
+{% if not containerized_deployment_with_kv and not containerized_deployment %}
 fsid = {{ fsid }}
 {% endif %}
 max open files = {{ max_open_files }}
@@ -30,7 +30,7 @@ mon initial members = {% for host in groups[mon_group_name] %}
     {% endfor %}
 {% endif %}
 
-{% if not mon_containerized_deployment and not mon_containerized_deployment_with_kv %}
+{% if not containerized_deployment and not containerized_deployment_with_kv %}
 {% if monitor_address_block %}
 mon host = {% for host in groups[mon_group_name] %}{{ hostvars[host]['ansible_all_ipv4_addresses'] | ipaddr(monitor_address_block) | first }}{% if not loop.last %},{% endif %}{% endfor %}
 {% elif groups[mon_group_name] is defined %}
@@ -50,12 +50,12 @@ mon host = {% for host in groups[mon_group_name] %}
            {% endfor %}
 {% endif %}
 {% endif %}
-{% if mon_containerized_deployment %}
+{% if containerized_deployment %}
 fsid = {{ fsid }}
 {% if groups[mon_group_name] is defined %}
 mon host = {% for host in groups[mon_group_name] %}
              {% set interface = ["ansible_",ceph_mon_docker_interface]|join %}
-             {% if mon_containerized_deployment -%}
+             {% if containerized_deployment -%}
                 {{ hostvars[host][interface]['ipv4']['address'] }}
              {%- elif hostvars[host]['monitor_address'] is defined -%}
                 {{ hostvars[host]['monitor_address'] }}