简体   繁体   中英

Create VM and deploy application on to Azure VM via Ansible

I am new to Ansible Azure modules. What I need is the ability to create VM's(n) and deploy an application on all of them. From what I read online azure_rm_virtual machine can be used to create VM(Assuming .net, su.net and other.networking jazz is in place). I am trying to figure out how do I deploy(copy bits and run my app installer) my application onto the newly created VM's? Can my app deployment be part of the VM creation process? If so what are the options? I looked into other modules but couldn't find any relevant one's. Didn't find any on the azure documentation too. Thanks.

Use azure_rm_deployment module to create VMs.

Because you know what you are deploying, use azure_rm.networkinterface_facts to get the IP address of your VM.

Use add_host to create an ad-hoc inventory. This all with:

---
- name: Create VM
  hosts: localhost
  gather_facts: true

Once you have your inventory use:

- name: Run updates
  hosts: myazureinventory
  gather_facts: true

From here, you can install your software. Hope it helps.

The ansible role to deploy a VM is now here: azure-iaas . I couldn't find one called azure_rm_deployment in the ansible repo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM