]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-rgw: introduce rgw zone to the name schema
authorSeena Fallah <seenafallah@gmail.com>
Tue, 7 May 2024 18:41:53 +0000 (20:41 +0200)
committerSeena Fallah <seenafallah@gmail.com>
Thu, 16 May 2024 22:42:49 +0000 (00:42 +0200)
This is needed by ceph-exporter as it is parsing the socket by the number of dots.
Although the rgw_zone variable is only using for constructing the client name
and has nothing to do with multisiting.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit 1121e6d98a41a913886240bcb873380008afcafc)

26 files changed:
.gitignore
group_vars/all.yml.sample
group_vars/rgws.yml.sample
infrastructure-playbooks/cephadm-adopt.yml
infrastructure-playbooks/purge-cluster.yml
infrastructure-playbooks/rolling_update.yml
infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml
profiles/rgw-keystone-v2
profiles/rgw-keystone-v3
profiles/rgw-radosgw-static-website
profiles/rgw-usage-log
roles/ceph-config/tasks/main.yml
roles/ceph-config/tasks/rgw_systemd_environment_file.yml
roles/ceph-defaults/defaults/main.yml
roles/ceph-handler/tasks/check_running_containers.yml
roles/ceph-handler/templates/restart_rgw_daemon.sh.j2
roles/ceph-rgw/defaults/main.yml
roles/ceph-rgw/handlers/main.yml
roles/ceph-rgw/tasks/common.yml
roles/ceph-rgw/tasks/pre_requisite.yml
roles/ceph-rgw/tasks/start_docker_rgw.yml
roles/ceph-rgw/tasks/start_radosgw.yml
roles/ceph-rgw/templates/ceph-radosgw.service.j2
tests/functional/collect-logs.yml
tests/functional/tests/rgw/test_rgw.py
tox.ini

index 23d4c25bb5602959821effe94fc695c76b5a7d8c..cbabf997f4306cd727727a42165d8605c465bbc4 100644 (file)
@@ -21,3 +21,4 @@ ceph-ansible.spec
 !.mergify.yml
 !raw_install_python.yml
 !requirements.yml
+.vscode/
index 0bd819e742ff6d7ca3fab36dd097802aee6d4233..e534fa9624bc3fbcc5bd0dd8684a87425fb5be0b 100644 (file)
@@ -368,8 +368,7 @@ dummy:
 #radosgw_address_block: subnet
 #radosgw_keystone_ssl: false # activate this when using keystone PKI keys
 #radosgw_num_instances: 1
-# Rados Gateway options
-#email_address: foo@bar.com
+#rgw_zone: default  # This is used for rgw instance client names.
 
 
 ## Testing mode
@@ -445,7 +444,7 @@ dummy:
 #   global:
 #     foo: 1234
 #     bar: 5678
-#   "client.rgw.{{ hostvars[groups.get(rgw_group_name)[0]]['ansible_facts']['hostname'] }}":
+#   "client.rgw.{{ rgw_zone }}.{{ hostvars[groups.get(rgw_group_name)[0]]['ansible_facts']['hostname'] }}":
 #     rgw_zone: zone1
 #
 #ceph_conf_overrides: {}
index 76e57a6e9698dfc1e4b933d4a950a0267406a1f7..5445ec8f2ed97e46c2669d0d1183850dd7bcb87a 100644 (file)
@@ -88,11 +88,11 @@ dummy:
 # If you want to add parameters, you should retain the existing ones and include the new ones.
 #ceph_rgw_container_params:
 #  volumes:
-#    - /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.${INST_NAME}:/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.${INST_NAME}:z
+#    - /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.${INST_NAME}:/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.${INST_NAME}:z
 #  args:
 #    - -f
-#    - -n=client.rgw.{{ ansible_facts['hostname'] }}.${INST_NAME}
-#    - -k=/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.${INST_NAME}/keyring
+#    - -n=client.rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.${INST_NAME}
+#    - -k=/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.${INST_NAME}/keyring
 
 ###########
 # SYSTEMD #
index 6ab66358ca3f3f0dc927753fdd3fe8230c979ead..3922e07901ac5880504317bc22997ef2f6f17f35 100644 (file)
 
     - name: Stop and disable ceph-radosgw systemd service
       ansible.builtin.service:
-        name: "ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
+        name: "ceph-radosgw@rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
         state: stopped
         enabled: false
       failed_when: false
       failed_when: false
 
     - name: Reset failed ceph-radosgw systemd unit
-      ansible.builtin.command: "systemctl reset-failed ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"  # noqa command-instead-of-module
+      ansible.builtin.command: "systemctl reset-failed ceph-radosgw@rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"  # noqa command-instead-of-module
       changed_when: false
       failed_when: false
       loop: '{{ rgw_instances }}'
 
     - name: Remove legacy ceph radosgw data
       ansible.builtin.file:
-        path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
+        path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
         state: absent
       loop: '{{ rgw_instances }}'
 
     - name: Remove legacy ceph radosgw directory
       ansible.builtin.file:
-        path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}"
+        path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}"
         state: absent
 
 - name: Redeploy rbd-mirror daemons
index 9107658f38be3c82346fda00a2ffe50ac4bb015f..b55e468492d07533cdc7b1099d77a67e7b20d3ce 100644 (file)
 
     - name: Stop ceph rgws with systemd
       ansible.builtin.service:
-        name: "ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
+        name: "ceph-radosgw@rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
         state: stopped
         enabled: false
       failed_when: false
index ef391f017272a635ad91f92b8a87fd01368e07dd..21bafa9100d983573e0164c87afcfadb94eb51b0 100644 (file)
 
     - name: Stop ceph rgw when upgrading from stable-3.2  # noqa: ignore-errors
       ansible.builtin.systemd:
-        name: ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}
+        name: ceph-radosgw@rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}
         state: stopped
         enabled: false
         masked: true
 
     - name: Stop ceph rgw
       ansible.builtin.systemd:
-        name: ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}
+        name: ceph-radosgw@rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}
         state: stopped
         enabled: false
         masked: true
index 023fd3c0977401737ea65388d58e14c668928027..851618ac0838afd4c1127420c4986e2f56183312 100644 (file)
   tasks:
     - name: Stop non-containerized ceph rgw(s)
       ansible.builtin.service:
-        name: "ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
+        name: "ceph-radosgw@rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
         state: stopped
         enabled: false
       with_items: "{{ rgw_instances }}"
index 861815a0752845b22fec96b979575ed7c7d48607..05fc81571be73f6a1acd5756256493e450dd379e 100644 (file)
@@ -7,7 +7,7 @@
 
 
 ceph_conf_overrides:
-  "client.rgw.{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}":
+  "client.rgw.{{ rgw_zone }}.{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}":
     "rgw keystone api version": "2"
     "rgw keystone url": "http://192.168.0.1:35357"
     "rgw keystone admin token": "password"
index ae5e045741f1cdd8bdf3004c30d63c445be78559..a82d96b683cad13aeb5b2c56abf526fe9812d76d 100644 (file)
@@ -7,7 +7,7 @@
 
 
 ceph_conf_overrides:
-  "client.rgw.{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}":
+  "client.rgw.{{ rgw_zone }}.{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}":
     "rgw keystone api version": "3"
     "rgw keystone url": "http://192.168.0.1:35357"
     "rgw keystone admin token": "password"
index 1cd18c260723a0cc59c61c685fdb88fece69c659..fc1ff890e0dd3505a819d260e34dacf80c0e1c48 100644 (file)
@@ -6,6 +6,6 @@
 # The double quotes are important, do NOT remove them.
 
 ceph_conf_overrides:
-  "client.rgw.{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}":
+  "client.rgw.{{ rgw_zone }}.{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}":
     rgw enable static website = true
     rgw dns s3website name = objects-website-region.domain.com
index af704fb7276a94a2ef4bb170378aa22b6afabc61..2f0a6021d3fc13baecaee32c360cf23c44fba848 100644 (file)
@@ -6,7 +6,7 @@
 # The double quotes are important, do NOT remove them.
 
 ceph_conf_overrides:
-  "client.rgw.{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}":
+  "client.rgw.{{ rgw_zone }}.{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}":
     rgw enable usage log = true
     rgw usage log tick interval = 30
     rgw usage log flush threshold = 1024
index acfee21d1abaa53f78cf0387b4a9d210addccb4f..3dad8af7a8ea379d36c190b4d2f0a291fa858d97 100644 (file)
       ansible.builtin.set_fact:
         _ceph_ansible_rgw_conf: >-
           {{ _ceph_ansible_rgw_conf | default({}) | combine({
-              'client.rgw.' + ansible_facts['hostname'] + '.' + item.instance_name: {
-                'log_file': '/var/log/ceph/' + cluster + '-rgw-' + ansible_facts['hostname'] + '.' + item.instance_name + '.log',
+              'client.rgw.' + rgw_zone + '.' + ansible_facts['hostname'] + '.' + item.instance_name: {
+                'log_file': '/var/log/ceph/' + cluster + '-rgw-' + rgw_zone + '-' + ansible_facts['hostname'] + '.' + item.instance_name + '.log',
                 'rgw_frontends': 'beast ' + _rgw_beast_endpoint + _rgw_beast_ssl_option,
               }
           }, recursive=true) }}
index 5876738ade25cf9f7014667f33bf10aaee7af4e7..df52e6abcd60e2c9203b56e2cf9665cb2a373317 100644 (file)
@@ -1,7 +1,7 @@
 ---
 - name: Create rados gateway instance directories
   ansible.builtin.file:
-    path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
+    path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
     state: directory
     owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
@@ -10,7 +10,7 @@
 
 - name: Generate environment file
   ansible.builtin.copy:
-    dest: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}/EnvironmentFile"
+    dest: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}/EnvironmentFile"
     owner: "root"
     group: "root"
     mode: "0644"
index 107b0b7bcb7bfb8372928b9d58d9b94205d384f3..ffb6abfe6a6657d1d8a7717f39945d5a67304678 100644 (file)
@@ -360,8 +360,7 @@ radosgw_address: x.x.x.x
 radosgw_address_block: subnet
 radosgw_keystone_ssl: false # activate this when using keystone PKI keys
 radosgw_num_instances: 1
-# Rados Gateway options
-email_address: foo@bar.com
+rgw_zone: default  # This is used for rgw instance client names.
 
 
 ## Testing mode
@@ -437,7 +436,7 @@ ceph_rbd_mirror_pool: "rbd"
 #   global:
 #     foo: 1234
 #     bar: 5678
-#   "client.rgw.{{ hostvars[groups.get(rgw_group_name)[0]]['ansible_facts']['hostname'] }}":
+#   "client.rgw.{{ rgw_zone }}.{{ hostvars[groups.get(rgw_group_name)[0]]['ansible_facts']['hostname'] }}":
 #     rgw_zone: zone1
 #
 ceph_conf_overrides: {}
index 0c006b8864fe2679a1a1bec34d10e28c7b3b8309..2f6a40ff52e33d6114965e79ea618c52024c5a1b 100644 (file)
@@ -24,7 +24,7 @@
   when: inventory_hostname in groups.get(mds_group_name, [])
 
 - name: Check for a rgw container
-  ansible.builtin.command: "{{ container_binary }} ps -q --filter='name=ceph-rgw-{{ ansible_facts['hostname'] }}'"
+  ansible.builtin.command: "{{ container_binary }} ps -q --filter='name=ceph-rgw-{{ rgw_zone }}-{{ ansible_facts['hostname'] }}'"
   register: ceph_rgw_container_stat
   changed_when: false
   failed_when: false
index 0c7a8ff0d797672204334ff6a20c12cf5428838e..5ea0f3c7db2cff3edbe7b0859911cc7e3f3d78f4 100644 (file)
@@ -13,13 +13,14 @@ fi
 INSTANCES_NAME=({% for i in rgw_instances %}{{ i.instance_name }} {% endfor %})
 RGW_IPS=({% for i in rgw_instances %}{{ i.radosgw_address }} {% endfor %})
 RGW_PORTS=({% for i in rgw_instances %}{{ i.radosgw_frontend_port }} {% endfor %})
+RGW_ZONE="{{ rgw_zone }}"
 declare -a DOCKER_EXECS
 declare -a SOCKET_PREFIX
 for ((i=0; i<${RGW_NUMS}; i++)); do
-  SOCKET_PREFIX[i]="/var/run/ceph/{{ cluster }}-client.rgw.${HOST_NAME}.${INSTANCES_NAME[i]}"
+  SOCKET_PREFIX[i]="/var/run/ceph/{{ cluster }}-client.rgw.${RGW_ZONE}.${HOST_NAME}.${INSTANCES_NAME[i]}"
   DOCKER_EXECS[i]=""
 {% if containerized_deployment | bool %}
-  DOCKER_EXECS[i]="{{ container_binary }} exec ceph-rgw-${HOST_NAME}-${INSTANCES_NAME[i]}"
+  DOCKER_EXECS[i]="{{ container_binary }} exec ceph-rgw-${RGW_ZONE}-${HOST_NAME}-${INSTANCES_NAME[i]}"
 {% endif %}
 done
 
@@ -38,7 +39,7 @@ check_socket() {
   done
   if [ $succ -ne 1 ]; then
     echo "Socket file ${SOCKET} could not be found, which means Rados Gateway is not running. Showing ceph-rgw unit logs now:"
-    journalctl -u ceph-radosgw@rgw.${HOST_NAME}.${INSTANCES_NAME[i]}
+    journalctl -u ceph-radosgw@rgw.${RGW_ZONE}.${HOST_NAME}.${INSTANCES_NAME[i]}
     exit 1
   fi
 }
@@ -81,10 +82,10 @@ for ((i=0; i<${RGW_NUMS}; i++)); do
 
   # Check if systemd unit exists
   # This is needed for new instances as the restart might trigger before the deployment
-  if systemctl list-units --full --all | grep -q "ceph-radosgw@rgw.${HOST_NAME}.${INSTANCES_NAME[i]}"; then
-    systemctl restart ceph-radosgw@rgw.${HOST_NAME}.${INSTANCES_NAME[i]}
+  if systemctl list-units --full --all | grep -q "ceph-radosgw@rgw.${RGW_ZONE}.${HOST_NAME}.${INSTANCES_NAME[i]}"; then
+    systemctl restart ceph-radosgw@rgw.${RGW_ZONE}.${HOST_NAME}.${INSTANCES_NAME[i]}
   else
-    echo "Systemd unit ceph-radosgw@rgw.${HOST_NAME}.${INSTANCES_NAME[i]} does not exist."
+    echo "Systemd unit ceph-radosgw@rgw.${RGW_ZONE}.${HOST_NAME}.${INSTANCES_NAME[i]} does not exist."
     continue
   fi
 
index c53edd5c9acabd09a18cd09051eb19de0531d09a..4e16074ff5e0c1d3ad7e7eac61bf3fddd14278e1 100644 (file)
@@ -80,11 +80,11 @@ rgw_config_keys: "/" # DON'T TOUCH ME
 # If you want to add parameters, you should retain the existing ones and include the new ones.
 ceph_rgw_container_params:
   volumes:
-    - /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.${INST_NAME}:/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.${INST_NAME}:z
+    - /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.${INST_NAME}:/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.${INST_NAME}:z
   args:
     - -f
-    - -n=client.rgw.{{ ansible_facts['hostname'] }}.${INST_NAME}
-    - -k=/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.${INST_NAME}/keyring
+    - -n=client.rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.${INST_NAME}
+    - -k=/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.${INST_NAME}/keyring
 
 ###########
 # SYSTEMD #
index a0344c7fa033ec1338d43609e574223f5685e2bc..54d24b781ace411636d9fee1c822e93a7720424c 100644 (file)
@@ -1,6 +1,6 @@
 ---
 - name: Restart rgw
   ansible.builtin.service:
-    name: "ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
+    name: "ceph-radosgw@rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
     state: restarted
   with_items: "{{ rgw_instances }}"
