Closed peshay closed 2 years ago
Describe the request Enable Constructed Features for the inventory plugin
Current behaviour There is no way to create additional groups from the inventory plugin.
Expected behaviour Add constructed functionality to the plugin, so it is possible to create additional vars and groups based on Jinja2.
For example
plugin: nutanix.ncp.ntnx_prism_vm_inventory groups: nutanix: true keyed_groups: # group for customer name - prefix: "" separator: '' key: "inventory_hostname | regex_replace('([a-zA-Z0-9]+)-([a-zA-Z0-9]+)-([a-zA-Z0-9]+)', '\\1')" # group for service name - prefix: "" separator: '' key: "inventory_hostname | regex_replace('([a-zA-Z0-9]+)-([a-zA-Z0-9]+)-([a-zA-Z]+)[0-9]*', '\\3')" # group for environemnt name - prefix: "" separator: '' key: "inventory_hostname | regex_replace('([a-zA-Z0-9]+)-([a-zA-Z0-9]+)-([a-zA-Z0-9]+)', '\\2')" # group for customer environemnt name - prefix: "" separator: '' key: "inventory_hostname | regex_replace('([a-zA-Z0-9]+)-([a-zA-Z0-9]+)-([a-zA-Z0-9]+)', '\\1_\\2')"
Here is a pull request to add the requested functionality: https://github.com/nutanix/nutanix.ansible/issues/232
@peshay I am looking into it. One use-case enhancement we need to add more here is the grouping using categories of vm.
Released in v1.7.0
Describe the request Enable Constructed Features for the inventory plugin
Current behaviour There is no way to create additional groups from the inventory plugin.
Expected behaviour Add constructed functionality to the plugin, so it is possible to create additional vars and groups based on Jinja2.
For example
Here is a pull request to add the requested functionality: https://github.com/nutanix/nutanix.ansible/issues/232