Debian Codegraph @

ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/tasks/autogen.yml

raw symbols SCIP
1 ---
2 # ----------------------------------------------------------------------------
3 #
4 # *** AUTO GENERATED CODE *** Type: MMv1 ***
5 #
6 # ----------------------------------------------------------------------------
7 #
8 # This file is automatically generated by Magic Modules and manual
9 # changes will be clobbered when the file is regenerated.
10 #
11 # Please read more about how to change this file at
12 # https://www.github.com/GoogleCloudPlatform/magic-modules
13 #
14 # ----------------------------------------------------------------------------
15 # Pre-test setup
16 - name: Delete a reservation
17 google.cloud.gcp_compute_reservation:
18 name: "{{ resource_name }}"
19 zone: us-central1-a
20 specific_reservation:
21 count: 1
22 instance_properties:
23 min_cpu_platform: Intel Cascade Lake
24 machine_type: n2-standard-2
25 project: "{{ gcp_project }}"
26 auth_kind: "{{ gcp_cred_kind }}"
27 service_account_file: "{{ gcp_cred_file | default(omit) }}"
28 state: absent
29 # ----------------------------------------------------------
30 - name: Create a reservation
31 google.cloud.gcp_compute_reservation:
32 name: "{{ resource_name }}"
33 zone: us-central1-a
34 specific_reservation:
35 count: 1
36 instance_properties:
37 min_cpu_platform: Intel Cascade Lake
38 machine_type: n2-standard-2
39 project: "{{ gcp_project }}"
40 auth_kind: "{{ gcp_cred_kind }}"
41 service_account_file: "{{ gcp_cred_file | default(omit) }}"
42 state: present
43 register: result
44 - name: Assert changed is true
45 ansible.builtin.assert:
46 that:
47 - result.changed == true
48 - name: Verify that reservation was created
49 google.cloud.gcp_compute_reservation_info:
50 filters:
51 - name = {{ resource_name }}
52 zone: us-central1-a
53 project: "{{ gcp_project }}"
54 auth_kind: "{{ gcp_cred_kind }}"
55 service_account_file: "{{ gcp_cred_file | default(omit) }}"
56 scopes:
57 - https://www.googleapis.com/auth/compute
58 register: results
59 - name: Verify that command succeeded
60 ansible.builtin.assert:
61 that:
62 - results['resources'] | length == 1
63 # ----------------------------------------------------------------------------
64 - name: Create a reservation that already exists
65 google.cloud.gcp_compute_reservation:
66 name: "{{ resource_name }}"
67 zone: us-central1-a
68 specific_reservation:
69 count: 1
70 instance_properties:
71 min_cpu_platform: Intel Cascade Lake
72 machine_type: n2-standard-2
73 project: "{{ gcp_project }}"
74 auth_kind: "{{ gcp_cred_kind }}"
75 service_account_file: "{{ gcp_cred_file | default(omit) }}"
76 state: present
77 register: result
78 - name: Assert changed is false
79 ansible.builtin.assert:
80 that:
81 - result.changed == false
82 # ----------------------------------------------------------
83 - name: Delete a reservation
84 google.cloud.gcp_compute_reservation:
85 name: "{{ resource_name }}"
86 zone: us-central1-a
87 specific_reservation:
88 count: 1
89 instance_properties:
90 min_cpu_platform: Intel Cascade Lake
91 machine_type: n2-standard-2
92 project: "{{ gcp_project }}"
93 auth_kind: "{{ gcp_cred_kind }}"
94 service_account_file: "{{ gcp_cred_file | default(omit) }}"
95 state: absent
96 register: result
97 - name: Assert changed is true
98 ansible.builtin.assert:
99 that:
100 - result.changed == true
101 - name: Verify that reservation was deleted
102 google.cloud.gcp_compute_reservation_info:
103 filters:
104 - name = {{ resource_name }}
105 zone: us-central1-a
106 project: "{{ gcp_project }}"
107 auth_kind: "{{ gcp_cred_kind }}"
108 service_account_file: "{{ gcp_cred_file | default(omit) }}"
109 scopes:
110 - https://www.googleapis.com/auth/compute
111 register: results
112 - name: Verify that command succeeded
113 ansible.builtin.assert:
114 that:
115 - results['resources'] | length == 0
116 # ----------------------------------------------------------------------------
117 - name: Delete a reservation that does not exist
118 google.cloud.gcp_compute_reservation:
119 name: "{{ resource_name }}"
120 zone: us-central1-a
121 specific_reservation:
122 count: 1
123 instance_properties:
124 min_cpu_platform: Intel Cascade Lake
125 machine_type: n2-standard-2
126 project: "{{ gcp_project }}"
127 auth_kind: "{{ gcp_cred_kind }}"
128 service_account_file: "{{ gcp_cred_file | default(omit) }}"
129 state: absent
130 register: result
131 - name: Assert changed is false
132 ansible.builtin.assert:
133 that:
134 - result.changed == false