Deprecated

Removed in 2.12

i

Reason:Updated modules released with increased functionality | Alternative:Use M(gcp_compute_forwarding_rule) or M(gcp_compute_global_forwarding_rule) instead.

ansible.builtin._gcp_forwarding_rule (v2.9.27) — module

Create, Update or Destroy a Forwarding_Rule.

| "added in version" 2.4 of ansible.builtin"

Authors: Tom Melendez (@supertom) <tom@supertom.com>

deprecated | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

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)


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
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

Outputs

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