Debian Codegraph @

ansible_collections/google/cloud/roles/gcp_http_lb/tasks/main.yml

raw symbols SCIP
1 ---
2 - name: Create a global address for the load balancer.
3 google.cloud.gcp_compute_global_address:
4 name: "{{ gcp_http_lb_globaladdress }}"
5 project: "{{ gcp_http_lb_gcp_project }}"
6 auth_kind: "{{ gcp_http_lb_auth_kind }}"
7 service_account_file: "{{ gcp_http_lb_service_account_file }}"
8 state: "{{ gcp_http_lb_state }}"
9 register: globaladdress
10 - name: Create a http health check to verify lb working
11 google.cloud.gcp_compute_http_health_check:
12 name: "{{ gcp_http_lb_healthcheck }}"
13 healthy_threshold: 10
14 port: 80
15 timeout_sec: 2
16 unhealthy_threshold: 5
17 project: "{{ gcp_http_lb_gcp_project }}"
18 auth_kind: "{{ gcp_http_lb_auth_kind }}"
19 service_account_file: "{{ gcp_http_lb_service_account_file }}"
20 state: "{{ gcp_http_lb_state }}"
21 register: healthcheck
22 - name: Create a backend service
23 google.cloud.gcp_compute_backend_service:
24 name: "{{ gcp_http_lb_backendservice }}"
25 backends:
26 - group: "{{ gcp_http_lb_backend.selfLink }}"
27 health_checks:
28 - "{{ healthcheck.selfLink }}"
29 enable_cdn: "{{ gcp_http_lb_cdn }}"
30 project: "{{ gcp_http_lb_gcp_project }}"
31 auth_kind: "{{ gcp_http_lb_auth_kind }}"
32 service_account_file: "{{ gcp_http_lb_service_account_file }}"
33 state: "{{ gcp_http_lb_state }}"
34 register: backendservice
35 - name: Create a url map
36 google.cloud.gcp_compute_url_map:
37 name: "{{ gcp_http_lb_urlmap }}"
38 default_service: "{{ backendservice }}"
39 project: "{{ gcp_http_lb_gcp_project }}"
40 auth_kind: "{{ gcp_http_lb_auth_kind }}"
41 service_account_file: "{{ gcp_http_lb_service_account_file }}"
42 state: "{{ gcp_http_lb_state }}"
43 register: urlmap
44 - name: Create a target http proxy
45 google.cloud.gcp_compute_target_http_proxy:
46 name: "{{ gcp_http_lb_httpproxy }}"
47 url_map: "{{ urlmap }}"
48 project: "{{ gcp_http_lb_gcp_project }}"
49 auth_kind: "{{ gcp_http_lb_auth_kind }}"
50 service_account_file: "{{ gcp_http_lb_service_account_file }}"
51 state: "{{ gcp_http_lb_state }}"
52 register: httpproxy
53 - name: Create a global forwarding rule
54 google.cloud.gcp_compute_global_forwarding_rule:
55 name: "{{ gcp_http_lb_forwardingrule }}"
56 ip_address: "{{ globaladdress.address }}"
57 load_balancing_scheme: EXTERNAL
58 ip_protocol: TCP
59 port_range: 80-80
60 target: "{{ httpproxy.selfLink }}"
61 project: "{{ gcp_http_lb_gcp_project }}"
62 auth_kind: "{{ gcp_http_lb_auth_kind }}"
63 service_account_file: "{{ gcp_http_lb_service_account_file }}"
64 state: "{{ gcp_http_lb_state }}"
65 register: result