Skip to content

Commit 203a658

Browse files
author
Manoj Katari
committed
Fix shell quoting and unbound variable in Manila ceph-nfs IP task
- Add missing CONTROLLER1_SSH variable definition to prevent unbound variable errors - Fix awk command quoting for proper SSH execution - Escape inner quotes and dollar signs in the awk command This resolves the syntax error when executing the awk command over SSH to extract the Ganesha Bind_Addr from the configuration file.
1 parent 673bf72 commit 203a658

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/roles/manila_adoption/tasks/ceph.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
become: true
66
ansible.builtin.shell: |
77
{{ shell_header }}
8-
${CONTROLLER1_SSH} awk -F '[=;]' '/Bind_Addr/ {gsub(/ /, "", $2); print $2}' {{ ganesha_default_path }}
8+
CONTROLLER1_SSH="{{ controller1_ssh }}"
9+
${CONTROLLER1_SSH} "awk -F '[=;]' '/Bind_Addr/ {gsub(/ /, \"\", \$2); print \$2}' {{ ganesha_default_path }}"
910
register: cephnfs_vip
1011

1112
- name: Fail if the OLD Ganesha VIP is not a good input value

0 commit comments

Comments
 (0)