Correct Ansible script to spin-off GCE instance and Azure instance
A surprisingly large number of Ansible examples/documentation require additional work before they can work as expected.
To spin off Google Cloud compute instance using ansible use Gist instead of official one here.
And if you want to spin Azure instance using Ansible use this Gist.
Next step to make dynamic inventory working
For Google Cloud create file:
plugin: gcp_compute
projects:
- cord19kaggle
auth_kind: serviceaccount
service_account_file: "/home/alex/*.json"
For Azure
plugin: azure_rm
include_vm_resource_groups:
- cord19demo
auth_source: auto
keyed_groups:
- prefix: tag
key: tags
Use like: ansible-playbook -i instances.gcp.yml ./postgresql/zerotier-play.yaml
Written on May 5, 2020 by Alex Mikhalev.
Originally published on Medium