Recently was playing with cloud-init a bit, and it seems like a great and consistent way of setting up Ansible VMs. Here’s an example of creating a virtual machine via Azure portal and installing Ansible at once.
What you need to do is to go to Guest Config tag and add appropriate cloud-config playbook:
In this example I am using following code:
1 2 3 4 5 6 7 |
|
It can be even shorted if you don’t need Azure preview modules:
1 2 3 4 5 |
|