mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
test.yml: float (drops outer zeros) vs AnsibleUnicode (String)
This commit is contained in:
parent
adeded594c
commit
0036d8c17b
1 changed files with 28 additions and 10 deletions
38
test.yml
38
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
|
- 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:
|
set_fact:
|
||||||
#a:
|
#a: # Tabs NO LONGER ALLOWED, in strict YAML: https://stackoverflow.com/a/19976827
|
||||||
b:
|
b:
|
||||||
c: # Space
|
c: # Space
|
||||||
#d: # Tabs NO LONGER ALLOWED, in strict YAML: https://stackoverflow.com/a/19976827
|
d: ''
|
||||||
e: ''
|
e: ""
|
||||||
f: ""
|
f: "3.10" # zero preserved b/c AnsibleUnicode (i.e. string)
|
||||||
|
g: +03.10 # plus sign & zeros dropped b/c float
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
var: a
|
var: a # "VARIABLE IS NOT DEFINED!"
|
||||||
- debug:
|
- debug:
|
||||||
var: b
|
var: a | type_debug # AnsibleUndefined
|
||||||
- debug:
|
- debug:
|
||||||
var: c
|
var: b # null
|
||||||
- debug:
|
- debug:
|
||||||
var: d
|
var: b | type_debug # NoneType
|
||||||
- debug:
|
- debug:
|
||||||
var: e
|
var: c # null
|
||||||
- debug:
|
- 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:
|
- debug:
|
||||||
var: ansible_local.local_facts # SEE: /opt/iiab/iiab/scripts/local_facts.fact
|
var: ansible_local.local_facts # SEE: /opt/iiab/iiab/scripts/local_facts.fact
|
||||||
|
@ -75,3 +92,4 @@
|
||||||
var: ansible_machine
|
var: ansible_machine
|
||||||
|
|
||||||
# TEST ANSIBLE COMMANDS/MODULES HERE!
|
# TEST ANSIBLE COMMANDS/MODULES HERE!
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue