From 9c6b557f1d4e990ddace3710fb2791d7fcd331c5 Mon Sep 17 00:00:00 2001 From: Juan Badia Payno Date: Mon, 15 Jun 2020 09:41:28 +0200 Subject: [PATCH] BaR Ceph authenticacion more ansible way Instead of execute a command and redirect the output to a file. This patch gets the output of the command line and writes it to a file. Also fixed the molecule-backup_and_restore test Change-Id: Ie38d8b9fce36ce2f73a2811072e53f405f1367f6 (cherry picked from commit ad2c7b5892695fd8bb99633724bdb31f36d04c70) --- .../backup_and_restore/molecule/default/prepare.yml | 1 - .../backup_and_restore/tasks/ceph_authentication.yml | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tripleo_ansible/roles/backup_and_restore/molecule/default/prepare.yml b/tripleo_ansible/roles/backup_and_restore/molecule/default/prepare.yml index 229821973..af50ba650 100644 --- a/tripleo_ansible/roles/backup_and_restore/molecule/default/prepare.yml +++ b/tripleo_ansible/roles/backup_and_restore/molecule/default/prepare.yml @@ -46,7 +46,6 @@ - syslinux - genisoimage - kbd - - hiera post_tasks: - name: Create hiera config file diff --git a/tripleo_ansible/roles/backup_and_restore/tasks/ceph_authentication.yml b/tripleo_ansible/roles/backup_and_restore/tasks/ceph_authentication.yml index e27540505..4e8fec03b 100644 --- a/tripleo_ansible/roles/backup_and_restore/tasks/ceph_authentication.yml +++ b/tripleo_ansible/roles/backup_and_restore/tasks/ceph_authentication.yml @@ -35,7 +35,16 @@ - name: Export ceph authentication shell: | set -o pipefail - {{ tripleo_container_cli }} exec ceph-mon-{{ ansible_hostname }} bash -c "ceph auth export" > {{ tripleo_backup_and_restore_ceph_auth_file }} + {{ tripleo_container_cli }} exec ceph-mon-{{ ansible_hostname }} bash -c "ceph auth export" become: true + register: bar_ceph_authentication_content + tags: + - bar_create_recover_image + +- name: Save ceph authentication at {{ tripleo_backup_and_restore_ceph_auth_file }} + copy: + dest: "{{ tripleo_backup_and_restore_ceph_auth_file }}" + content: | + {{ bar_ceph_authentication_content.stdout }} tags: - bar_create_recover_image