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
|
||||
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!
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue