Labfiles/AZ-400T05-ImplemntgAppInfra/Labfiles/ansible/delete_vm.yml [4:23]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- name: Remove Virtual Machine and associated objects
  hosts: localhost
  connection: local
  gather_facts: no 
  tasks:
  - name: Remove VM and all resources
    azure_rm_virtualmachine:
      resource_group: '{{ resgrp }}'
      name: '{{ vmname }}'
      state: absent
      # ignore_errors: yes
      remove_on_absent:
        - network_interfaces
        - virtual_storage
        - public_ips
  - name: Remove storage account
    azure_rm_storageaccount: 
      resource_group: '{{ resgrp }}'
      name:  '{{ vmname }}'
      state: absent
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



Labfiles/ansible-azure-lab/delete_vm.yml [4:23]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- name: Remove Virtual Machine and associated objects
  hosts: localhost
  connection: local
  gather_facts: no 
  tasks:
  - name: Remove VM and all resources
    azure_rm_virtualmachine:
      resource_group: '{{ resgrp }}'
      name: '{{ vmname }}'
      state: absent
      # ignore_errors: yes
      remove_on_absent:
        - network_interfaces
        - virtual_storage
        - public_ips
  - name: Remove storage account
    azure_rm_storageaccount: 
      resource_group: '{{ resgrp }}'
      name:  '{{ vmname }}'
      state: absent
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



