Hello community!

A have plenty of EC2 servers in AWS and want to categorize them based on 
gathered from ansible_facts (by module setup), for example have group 
"CentOS" where ansible_facts['distribution'] == 'CentOS' and so on. But 
having file "inventory/constructed.yml":

plugin: constructed
strict: False
keyed_groups:
  # this creates a group per distro (distro_CentOS, distro_Debian) and 
assigns the hosts that have matching values to it,
  # using the default separator "_"
  - prefix: distro
    key: ansible_distribution

I don't see this group "distro_CentOS" in output command "ansible-inventory 
--graph".

Also this plugin enabled in ansible.cfg:

[inventory]
# enable inventory plugins, default: 'host_list', 'script', 'auto', 'yaml', 
'ini', 'toml'
enable_plugins = host_list, ini, aws_ec2, *constructed*

How I can sort instances EC2 based on gathered ansible's facts, avoiding 
tag each instance?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5bb8ca47-0d6c-4657-993e-edfdc24592d6%40googlegroups.com.

Reply via email to