From d1a1eb897610f0587da21339b6577bc5fa2d73bc Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Mon, 16 Apr 2018 15:57:23 +0200 Subject: [PATCH] rgw: container add option to configure multi-site zone MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 1c084efb3cb7e48d96c9cbd6bd05ca4f93526853) Signed-off-by: Sébastien Han --- group_vars/rgws.yml.sample | 14 +++++++++++--- roles/ceph-rgw/defaults/main.yml | 14 +++++++++++--- .../ceph-rgw/tasks/docker/container_env_facts.yml | 12 ++++++++++++ roles/ceph-rgw/tasks/docker/main.yml | 5 +++++ roles/ceph-rgw/tasks/main.yml | 2 +- 5 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 roles/ceph-rgw/tasks/docker/container_env_facts.yml diff --git a/group_vars/rgws.yml.sample b/group_vars/rgws.yml.sample index 38b7e3cf7..b756756e3 100644 --- a/group_vars/rgws.yml.sample +++ b/group_vars/rgws.yml.sample @@ -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 # ########### diff --git a/roles/ceph-rgw/defaults/main.yml b/roles/ceph-rgw/defaults/main.yml index d8587fa46..75f9cc49f 100644 --- a/roles/ceph-rgw/defaults/main.yml +++ b/roles/ceph-rgw/defaults/main.yml @@ -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 index 000000000..1d4637302 --- /dev/null +++ b/roles/ceph-rgw/tasks/docker/container_env_facts.yml @@ -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 diff --git a/roles/ceph-rgw/tasks/docker/main.yml b/roles/ceph-rgw/tasks/docker/main.yml index bad0b065e..badfd027d 100644 --- a/roles/ceph-rgw/tasks/docker/main.yml +++ b/roles/ceph-rgw/tasks/docker/main.yml @@ -2,5 +2,10 @@ - name: include copy_configs.yml include: copy_configs.yml +- 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 diff --git a/roles/ceph-rgw/tasks/main.yml b/roles/ceph-rgw/tasks/main.yml index 9fd551ba7..1a54a0567 100644 --- a/roles/ceph-rgw/tasks/main.yml +++ b/roles/ceph-rgw/tasks/main.yml @@ -35,7 +35,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) -- 2.39.5