Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: Create Azure VM
- hosts: localhost
- connection: local
- with_items:
- - { vmname: 'testvmfordb', userpassword: 'my password' }
- - { vmname: 'testvmforfe', userpassword: 'my other password' }
- tasks:
- - name: Create virtual network inteface card
- azure_rm_networkinterface:
- resource_group: my_rg
- name: "{{ item.vmname }}NIC"
- virtual_network: my_rg
- subnet: default
- public_ip_name: "{{ item.vmname }}IP"
- security_group: my_firewall_rules
- - name: Create VM
- azure_rm_virtualmachine:
- resource_group: my_rg
- name: "{{ item.vmname }}"
- vm_size: Standard_DS1_v2
- location: EastUS
- admin_username: myusername
- admin_password: "{{ item.userpassword }}"
- ssh_password_enabled: true
- storage_container: vhds
- storage_blob: "{{ item.vmname }}osdisk.vhd"
- network_interfaces: "{{ item.vmname }}NIC"
- image:
- offer: UbuntuServer
- publisher: Canonical
- sku: '16.04-LTS'
- version: latest
- os_type: Linux
Add Comment
Please, Sign In to add comment