Skip to content

Commit ee72096

Browse files
committed
Enhance resource ID retrieval by adding pipefail option and specifying bash as the shell executable
1 parent 0189d43 commit ee72096

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/roles/ha_db_hana/tasks/resource-migration.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,26 @@
3535
block:
3636
- name: "Try master resource ID"
3737
ansible.builtin.shell: >-
38-
{{ commands
38+
set -o pipefail && {{ commands
3939
| selectattr('name','equalto','get_hana_resource_id')
4040
| map(attribute=(ansible_os_family|upper))
4141
| first
4242
}}
43+
args:
44+
executable: /bin/bash
4345
changed_when: false
4446
register: hana_resource_id
4547
failed_when: hana_resource_id.rc != 0
4648
rescue:
4749
- name: "Try clone resource ID"
4850
ansible.builtin.shell: >-
49-
{{ commands
51+
set -o pipefail && {{ commands
5052
| selectattr('name','equalto','get_hana_resource_id')
5153
| map(attribute='REDHAT')
5254
| first
5355
}}
56+
args:
57+
executable: /bin/bash
5458
changed_when: false
5559
register: hana_resource_id
5660
failed_when: hana_resource_id.rc != 0

0 commit comments

Comments
 (0)