From c1e5052722a3b53344e01d39f25a2967dd07219c Mon Sep 17 00:00:00 2001 From: root Date: Thu, 19 Aug 2021 00:33:08 -0400 Subject: [PATCH] openvpn/templates/iiab-support: Recap Ansible-vs-sed var mechanics --- roles/openvpn/templates/iiab-support | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/openvpn/templates/iiab-support b/roles/openvpn/templates/iiab-support index 333ba76dc..7fbffb111 100755 --- a/roles/openvpn/templates/iiab-support +++ b/roles/openvpn/templates/iiab-support @@ -33,9 +33,9 @@ read ans < /dev/tty # (1) sed: Remove outer spacing IF NEC, then... # (2) sed: Remove 1 pair of matching outer quotes (IF NEC) # (3) Ansible vars can have non-string value null. SEE /opt/iiab/iiab/test.yml -# Here in bash, we focus only on string values, e.g. "" empty string if nec. +# Here in bash, we focus only on string values e.g. "" empty string if nec. # (4) When writing to disk, we aggressively overwrite such null var lines, e.g. -# including sloppy unassigned var lines like "^var:$" that lacks whitespace. +# including sloppy unassigned var lines like "^var:$" that lack whitespace. ans=$(echo $ans | sed "s/^\s*//; s/\s*$//; s/^\(['\"]\)\(.*\)\1$/\2/")