ansible / ansible.builtin / v2.7.18 / module / gcp_forwarding_rule Create, Update or Destroy a Forwarding_Rule. | "added in version" 2.4 of ansible.builtin" Authors: Tom Melendez (@supertom) <tom@supertom.com> preview | supported by communityansible.builtin.gcp_forwarding_rule (v2.7.18) — module
pip
Install with pip install ansible==2.7.18
Create, Update or Destroy a Forwarding_Rule. See U(https://cloud.google.com/compute/docs/load-balancing/http/target-proxies) for an overview. More details on the Global Forwarding_Rule API can be found at U(https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules) More details on the Forwarding Rules API can be found at U(https://cloud.google.com/compute/docs/reference/latest/forwardingRules)
- name: Create Minimum GLOBAL Forwarding_Rule gcp_forwarding_rule: service_account_email: "{{ service_account_email }}" credentials_file: "{{ credentials_file }}" project_id: "{{ project_id }}" forwarding_rule_name: my-forwarding_rule protocol: TCP port_range: 80 region: global target: my-target-proxy state: present
- name: Create Forwarding_Rule w/reserved static address gcp_forwarding_rule: service_account_email: "{{ service_account_email }}" credentials_file: "{{ credentials_file }}" project_id: "{{ project_id }}" forwarding_rule_name: my-forwarding_rule protocol: TCP port_range: 80 address: my-reserved-static-address-name region: global target: my-target-proxy state: present
state: choices: - present - absent description: - The state of the Forwarding Rule. 'present' or 'absent' required: true region: description: - The region for this forwarding rule. Currently, only 'global' is supported. required: false target: description: - Target resource for forwarding rule. For global proxy, this is a Global TargetProxy resource. Required for external load balancing (including Global load balancing) required: false address: description: - IPv4 or named IP address. Must be of the same scope (regional, global). Reserved addresses can (and probably should) be used for global forwarding rules. You may reserve IPs from the console or via the gce_eip module. required: false protocol: description: - For global forwarding rules, TCP, UDP, ESP, AH, SCTP or ICMP. Default is TCP. required: false port_range: description: - For global forwarding rules, must be set to 80 or 8080 for TargetHttpProxy, and 443 for TargetHttpsProxy or TargetSslProxy. required: false forwarding_rule_name: description: - Name of the Forwarding_Rule. required: true
forwarding_rule: description: GCP Forwarding_Rule dictionary returned: Always. Refer to GCP documentation for detailed field descriptions. sample: name: my-forwarding_rule target: '...' type: dict forwarding_rule_name: description: Name of the Forwarding_Rule returned: Always sample: my-target-proxy type: str region: description: Region for Forwarding Rule. returned: Always sample: true type: bool state: description: state of the Forwarding_Rule returned: Always. sample: present type: str