From 0036d8c17b3407693d0818c20cee6e86018fec03 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 20 Jun 2022 20:13:41 -0400 Subject: [PATCH] test.yml: float (drops outer zeros) vs AnsibleUnicode (String) --- test.yml | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/test.yml b/test.yml index 5364223a5..f346fb757 100644 --- a/test.yml +++ b/test.yml @@ -35,25 +35,42 @@ - name: a shows "VARIABLE IS NOT DEFINED!" -- whereas b (w/o whitespace) AND c (with space) AND d (with tab, STRICTLY DISALLOWED IN YAML BY ansible-core 2.11.6) showed null (without quotes!) -- whereas e (singlequotes) and f (doublequotes) show "" empty string set_fact: - #a: + #a: # Tabs NO LONGER ALLOWED, in strict YAML: https://stackoverflow.com/a/19976827 b: c: # Space - #d: # Tabs NO LONGER ALLOWED, in strict YAML: https://stackoverflow.com/a/19976827 - e: '' - f: "" + d: '' + e: "" + f: "3.10" # zero preserved b/c AnsibleUnicode (i.e. string) + g: +03.10 # plus sign & zeros dropped b/c float - debug: - var: a + var: a # "VARIABLE IS NOT DEFINED!" - debug: - var: b + var: a | type_debug # AnsibleUndefined - debug: - var: c + var: b # null - debug: - var: d + var: b | type_debug # NoneType - debug: - var: e + var: c # null - debug: - var: f + var: c | type_debug # NoneType + - debug: + var: d # "" + - debug: + var: d | type_debug # AnsibleUnicode + - debug: + var: e # "" + - debug: + var: e | type_debug # AnsibleUnicode + - debug: + var: f # "3.10" + - debug: + var: f | type_debug # AnsibleUnicode + - debug: + var: g # 3.1 + - debug: + var: g | type_debug # float - debug: var: ansible_local.local_facts # SEE: /opt/iiab/iiab/scripts/local_facts.fact @@ -75,3 +92,4 @@ var: ansible_machine # TEST ANSIBLE COMMANDS/MODULES HERE! +