ansible/test/integration/targets/set_fact/set_fact_bool_conv.yml
Felix Fontein da60525610
Fix missing ansible.builtin FQCNs in hardcoded action names (#71824)
* Make sure hard-coded action names also check for FQCN.
* Use _add_internal_fqcn() to avoid hardcoded lists and typoes.
2020-11-03 08:51:31 -05:00

35 lines
1.1 KiB
YAML

- hosts: localhost
gather_facts: false
vars:
string_var: "no"
tasks:
- set_fact:
this_is_string: "yes"
this_is_not_string: yes
this_is_also_string: "{{ string_var }}"
this_is_another_string: !!str "{% set thing = '' + string_var + '' %}{{ thing }}"
this_is_more_strings: '{{ string_var + "" }}'
- assert:
that:
- string_var == 'no'
- this_is_string == True
- this_is_not_string == True
- this_is_also_string == False
- this_is_another_string == False
- this_is_more_strings == False
- ansible.builtin.set_fact:
this_is_string_fqcn: "yes"
this_is_not_string_fqcn: yes
this_is_also_string_fqcn: "{{ string_var }}"
this_is_another_string_fqcn: !!str "{% set thing = '' + string_var + '' %}{{ thing }}"
this_is_more_strings_fqcn: '{{ string_var + "" }}'
- assert:
that:
- this_is_string_fqcn == True
- this_is_not_string_fqcn == True
- this_is_also_string_fqcn == False
- this_is_another_string_fqcn == False
- this_is_more_strings_fqcn == False