I need a help about a problem about creation groups. I created a playbook AWS in which I create the instances and I have a file called host. My objective is when AWS creates the instances I want, separate the IPs for groups example below. I don’t know how I will to do in this subject.
I’m not sure about separating into groups by IP, but would you be able to use the amazon.aws.aws_ec2 inventory plugin to make keyed_groups by some value? There are several examples of keyed_groups in the documentation that may help you.
Hello Dedeboy,
what you can do is to add a tag to each machine with the ip of the machine, and then in the aws dynamic inventory that you use in kayed_groups, take the tag value and it will form groups by ip.
In the dynamic inventory you could put something like this:
kayes_groups:
key: ip_
tag
and this will take the tag from each machine’s own variable, creating groups by its IP.