]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
rgw: add rgw_multisite for containerized deployments
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 29 Oct 2018 13:05:59 +0000 (14:05 +0100)
committerSébastien Han <seb@redhat.com>
Tue, 30 Oct 2018 13:00:28 +0000 (14:00 +0100)
run commands on containers when containerized deployments.
(At the moment, all commands are run on the host only)

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-rgw/handlers/main.yml
roles/ceph-rgw/tasks/multisite/checks.yml
roles/ceph-rgw/tasks/multisite/master.yml
roles/ceph-rgw/tasks/multisite/secondary.yml

index 909f91f8703f6ab069ea2e169c23a5f199bfd986..f4b6318ca5456ba5a17d34db7a71d7b554fee13e 100644 (file)
@@ -1,6 +1,6 @@
 ---
 - name: update period
-  command: radosgw-admin --cluster {{ cluster }} period update --commit
+  command: "{{ docker_exec_cmd }} radosgw-admin --cluster {{ cluster }} period update --commit"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
 
index 896d25132c3a0b878f607a23775a2f2f9ed771b7..b1e8f9e233481565450a04c7dcf79032d114a7de 100644 (file)
@@ -1,6 +1,6 @@
 ---
 - name: check if the realm already exists
-  command: radosgw-admin realm get --rgw-realm={{ rgw_realm }}
+  command: "{{ docker_exec_cmd }} radosgw-admin realm get --rgw-realm={{ rgw_realm }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   register: realmcheck
   failed_when: False
@@ -8,7 +8,7 @@
   check_mode: no
 
 - name: check if the zonegroup already exists
-  command: radosgw-admin zonegroup get --rgw-zonegroup={{ rgw_zonegroup }}
+  command: "{{ docker_exec_cmd }} radosgw-admin zonegroup get --rgw-zonegroup={{ rgw_zonegroup }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   register: zonegroupcheck
   failed_when: False
@@ -16,7 +16,7 @@
   check_mode: no
 
 - name: check if the zone already exists
-  command: radosgw-admin zone get --rgw-zone={{ rgw_zone }}
+  command: "{{ docker_exec_cmd }} radosgw-admin zone get --rgw-zone={{ rgw_zone }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   register: zonecheck
   failed_when: False
@@ -24,7 +24,7 @@
   check_mode: no
 
 - name: check if the system user already exists
-  command: radosgw-admin user info --uid={{ rgw_zone_user }}
+  command: "{{ docker_exec_cmd }} radosgw-admin user info --uid={{ rgw_zone_user }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   register: usercheck
   failed_when: False
index fe22bc894130216b6109e0a38d63b2e20bef142b..8982e960e4c42fcc87197a25fb653c32039abf21 100644 (file)
@@ -1,27 +1,27 @@
 ---
 - name: create the realm
-  command: radosgw-admin realm create --rgw-realm={{ rgw_realm }} --default
+  command: "{{ docker_exec_cmd }} radosgw-admin realm create --rgw-realm={{ rgw_realm }} --default"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
   when:
     - "'No such file or directory' in realmcheck.stderr"
 
 - name: create the zonegroup
-  command: radosgw-admin zonegroup create --rgw-zonegroup={{ rgw_zonegroup }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --master --default
+  command: "{{ docker_exec_cmd }} radosgw-admin zonegroup create --rgw-zonegroup={{ rgw_zonegroup }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --master --default"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
   when:
     - "'No such file or directory' in zonegroupcheck.stderr"
 
 - name: create the zone
-  command: radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default --master
+  command: "{{ docker_exec_cmd }} radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default --master"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
   when:
     - "'No such file or directory' in zonecheck.stderr"
 
 - name: create the zone user
-  command: radosgw-admin user create --uid={{ rgw_zone_user }} --display-name="Zone User" --access-key={{ system_access_key }} --secret={{ system_secret_key }} --system
+  command: "{{ docker_exec_cmd }} radosgw-admin user create --uid={{ rgw_zone_user }} --display-name=\"Zone User\" --access-key={{ system_access_key }} --secret={{ system_secret_key }} --system"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
   when:
index bcff078e2d393f994823955df29b4ce7c6b16f87..4353138cbcc99a3162a10b68dedadd328510e306 100644 (file)
@@ -1,30 +1,30 @@
 ---
 - name: fetch the realm
-  command: radosgw-admin realm pull --url={{ rgw_pull_proto }}://{{ rgw_pullhost }}:{{ rgw_pull_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }}
+  command: "{{ docker_exec_cmd }} radosgw-admin realm pull --url={{ rgw_pull_proto }}://{{ rgw_pullhost }}:{{ rgw_pull_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
   when:
     - "'No such file or directory' in realmcheck.stderr"
 
 - name: fetch the period
-  command: radosgw-admin period pull --url={{ rgw_pull_proto }}://{{ rgw_pullhost }}:{{ rgw_pull_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }}
+  command: "{{ docker_exec_cmd }} radosgw-admin period pull --url={{ rgw_pull_proto }}://{{ rgw_pullhost }}:{{ rgw_pull_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
   when:
     - "'No such file or directory' in realmcheck.stderr"
 
 - name: set default realm
-  command: radosgw-admin realm default --rgw-realm={{ rgw_realm }}
+  command: "{{ docker_exec_cmd }} radosgw-admin realm default --rgw-realm={{ rgw_realm }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
 
 - name: set default zonegroup
-  command: radosgw-admin zonegroup default --rgw-zonegroup={{ rgw_zonegroup }}
+  command: "{{ docker_exec_cmd }} radosgw-admin zonegroup default --rgw-zonegroup={{ rgw_zonegroup }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
 
 - name: create the zone
-  command: radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default
+  command: "{{ docker_exec_cmd }} radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints=http://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
   when: