Add ceph_cluster option during auth export

When auth export is executed, the command can fail
if the ceph cluster name is not Ceph. This patch
just adds this variable to the backup and restore
role task.

Closes-Bug: #1961031
Change-Id: Idd79cae49c7c4aa8346cc638e43696875a9c6514
(cherry picked from commit 5315ff796f)
This commit is contained in:
Francesco Pantano 2022-02-16 10:06:35 +01:00
parent 30352d0c32
commit 9f1d806fe3
No known key found for this signature in database
GPG Key ID: 0458D4D1F41BD75C
2 changed files with 8 additions and 2 deletions

View File

@ -112,3 +112,7 @@ tripleo_backup_and_restore_cephadm_path: "/usr/sbin/cephadm"
# of the partition (the whatever), i.e: sda2, sda1, vda2, sdb3, sdc1...
tripleo_backup_and_restore_boot_mount: replaceme
tripleo_backup_and_restore_boot_efi_mount: replaceme
# Ceph cluster name
tripleo_backup_and_restore_ceph_cluster: "ceph"
tripleo_backup_and_restore_ceph_admin_keyring: "/etc/ceph/{{ tripleo_backup_and_restore_ceph_cluster }}.client.admin.keyring"

View File

@ -61,7 +61,8 @@
- name: Export ceph authentication
shell: |
set -o pipefail
{{ tripleo_container_cli }} exec ceph-mon-{{ inventory_hostname }} bash -c "ceph auth export"
{{ tripleo_container_cli }} exec ceph-mon-{{ inventory_hostname }} \
bash -c "ceph --cluster {{ tripleo_backup_and_restore_ceph_cluster | default('ceph') }} auth export"
register: bar_ceph_authentication_content
- name: Save ceph authentication at {{ tripleo_backup_and_restore_ceph_auth_file }}
@ -77,7 +78,8 @@
tags: bar_create_recover_image
block:
- name: Export ceph authentication
command: cephadm shell -- ceph auth export
command: |
cephadm shell -k {{ tripleo_backup_and_restore_ceph_admin_keyring }} -- ceph auth export
register: bar_ceph_authentication_content
- name: Save ceph authentication at {{ tripleo_backup_and_restore_ceph_auth_file }}