Skip to content

Instantly share code, notes, and snippets.

@rpappalax
Created August 10, 2020 22:52
Show Gist options
  • Save rpappalax/e014558b4f5b7aea65314e448f7a244b to your computer and use it in GitHub Desktop.
Save rpappalax/e014558b4f5b7aea65314e448f7a244b to your computer and use it in GitHub Desktop.
---
- name: Create instance(s)
hosts: localhost
gather_facts: no
connection: local
vars:
machine_type: n1-standard-1 # default
image: debian-7
service_account_email: [email protected]
credentials_file: /my/path/demo_ansible.json
project_id: my-project-1
tasks:
- name: Launch instances
gce:
instance_names: dev
machine_type: "{{ machine_type }}"
image: "{{ image }}"
service_account_email: "{{ service_account_email }}"
credentials_file: "{{ credentials_file }}"
project_id: "{{ project_id }}"
tags: webserver
register: gce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment