]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
rgw: container add option to configure multi-site zone
authorSébastien Han <seb@redhat.com>
Mon, 16 Apr 2018 13:57:23 +0000 (15:57 +0200)
committerSébastien Han <seb@redhat.com>
Thu, 24 May 2018 18:32:05 +0000 (11:32 -0700)
You can now use RGW_ZONE and RGW_ZONEGROUP on each rgw host from your
inventory and assign them a value. Once the rgw container starts it'll
pick the info and add itself to the right zone.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1551637
Signed-off-by: Sébastien Han <seb@redhat.com>
group_vars/rgws.yml.sample
roles/ceph-rgw/defaults/main.yml
roles/ceph-rgw/tasks/docker/container_env_facts.yml [new file with mode: 0644]
roles/ceph-rgw/tasks/docker/main.yml
roles/ceph-rgw/tasks/main.yml

index 38b7e3cf7368fa68b4a16996ebf947c10f4eab2d..b756756e3375b3f5e6826fc1f48e552b2e9eec3c 100644 (file)
@@ -24,9 +24,9 @@ dummy:
 #rgw_pull_proto: "http"
 
 
-########
-#TUNING#
-########
+##########
+# TUNING #
+##########
 
 # To support buckets with a very large number of objects it's
 # important to split them into shards. We suggest about 100K
@@ -67,6 +67,14 @@ dummy:
 #rgw_config_keys: "/" # DON'T TOUCH ME
 
 
+#############
+# MULTISITE #
+#############
+#rgw_multisite: false
+#rgw_zonegroup: ""
+#rgw_zone: ""
+
+
 ###########
 # SYSTEMD #
 ###########
index d8587fa4634e09223ac05964a9e98c2008734acc..75f9cc49fb08f2e65be6aec9bf04415c450f8769 100644 (file)
@@ -16,9 +16,9 @@ rgw_pull_port: "{{ radosgw_civetweb_port }}"
 rgw_pull_proto: "http"
 
 
-########
-#TUNING#
-########
+##########
+# TUNING #
+##########
 
 # To support buckets with a very large number of objects it's
 # important to split them into shards. We suggest about 100K
@@ -59,6 +59,14 @@ ceph_config_keys: [] # DON'T TOUCH ME
 rgw_config_keys: "/" # DON'T TOUCH ME
 
 
+#############
+# MULTISITE #
+#############
+rgw_multisite: false
+rgw_zonegroup: ""
+rgw_zone: ""
+
+
 ###########
 # SYSTEMD #
 ###########
diff --git a/roles/ceph-rgw/tasks/docker/container_env_facts.yml b/roles/ceph-rgw/tasks/docker/container_env_facts.yml
new file mode 100644 (file)
index 0000000..1d46373
--- /dev/null
@@ -0,0 +1,12 @@
+---
+- name: set_fact docker_env_args '-e RGW_ZONEGROUP={{ rgw_zonegroup }}'
+  set_fact:
+    docker_env_args: -e RGW_ZONEGROUP={{ rgw_zonegroup }}
+  when:
+    - rgw_zonegroup != ""
+
+- name: set_fact docker_env_args '-e RGW_ZONE={{ rgw_zone }}'
+  set_fact:
+    docker_env_args: "{{ docker_env_args | default ('') }} -e RGW_ZONE={{ rgw_zone }}"
+  when:
+    - rgw_zone != ""
\ No newline at end of file
index 0928e5739ff221a26e7471d518bfb8a6c135061e..4850e4b7c792d1aa60d09816af6b6c74bf5ff3f8 100644 (file)
@@ -1,3 +1,8 @@
 ---
+- name: include container_env_facts.yml
+  include: container_env_facts.yml
+  when:
+    - containerized_deployment
+
 - name: include start_docker_rgw.yml
   include: start_docker_rgw.yml
index e760d4bfe22c572b0381fea7faffb6ef510f7490..6ae24e99782eb81611e5dbd461af4274ac756cae 100644 (file)
@@ -38,7 +38,7 @@
 - name: include multisite/main.yml
   include: multisite/main.yml
   when:
-    - rgw_zone is defined
+    - rgw_zone != ""
     - rgw_multisite
     - ceph_release_num[ceph_release] >= ceph_release_num.jewel
   # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)