Documentation

gcp_forwarding_rule - Create, Update or Destroy a Forwarding_Rule.

New in version 2.4.

Synopsis

Requirements (on host that executes module)

  • python >= 2.6
  • google-api-python-client >= 1.6.2
  • google-auth >= 0.9.0
  • google-auth-httplib2 >= 0.0.2

Options

parameter required default choices comments
address
no
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.
forwarding_rule_name
yes
Name of the Forwarding_Rule.
port_range
no
For global forwarding rules, must be set to 80 or 8080 for TargetHttpProxy, and 443 for TargetHttpsProxy or TargetSslProxy.
protocol
no
For global forwarding rules, TCP, UDP, ESP, AH, SCTP or ICMP. Default is TCP.
region
no
The region for this forwarding rule. Currently, only 'global' is supported.
state
yes
  • present
  • absent
The state of the Forwarding Rule. 'present' or 'absent'
target
no
Target resource for forwarding rule. For global proxy, this is a Global TargetProxy resource. Required for external load balancing (including Global load balancing)

Examples

- 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

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
forwarding_rule_name Name of the Forwarding_Rule Always str my-target-proxy
forwarding_rule GCP Forwarding_Rule dictionary Always. Refer to GCP documentation for detailed field descriptions. dict {'name': 'my-forwarding_rule', 'target': '...'}
region Region for Forwarding Rule. Always bool True
state state of the Forwarding_Rule Always. str present


Notes

Note

  • Currently only supports global forwarding rules. As such, Load Balancing Scheme is always EXTERNAL.

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Support

This module is community maintained without core committer oversight.

For more information on what this means please read Module Support

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.