1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Polish OpenVPN /usr/bin/iiab-support explanation

This commit is contained in:
root 2021-08-20 10:05:41 -04:00
parent 9a47f50423
commit 176e4efc5a

View file

@ -6,9 +6,9 @@
# "AUGUST 2018 - AUGUST 2021" Technical Recap at the top of:
# https://github.com/iiab/iiab/blob/master/roles/openvpn/tasks/main.yml
DEBUG=false # Using /usr/bin/true or /usr/bin/false
PLAYBOOK="install-support.yml"
INVENTORY="ansible_hosts"
DEBUG=false # Using /usr/bin/true or /usr/bin/false
# 2021-08-18: bash scripts using default_vars.yml &/or local_vars.yml
# https://github.com/iiab/iiab-factory/blob/master/iiab#L79-L97
@ -24,20 +24,20 @@ DEBUG=false # Using /usr/bin/true or /usr/bin/false
# (4) sed: Strip any outer spacing.
# (5) sed: Strip up-to-1 pair of matching outer quotes.
# /etc/openvpn/scripts/announcer ALSO GOES ONE STEP FURTHER THAN ANSIBLE:
# 'announcer' (from openvpn/templates) ALSO GOES ONE STEP FURTHER THAN ANSIBLE:
# (6) Convert remaining spaces to underscores.
# Steps (1) and (2) are not applicable with live/keyboard input.
# Steps (3), (4) and (5) are optional with live/keyboard input (we do it!)
# Step (6) is always required for OpenVPN here (file or live/keyboard input!)
# Steps (1) and (2) are Not Applicable with live/keyboard input.
# Steps (3), (4) and (5) are Optional with live/keyboard input (here we do it!)
# Step (6) is always required for OpenVPN here (file input or live/keyboard!)
# NOTE Ansible vars can have non-string value null. This is different from
# undefined -- from Ansible's perspective -- SEE /opt/iiab/iiab/test.yml
# BUT HERE IN BASH, we focus only on string values e.g. "" empty string if nec:
# (a) WITH INPUT, we choose to ignore lines like "^var:$" that lack whitespace.
# Ansible would have assigned the null value. We do not.
# Ansible would have assigned the null value. We do not. We force ""
# (b) INPUT LINES "^var:\s\+$" (trailing whitespace) we force to empty string.
# Ansible would have assigned the null value. We do not.
# Ansible would have assigned the null value. We do not. We force ""
# (c) WITH *OUTPUT* we aggressively overwrite null var lines, including both
# "^var:$" (no trailing whitespace) and "^var:\s\+$" (trailing whitespace).