index 3b2604d3c68f78f1ed60d46dbadd9129a2baf74b..225f9ecae4532e183bd0aa0f0e4ced03fa74244a 100644 (file)
@@ -1,13 +1,4 @@
 ---
-- name: Create rados gateway directories
-  ansible.builtin.file:
-    path: "{{ item }}"
-    state: directory
-    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
-    mode: "{{ ceph_directories_mode }}"
-  with_items: "{{ rbd_client_admin_socket_path }}"
-
 - name: Get keys from monitors
   ceph_key:
     name: "{{ item.name }}"
index a31b88dfb244ab2c07996acb75214fb6d8355e46..2f374cb075a22fb3993cd91e7ee343afc6608146 100644 (file)
@@ -1,7 +1,7 @@
 ---
 - name: Create rados gateway directories
   ansible.builtin.file:
-    path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
+    path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
     state: directory
     owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
 
 - name: Create rgw keyrings
   ceph_key:
-    name: "client.rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
+    name: "client.rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
     cluster: "{{ cluster }}"
     user: "client.bootstrap-rgw"
     user_key: /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring
-    dest: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}/keyring"
+    dest: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}/keyring"
     caps:
       osd: 'allow rwx'
       mon: 'allow rw'
@@ -34,7 +34,7 @@
 
 - name: Get keys from monitors
   ceph_key:
-    name: "client.rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
+    name: "client.rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
     cluster: "{{ cluster }}"
     output_format: plain
     state: info
@@ -51,7 +51,7 @@
 
 - name: Copy ceph key(s) if needed
   ansible.builtin.copy:
-    dest: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.{{ item.item.instance_name }}/keyring"
+    dest: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.item.instance_name }}/keyring"
     content: "{{ item.stdout + '\n' }}"
     owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
index cffeec811a1f9c887db3fc624723b077322f1a32..c9df6c77f0d7a90a95c9a96483981372e7d0cf26 100644 (file)
@@ -4,7 +4,7 @@
 
 - name: Systemd start rgw container
   ansible.builtin.systemd:
-    name: ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}
+    name: ceph-radosgw@rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}
     state: started
     enabled: true
     masked: false
index 805667548acc5f8a4034bffa8efbf48f0462e6f7..5de184fb1add178592c8bf644039339d6614390b 100644 (file)
@@ -16,7 +16,7 @@
 
 - name: Start rgw instance
   ansible.builtin.systemd:
-    name: ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}
+    name: ceph-radosgw@rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}
     state: started
     enabled: true
     masked: false
index 524817653d6151bbe8392c209421c1c959661123..38fd968183c35c3247243dcbc52e1652334064b7 100644 (file)
@@ -14,12 +14,12 @@ Wants=network-online.target local-fs.target time-sync.target
 EnvironmentFile=/var/lib/ceph/radosgw/{{ cluster }}-%i/EnvironmentFile
 {% if container_binary == 'podman' %}
 ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
-ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-rgw-{{ ansible_facts['hostname'] }}-${INST_NAME}
+ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-rgw-{{ rgw_zone }}-{{ ansible_facts['hostname'] }}-${INST_NAME}
 ExecStartPre=-/usr/bin/mkdir -p /var/log/ceph
 {% else %}
-ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-rgw-{{ ansible_facts['hostname'] }}-${INST_NAME}
+ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-rgw-{{ rgw_zone }}-{{ ansible_facts['hostname'] }}-${INST_NAME}
 {% endif %}
-ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-rgw-{{ ansible_facts['hostname'] }}-${INST_NAME}
+ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-rgw-{{ rgw_zone }}-{{ ansible_facts['hostname'] }}-${INST_NAME}
 ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
 {% if container_binary == 'podman' %}
   -d --log-driver journald --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
@@ -46,14 +46,14 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
 {% if radosgw_frontend_ssl_certificate -%}
   -v {{ radosgw_frontend_ssl_certificate }}:{{ radosgw_frontend_ssl_certificate }} \
 {% endif -%}
