Fix error with command ansible module and pipes

From the ansible command module[1]:
The command(s) will not be processed through the shell, so variables like $HOME and
operations like "<", ">", "|", ";" and "&" will not work.
Use the shell module if you need these features.

[1] https://docs.ansible.com/ansible/latest/modules/command_module.html

Change-Id: I87d1e9621a5eccf3c90ae9b8ac683bc83006b0b7
Closes-Bug: 1864855
This commit is contained in:
Juan Badia Payno 2020-02-26 15:21:43 +01:00
parent 89d744af21
commit 08ae844c5e
1 changed files with 2 additions and 1 deletions

View File

@ -48,7 +48,8 @@
- bar_create_recover_image
- name: Get the mysql container id when galera is enabled
command: |
shell: |
set -o pipefail
{{ tripleo_container_cli }} ps -a | grep galera | awk '{print $1}'
when: enabled_galera
register: galera_container_id