Hi Team,
Trying to spinup windows VM using ansible in GCP. While executing the playbook, getting error as “‘gcp_compute_disk’ is not a valid attribute for a Play”
Here is the code we are using(mentioned is the error part of code):
name: Create an instance
hosts: localhost
gather_facts: no
connection: local
vars:
project: my-project
auth_kind: serviceaccount
service_account_file: /home/my_account.json
zone: "us-east1-b"
region: "us-east1"
tasks:
- name: create a disk
gcp_compute_disk:
name: 'network-instance'
size_gb: 50
source_image: 'projects/windows-cloud/global/images/windows-server-2016-dc-v20190312'
zone: "us-east1-b"
project: "Ansible-automation"
auth_kind: "serviceaccount"
service_account_file: "/home/my_account.json"
scopes:
- https://www.googleapis.com/auth/compute
state: present
register: disk
Error:
Ansible version: