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

Add rewrite rule capability to appgateway module #747

Merged
merged 14 commits into from
Apr 18, 2022

Conversation

l3ender
Copy link
Contributor

@l3ender l3ender commented Jan 31, 2022

SUMMARY

This PR adds the ability to configure rewrite rules on a v2 application gateway.

The PR also clarifies other parameter usage for the module.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

azure_rm_appgateway

ADDITIONAL INFORMATION

Rewrite rules are only allowed on v2 application gateways.

Example snippet of usage:

- name: Try to create v2 instance of Application Gateway with rewrite rules - update rewrite rule
  azure_rm_appgateway:
    resource_group: my-rg
    name: my-v2-appgateway
    rewrite_rule_sets:
      - name: "configure-headers"
        rewrite_rules:
          - name: "add-security-response-header"
            rule_sequence: 1
            action_set:
              response_header_configurations:
                - header_name: "Strict-Transport-Security"
                  header_value: "max-age=31536000"
          - name: "remove-backend-response-headers"
            rule_sequence: 2
            action_set:
              response_header_configurations:
                - header_name: "Server"
                - header_name: "X-Powered-By"
          - name: "set-custom-header-condition"
            rule_sequence: 3
            conditions:
              - variable: "var_client_ip"
                pattern: "1.1.1.1"
              - variable: "http_req_Authorization"
                pattern: "12345"
                ignore_case: false
            action_set:
              request_header_configurations:
                - header_name: "Foo"
                  header_value: "BarUpdated"
              response_header_configurations:
                - header_name: "FooResponse"
                  header_value: "BarResponse"

@l3ender
Copy link
Contributor Author

l3ender commented Jan 31, 2022

Hello @Fred-sun, please take a look at this PR. Thank you!

@Fred-sun Fred-sun added enhancement New feature or request medium_priority Medium priority new_feature New feature requirments work in In trying to solve, or in working with contributors labels Feb 12, 2022
@Fred-sun
Copy link
Collaborator

@l3ender Please! similar chage for 2.10.txt, 2.12.txt, 2.13.txt and 2.9.txt

ERROR: plugins/modules/azure_rm_appgateway.py:0:0: import-error: Exception attempting to import module for argument_spec introspection, 'cannot import name 'is_valid_resource_id' from 'ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common' (/home/vsts/.ansible/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py)'
ERROR: tests/sanity/ignore-2.12.txt:11:1: A100: Ignoring 'doc-choices-do-not-match-spec' on 'plugins/modules/azure_rm_appgateway.py' is unnecessary
ERROR: tests/sanity/ignore-2.12.txt:12:1: A100: Ignoring 'parameter-type-not-in-doc' on 'plugins/modules/azure_rm_appgateway.py' is unnecessary
ERROR: tests/sanity/ignore-2.12.txt:13:1: A100: Ignoring 'parameter-list-no-elements' on 'plugins/modules/azure_rm_appgateway.py' is unnecessary
ERROR: tests/sanity/ignore-2.12.txt:14:1: A100: Ignoring 'doc-elements-mismatch' on 'plugins/modules/azure_rm_appgateway.py' is unnecessary

@l3ender
Copy link
Contributor Author

l3ender commented Feb 13, 2022

@Fred-sun It is updated, thank you! My apologies for missing the sanity errors.

@l3ender
Copy link
Contributor Author

l3ender commented Mar 23, 2022

Hi @Fred-sun, any update on this PR?

@Fred-sun Fred-sun added the ready_for_review The PR has been modified and can be reviewed and merged label Apr 8, 2022
@Fred-sun Fred-sun removed the work in In trying to solve, or in working with contributors label Apr 8, 2022
@xuzhang3
Copy link
Collaborator

@l3ender Can you help resolve the conflict?

@l3ender
Copy link
Contributor Author

l3ender commented Apr 12, 2022

@xuzhang3 Conflict is resolved, thank you!

@xuzhang3
Copy link
Collaborator

@l3ender Another conflict after other PR merged, please help resolve this conflict thanks.

@l3ender
Copy link
Contributor Author

l3ender commented Apr 15, 2022

@xuzhang3 It's resolved--thank you!

@xuzhang3
Copy link
Collaborator

LGTM, shipping it

@xuzhang3 xuzhang3 merged commit 2795514 into ansible-collections:dev Apr 18, 2022
@xuzhang3 xuzhang3 deleted the appgw-rewrite branch April 18, 2022 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium_priority Medium priority new_feature New feature requirments ready_for_review The PR has been modified and can be reviewed and merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants