# Azure\_rm plugin failure - templating issue in plugin?

**URL:** <https://forum.ansible.com/t/azure-rm-plugin-failure-templating-issue-in-plugin/44149>\
**Category:** Get Help\
**Tags:** azure\
**Created:** [July 28, 2025, 11:48am UTC](https://forum.ansible.com/t/azure-rm-plugin-failure-templating-issue-in-plugin/44149 "2025-07-28T11:48:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![simonjduff](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/simonjduff/32/9160_2.png) [@simonjduff](https://forum.ansible.com/u/simonjduff)\
**Post date:** [July 28, 2025, 11:48am UTC](https://forum.ansible.com/t/azure-rm-plugin-failure-templating-issue-in-plugin/44149/1 "2025-07-28T11:48:43Z")

</div>

We’re setting up a new project and have come across a surprising failure.

> Warning: : Failed to parse inventory with ‘auto’ plugin: Error evaluating filter condition ‘True’ for host [redacted]: The value ‘{% if True %} True {% else %} False {% endif %}’ is not a valid boolean. Valid booleans include: ‘n’, ‘on’, 1, ‘false’, 0, ‘no’, ‘true’, ‘0’, ‘off’, ‘t’, ‘yes’, ‘1’, ‘y’, ‘f’

This seems to indicate to me that the [expression in the plugin](https://github.com/ansible-collections/azure/blob/v3.6.0/plugins/inventory/azure_rm.py#L455) is being treated a string literal and not executed to return the True value expected.

I note that there’s some conditional logic which might play a part

```auto
    from ansible.template import trust_as_template
except ImportError:
    trust_as_template = None
...
conditional = "{{% if {0} %}}true{{% else %}}false{{% endif %}}".format(condition)
            if trust_as_template:
                conditional = trust_as_template(conditional)
            try:
                if boolean(self.templar.template(conditional)):
                    return True
            except Exception as e:
                if boolean(self.get_option('fail_on_template_errors')):
                    raise AnsibleParserError("Error evaluating filter condition '{0}' for host {1}: {2}".format(condition, inventory_hostname, to_native(e)))

```

So I’m wondering if `trust_as_template` is failing to import silently, resulting in this failure? I don’t know what `self.templar.template` is so lose the track here unfortunately.

Our inventory file is simple  
development\_azure\_rm.yml

```auto
plugin: azure.azcollection.azure_rm
include_vm_resource_groups:
  - [redacted]
auth_source: env
strict: yes
ansible_user: [redacted]

```

executed by `ansible-playbook -i deploy/inventory/development_azure_rm.yml deploy/deploy.yml --limit="all"`

I’d appreciate any insight.

#azure #Get Help