-  --name=ceph-rgw-{{ ansible_facts['hostname'] }}-${INST_NAME} \
+  --name=ceph-rgw-{{ rgw_zone }}-{{ ansible_facts['hostname'] }}-${INST_NAME} \
   --entrypoint=/usr/bin/radosgw \
   {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
   {{ (ceph_common_container_params['args'] + ceph_rgw_container_params['args'] | default([])) | join(' ') }}
 {% if container_binary == 'podman' %}
 ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
 {% else %}
-ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-rgw-{{ ansible_facts['hostname'] }}-${INST_NAME}
+ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-rgw-{{ rgw_zone }}-{{ ansible_facts['hostname'] }}-${INST_NAME}
 {% endif %}
 KillMode=none
 Restart=always
index e17a1716df5be19ae6b0907f538696e06e2529d3..362ce7be8aef87fc0b1682589235a77aec0f5c5b 100644 (file)
@@ -58,7 +58,7 @@
           (groups.get(mgr_group_name, []) | length == 0 and inventory_hostname in groups.get(mon_group_name, []))
 
     - name: Get rgw log
-      ansible.builtin.shell: journalctl -l -u ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }} > /var/log/ceph/ceph-radosgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}.log
+      ansible.builtin.shell: journalctl -l -u ceph-radosgw@rgw.{{ rgw_zone }}.{{ ansible_facts['hostname'] }}.{{ item.instance_name }} > /var/log/ceph/ceph-radosgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}.log
       changed_when: false
       with_items: "{{ rgw_instances | default([]) }}"
       when: inventory_hostname in groups.get(rgw_group_name, [])
index 8a45be0c78cb4893555082b4665e70044ecdebae..6d3d15988238bf503e3664451d7a182329954153 100644 (file)
@@ -13,9 +13,10 @@ class TestRGWs(object):
 
     def test_rgw_service_enabled_and_running(self, node, host):
         for i in range(int(node["radosgw_num_instances"])):
-            service_name = "ceph-radosgw@rgw.{hostname}.rgw{seq}".format(
+            service_name = "ceph-radosgw@rgw.{rgw_zone}.{hostname}.rgw{seq}".format(
                 hostname=node["vars"]["inventory_hostname"],
-                seq=i
+                seq=i,
+                rgw_zone=node["vars"].get("rgw_zone", "default"),
             )
             s = host.service(service_name)
             assert s.is_enabled
diff --git a/tox.ini b/tox.ini
index ee50d47fec3bd670c613afbbbaa80ac32a256d79..1a1b7f26db1fe625f404544ef96ef97f2d214b12 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -62,6 +62,7 @@ commands=
 
   # set up the cluster again
   ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars @ceph-override.json --extra-vars "\
+      no_log_on_ceph_key_tasks=false \
       yes_i_know=true \
       ceph_docker_registry_auth=True \
       ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
@@ -81,6 +82,7 @@ commands=
 
   # set up the cluster again
   ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars @ceph-override.json --extra-vars "\
+      no_log_on_ceph_key_tasks=false \
       yes_i_know=true \
       ceph_docker_registry_auth=True \
       ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
@@ -179,6 +181,7 @@ commands=
 commands=
   ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit mgrs {toxinidir}/tests/functional/setup.yml
   ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit mgrs {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
+      no_log_on_ceph_key_tasks=false \
       yes_i_know=true \
       ireallymeanit=yes \
       ceph_docker_registry_auth=True \
@@ -191,6 +194,7 @@ commands=
 commands=
   ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit mdss {toxinidir}/tests/functional/setup.yml
   ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit mdss {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
+      no_log_on_ceph_key_tasks=false \
       yes_i_know=true \
       ireallymeanit=yes \
       ceph_docker_registry_auth=True \
@@ -203,6 +207,7 @@ commands=
 commands=
   ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit rbdmirrors {toxinidir}/tests/functional/setup.yml
   ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit rbdmirrors {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
+      no_log_on_ceph_key_tasks=false \
       yes_i_know=true \
       ireallymeanit=yes \
       ceph_docker_registry_auth=True \
@@ -215,6 +220,7 @@ commands=
 commands=
   ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit rgws {toxinidir}/tests/functional/setup.yml
   ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit rgws {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
+      no_log_on_ceph_key_tasks=false \
       yes_i_know=true \
       ireallymeanit=yes \
       ceph_docker_registry_auth=True \