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

34
azure_get-vminfo.yml Normal file
View File

@@ -0,0 +1,34 @@
---
- name: get resource group info
become: true
become_user: root
# become_method: runas
hosts: localhost
gather_facts: no
tasks:
- name: Get all facts
azure_rm_virtualmachine_info:
register: all_facts
no_log: true
- name: set RG name
set_fact:
rg_name: "{{item.resource_group}}"
when: item.name == "{{ vmname }}"
with_items: "{{all_facts.vms}}"
no_log: true
- name: get rg_info
debug:
msg: "The vm {{vmname}} is located in the resource group {{rg_name}}"
environment:
#aperam.com
- AZURE_CLIENT_ID: "{{AZURE_CLIENT_ID}}"
- AZURE_SECRET: "{{AZURE_SECRET}}"
- AZURE_SUBSCRIPTION_ID: "{{AZURE_SUBSCRIPTION_ID}}"
- AZURE_TENANT: "{{AZURE_TENANT}}"