Ansible - 隐藏Warning

2019-10-29

when条件Warning

 [WARNING]: conditional statements should not include jinja2 templating

delimiters such as {{ }} or {% %}. Found: PIONEER is defined and PIONEER == '{{

pioneer }}' and REGION == '{{ region }}'

vim /usr/lib/python2.7/site-packages/ansible/playbook/conditional.py + 118  
注释以下内容  
#        if templar.is_template(conditional):  
#            display.warning('conditional statements should not include jinja2 '  
#                            'templating delimiters such as {{ }} or {%% %%}. '  
#                            'Found: %s' % conditional)