使用Ansible创建具有非托管磁盘的Azure vm?

时间:2018-03-08 19:27:01

标签: azure ansible azure-cli

我刚刚开始使用Ansible。在使用azure cli之前,我已经制作了简单的vms,并且有效。

有一个选项/标志, - use-unmanaged-disk。我一直在谷歌搜索疯狂,但我看不到类似的选项用于Ansible Playbook。这是我一直在尝试的指南: [https://docs.microsoft.com/sl-si/azure/virtual-machines/linux/ansible-create-complete-vm]

如果我遗漏了任何信息,请告诉我。提前谢谢!

1 个答案:

答案 0 :(得分:0)

- name: Create a VM with OS and multiple data storage accounts
  azure_rm_virtualmachine:
    resource_group: Testing
    name: testvm001
    vm_size: Standard_DS1_v2
    admin_username: adminUser
    ssh_password_enabled: false
    ssh_public_keys:
    - path: /home/adminUser/.ssh/authorized_keys
      key_data: < insert yor ssh public key here... >
    network_interfaces: testvm001
    storage_container: osdisk
    storage_blob: osdisk.vhd
    image:
    offer: CoreOS
    publisher: CoreOS
    sku: Stable
    version: latest
    data_disks:
    - lun: 0
      disk_size_gb: 64
      storage_container_name: datadisk1
      storage_blob_name: datadisk1.vhd
    - lun: 1
      disk_size_gb: 128
      storage_container_name: datadisk2
      storage_blob_name: datadisk2.vhd

参考:http://docs.ansible.com/ansible/latest/azure_rm_virtualmachine_module.html#azure-rm-virtualmachine