Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ec2 inventory script: Add a global group for both EC2 and RDS instances when listing inventory using the EC2 plugin #4005

Closed
wants to merge 1 commit into from

Conversation

herbyg-axial
Copy link
Contributor

When using the EC2 inventory plugin in an inventory that is fed by multiple sources (plugins, host file, etc.), it's hard to identify which hosts come from the EC2 inventory because there is no unified grouping that identifies EC2 or RDS instances; they are only tagged based off the attributes that each instance possesses (ie., security group, instance tags, region, etc.)

This change adds 2 global groups:

  • all EC2 instances will appear in an 'ec2' group
  • all RDS instances in an 'rds' group.

In this way, it's much easier to identify and perform actions to only EC2 or RDS instances because there is now a consistent tag for all hosts of that type.

@mpdehaan
Copy link
Contributor

mpdehaan commented Sep 3, 2013

This looks good to me. In queue for testing.

@pas256
Copy link
Contributor

pas256 commented Sep 4, 2013

I am curious how many people are using Ansible to manage RDS instances. Perhaps there is a filter that can be added to exclude them.

This is great enhancement though, thanks!

@herbyg-axial
Copy link
Contributor Author

@pas256 Thanks. I think it's fine to leave the RDS listing in there. It would have been awesome if Ansible allowed you to compose groups in hosts using host patterns, so you could say in your hosts file "[aws:children] all:!rds ", instead of having to filter it out at the plugin level. (Apologies in advance if that's already possible.)

@bcoca
Copy link
Member

bcoca commented Sep 5, 2013

group_by lets you do this to a certain level, i used to include a
dynamic_groups.yml play at the start of all my plays.

@herbyg-axial
Copy link
Contributor Author

(Global groups for each type of instance listed by this inventory plugin is useful - can we still get this in?)

@jctanner jctanner closed this Nov 11, 2013
jctanner added a commit that referenced this pull request Nov 11, 2013
ec2 inventory script: Add a global group for EC2 and RDS instances when listing EC2 inventory
@jctanner
Copy link
Contributor

@herbyg-axial thank you! This should be really helpful for those managing heterogeneous environments.

@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_pull_request labels Mar 4, 2018
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cloud feature This issue/PR relates to a feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants