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
Fix ec2_group for numbered protocols (GRE) #42765
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
71c41e3
Fix spurious `changed=True` when int is passed as tag
ryansb 4920e0d
Fix for all AWS module using compare_aws_tags
ryansb eb6477a
Handle improperly stringified protocols and allow inconsistency betwe…
ryansb 8ddb1eb
pep8
ryansb f069aed
Add integration test that reproduces the same bug
ryansb bab7f3f
Return false if the comparsison is not equal
s-hertel File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
test/integration/targets/ec2_group/tasks/numeric_protos.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
- block: | ||
- name: set up aws connection info | ||
set_fact: | ||
group_tmp_name: '{{ec2_group_name}}-numbered-protos' | ||
aws_connection_info: &aws_connection_info | ||
aws_access_key: "{{ aws_access_key }}" | ||
aws_secret_key: "{{ aws_secret_key }}" | ||
security_token: "{{ security_token }}" | ||
region: "{{ aws_region }}" | ||
no_log: yes | ||
|
||
- name: Create a group with numbered protocol (GRE) | ||
ec2_group: | ||
name: '{{ group_tmp_name }}' | ||
vpc_id: '{{ vpc_result.vpc.id }}' | ||
description: '{{ ec2_group_description }}' | ||
rules: | ||
- proto: 47 | ||
to_port: -1 | ||
from_port: -1 | ||
cidr_ip: 0.0.0.0/0 | ||
<<: *aws_connection_info | ||
state: present | ||
register: result | ||
|
||
- name: Create a group with a quoted proto | ||
ec2_group: | ||
name: '{{ group_tmp_name }}' | ||
vpc_id: '{{ vpc_result.vpc.id }}' | ||
description: '{{ ec2_group_description }}' | ||
rules: | ||
- proto: '47' | ||
to_port: -1 | ||
from_port: -1 | ||
cidr_ip: 0.0.0.0/0 | ||
<<: *aws_connection_info | ||
state: present | ||
register: result | ||
- assert: | ||
that: | ||
- result is not changed | ||
- name: Add a tag with a numeric value | ||
ec2_group: | ||
name: '{{ group_tmp_name }}' | ||
vpc_id: '{{ vpc_result.vpc.id }}' | ||
description: '{{ ec2_group_description }}' | ||
tags: | ||
foo: 1 | ||
<<: *aws_connection_info | ||
- name: Read a tag with a numeric value | ||
ec2_group: | ||
name: '{{ group_tmp_name }}' | ||
vpc_id: '{{ vpc_result.vpc.id }}' | ||
description: '{{ ec2_group_description }}' | ||
tags: | ||
foo: 1 | ||
<<: *aws_connection_info | ||
register: result | ||
- assert: | ||
that: | ||
- result is not changed | ||
|
||
always: | ||
- name: tidy up egress rule test security group | ||
ec2_group: | ||
name: '{{group_tmp_name}}' | ||
state: absent | ||
vpc_id: '{{ vpc_result.vpc.id }}' | ||
<<: *aws_connection_info | ||
ignore_errors: yes |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This task and the one below need credentials