ServiceNowITOM / ansible-sn-inventory

Ansible Dynamic Inventory for ServiceNow
Apache License 2.0
79 stars 45 forks source link

Possibility to combine 2 fields to define a group #7

Closed metabsd closed 5 years ago

metabsd commented 7 years ago

As an example.

sn_sys_class_name + used_for

A group name linux_server_production or linux_server_development.

Thank you!

amittell commented 7 years ago

I think it would be best to do with with a list union on the Ansible side, you would set groups = used_for, then in Ansible do an intersect of the items in the linux_server and the "production" or "development" lists.

ansible linux_servers:&production -m -a

Ansible documentation for more detail: http://docs.ansible.com/ansible/latest/intro_patterns.html