Raw gce module: create an instance with disk size adjustment

I want to create a google compute instance using the ges gs module with a 100 gigabyte drive. But there is no configuration in the gce module to set the instance disk size in the gce module.

I know that we can work using the gce_pd module to create a disk and then attach it to a new instance, but is there any correct way to do this?

It is so easy to maintain, because lib cloud lib already supports this parameter.

+4
source share
1 answer

, gce disks (. code).

, :

- name: Create custom boot disk
  gce_pd:
    name: "{{ instance_name }}"
    image: "{{ instance_image }}"
    size_gb: "{{ disk_size }}"
    zone: "{{ zone  }"

- name: Launch instance with custom boot disk
  gce:
    name: "{{ instance_name }}"
    image: "{{ instance_image }}"
    zone: "{{ zone }}"
    disks:
      - name: "{{ instance_name }}"
        mode: READ_WRITE
0

Source: https://habr.com/ru/post/1621243/


All Articles