-
Notifications
You must be signed in to change notification settings - Fork 342
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
aws_ec2 fix hostnames #862
aws_ec2 fix hostnames #862
Conversation
Signed-off-by: Alina Buzachis <[email protected]>
ac153ec
to
0ba6958
Compare
5ba0047
to
90fc36c
Compare
90fc36c
to
49bba77
Compare
Signed-off-by: Alina Buzachis <[email protected]>
49bba77
to
0ff5348
Compare
Signed-off-by: Alina Buzachis <[email protected]>
recheck |
# can also be specified using | ||
# - tag:Tag1,Tag2 | ||
# or | ||
# - tag:Tag1=Test1,Tag2=Test2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible I'd like to see an integration test of at least one of these.
"tag:Tag1,Tag2" wouldn't be the 'usual' way to write tags in a filter (see #582), so if that leaked into a filter it's more likely to break things than "tag:Tag1,tag:Tag2" appearing in a filter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the integration tests for - tag:Tag1=Test1,Tag2=Test2
.
af9d0fe
to
0e40a4a
Compare
85fcd49
to
b696b03
Compare
Signed-off-by: Alina Buzachis <[email protected]>
b696b03
to
0891fba
Compare
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
Backport to stable-4: 💚 backport PR created✅ Backport PR branch: Backported as #899 🤖 @patchback |
aws_ec2 fix hostnames SUMMARY aws_ec2- fix hostnames bugs Should fix #582 and #583 Fix returned hosts when hostnames: - tag:Tag1,Tag2 Fix returned hosts when hostnames: - tag:Tag1 - tag:Tag2 Fix returned hosts when hostnames: - tag:Tag1=Test1,Tag2=Test2 Given and EC2 instance with the following tags tags: Tag1: Test1 Tag2: Test2 Instead of only returning "aws_ec2": { "hosts": [ "Test1" ] }, "tag_Name_instance_02": { "hosts": [ "Test1" ] }, "tag_Tag1_Test1": { "hosts": [ "Test1" ] }, "tag_Tag2_Test2": { "hosts": [ "Test1" ] } It returns now { "_meta": { "hostvars": { "Test1": { "ami_launch_index": 0, "ansible_host": "10.210.0.101", ...}, "Test2": { "ami_launch_index": 0, "ansible_host": "10.210.0.101", ...}, }, "all": { "children": [ "aws_ec2", "tag_Name_instance_02", "tag_Tag1_Test1", "tag_Tag2_Test2", "ungrouped" ] }, "aws_ec2": { "hosts": [ "Test1", "Test2" ] }, "tag_Name_instance_02": { "hosts": [ "Test1", "Test2" ] }, "tag_Tag1_Test1": { "hosts": [ "Test1", "Test2" ] }, "tag_Tag2_Test2": { "hosts": [ "Test1", "Test2" ] } } ISSUE TYPE Bugfix Pull Request COMPONENT NAME aws_ec2 ADDITIONAL INFORMATION Reviewed-by: Mark Chappell <None> Reviewed-by: Alina Buzachis <None> Reviewed-by: Markus Bergholz <[email protected]> (cherry picked from commit ca33389)
[PR #862/ca333890 backport][stable-4] aws_ec2 fix hostnames This is a backport of PR #862 as merged into main (ca33389). SUMMARY aws_ec2- fix hostnames bugs Should fix #582 and #583 Fix returned hosts when hostnames: - tag:Tag1,Tag2 Fix returned hosts when hostnames: - tag:Tag1 - tag:Tag2 Fix returned hosts when hostnames: - tag:Tag1=Test1,Tag2=Test2 Given and EC2 instance with the following tags tags: Tag1: Test1 Tag2: Test2 Instead of only returning "aws_ec2": { "hosts": [ "Test1" ] }, "tag_Name_instance_02": { "hosts": [ "Test1" ] }, "tag_Tag1_Test1": { "hosts": [ "Test1" ] }, "tag_Tag2_Test2": { "hosts": [ "Test1" ] } It returns now { "_meta": { "hostvars": { "Test1": { "ami_launch_index": 0, "ansible_host": "10.210.0.101", ...}, "Test2": { "ami_launch_index": 0, "ansible_host": "10.210.0.101", ...}, }, "all": { "children": [ "aws_ec2", "tag_Name_instance_02", "tag_Tag1_Test1", "tag_Tag2_Test2", "ungrouped" ] }, "aws_ec2": { "hosts": [ "Test1", "Test2" ] }, "tag_Name_instance_02": { "hosts": [ "Test1", "Test2" ] }, "tag_Tag1_Test1": { "hosts": [ "Test1", "Test2" ] }, "tag_Tag2_Test2": { "hosts": [ "Test1", "Test2" ] } } ISSUE TYPE Bugfix Pull Request COMPONENT NAME aws_ec2 ADDITIONAL INFORMATION Reviewed-by: Mark Chappell <None>
aws_ec2 fix hostnames SUMMARY aws_ec2- fix hostnames bugs Should fix ansible-collections#582 and ansible-collections#583 Fix returned hosts when hostnames: - tag:Tag1,Tag2 Fix returned hosts when hostnames: - tag:Tag1 - tag:Tag2 Fix returned hosts when hostnames: - tag:Tag1=Test1,Tag2=Test2 Given and EC2 instance with the following tags tags: Tag1: Test1 Tag2: Test2 Instead of only returning "aws_ec2": { "hosts": [ "Test1" ] }, "tag_Name_instance_02": { "hosts": [ "Test1" ] }, "tag_Tag1_Test1": { "hosts": [ "Test1" ] }, "tag_Tag2_Test2": { "hosts": [ "Test1" ] } It returns now { "_meta": { "hostvars": { "Test1": { "ami_launch_index": 0, "ansible_host": "10.210.0.101", ...}, "Test2": { "ami_launch_index": 0, "ansible_host": "10.210.0.101", ...}, }, "all": { "children": [ "aws_ec2", "tag_Name_instance_02", "tag_Tag1_Test1", "tag_Tag2_Test2", "ungrouped" ] }, "aws_ec2": { "hosts": [ "Test1", "Test2" ] }, "tag_Name_instance_02": { "hosts": [ "Test1", "Test2" ] }, "tag_Tag1_Test1": { "hosts": [ "Test1", "Test2" ] }, "tag_Tag2_Test2": { "hosts": [ "Test1", "Test2" ] } } ISSUE TYPE Bugfix Pull Request COMPONENT NAME aws_ec2 ADDITIONAL INFORMATION Reviewed-by: Mark Chappell <None> Reviewed-by: Alina Buzachis <None> Reviewed-by: Markus Bergholz <[email protected]>
This is a massively breaking change, not a bugfix. I can see why someone might want the new behaviour, but it should default to off. With this change:
After reverting to the previous working version:
|
We had a number of systems break due to this change. We rely on host_vars being a static value. This introduced literal chaos and caused a number of hosts to fallback to role defaults. |
Maybe a new parameter |
Yes, we can also do that. @tremble what do you think instead? |
I'd head in that direction Might it also be worth exposing "hostname_" groups so that all of the hostnames can be accessed? |
SUMMARY
aws_ec2- fix hostnames bugs
Should fix #582 and #583
Given and EC2 instance with the following tags
Instead of only returning
It returns now
ISSUE TYPE
COMPONENT NAME
aws_ec2
ADDITIONAL INFORMATION