Skip to content

Commit

Permalink
switch to env based auth (#5436)
Browse files Browse the repository at this point in the history
Co-authored-by: rut31337 <[email protected]>
  • Loading branch information
rut31337 and rut31337 authored Sep 19, 2022
1 parent ab93734 commit 0cbbf60
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ansible/roles-infra/infra-azure-create-inventory/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@

- name: Check if Resource Group exists
environment:
AZURE_CONFIG_DIR: "{{ output_dir }}/.azure-{{project_tag}}"
AZURE_CLIENT_ID: "{{ azure_service_principal }}"
AZURE_TENANT: "{{ azure_tenant }}"
AZURE_SECRET: "{{ azure_password }}"
AZURE_SUBSCRIPTION_ID: "{{ azure_subscription_id }}"
AZURE_CONFIG_DIR: "{{ output_dir }}/.azure-{{ project_tag }}"
tags:
- create_inventory
- must
azure.azcollection.azure_rm_resourcegroup_info:
auth_source: cli
auth_source: env
name: "{{ az_resource_group }}"
tenant: "{{ azure_tenant }}"
register: azrg
Expand All @@ -52,8 +56,6 @@
command: >-
az vm list --resource-group "{{ az_resource_group }}"
--show-details
environment:
AZURE_CONFIG_DIR: "{{ output_dir }}/.azure-{{project_tag}}"
changed_when: false
register: result_list
- name: Translate JSON output from 'az vm list' to ansible variable
Expand Down

0 comments on commit 0cbbf60

Please sign in to comment.