first commit

This commit is contained in:
root
2024-07-12 12:58:40 +02:00
commit 30fdad3be5
557 changed files with 11142 additions and 0 deletions

38
azure_delete-vm.yml Normal file
View File

@@ -0,0 +1,38 @@
---
- name: get resource group info
become: true
become_user: root
# become_method: runas
hosts: localhost
tasks:
- name: Remove a VM and all resources that were autocreated in azure
azure_rm_virtualmachine:
resource_group: "{{RG_name}}"
name: "{{VM_name}}"
state: absent
environment:
- AZURE_CLIENT_ID: 140ddce1-f5e1-45a3-84e0-38e8ec16e72b
- AZURE_SECRET: "{{secret}}"
- AZURE_SUBSCRIPTION_ID: a7f4215b-c8f8-45ac-8fdd-062c940b02f6
- AZURE_TENANT: 26845d4f-0cf4-4d08-b717-06b6b7824ec4
- name: remove computer object with devadm group
become_method: runas
hosts: all
vars:
ansible_user: "{{sysawxuser}}"
ansible_password: "{{sysawxpass}}"
tasks:
- name: delete devadm group
community.windows.win_domain_group:
name: CN=G-MGMT-LA-DEVADM-{{ VM_name |upper }}, OU=Local_Admin,OU=Device_Privileges,OU=Management_Groups,OU=Aperam,DC=ADAGILITY,DC=NET
domain_username: "{{sysaduser}}"
domain_password: "{{sysadpass}}"
state: absent
ignore_protection: yes
- name: delete computer account
community.windows.win_domain_computer:
name: "{{ VM_name |upper }}"
domain_username: "{{sysaduser}}"
domain_password: "{{sysadpass}}"
state: absent
ignore_protection: yes