Filter in source inventory

Hi guys,

I have source inventory by Azure and need to create the filter with this informations:

  • The VMs is running
  • The OS is Linux
  • The name contains lnx

I create this filter nut not working
host_filters: “{{ powerstate == ‘running’ }} and {{ ‘lnx’ in computer_name }} and {{ os_profile.system == ‘linux’ }}”

How can create the filter in source inventory?

shouldn’t that be host_filter NOT host_filters?

Hi,

The documentation is ‘filters’
https://docs.ansible.com/ansible/latest/plugins/inventory/azure_rm.html

default_host_filters

exclude_host_filters

Ok, I was looking at smart inventory where it’s host_filter → https://docs.ansible.com/ansible-tower/latest/html/userguide/inventories.html#smart-host-filter