unset ansible fact

169 views
Skip to first unread message

Vincent Illiano

unread,
Aug 19, 2020, 1:50:35 PM8/19/20
to Ansible Project
Hi all,  I understand that once an ansible variable is set, it cannot be unset.  I did find the medium.com article below that explains a work around.  Unfortunately, I do not understand some of the syntax.  Specifically:
"-bock: &debug"
"-bock: *debug"  
foo: !!null

Thanks for any help.  Article I'm referring to is below.
######################################################

 
---
- hosts: localhost
gather_facts: no
connection: local
tasks:
- block: &debug
- debug: var=foo
when: foo|default(None) != None
- block: *debug
vars:
foo: 2
- block: *debug
vars:
foo: !!null  
Reply all
Reply to author
Forward
0 new messages