From bebac69f41b9d7507d4132d494f5c703a0b5b848 Mon Sep 17 00:00:00 2001 From: Danny Brito Date: Fri, 13 Oct 2023 19:26:08 +0000 Subject: [PATCH] add az-cli for capz windows images --- .../windows/roles/providers/tasks/azure.yml | 15 +++++++++++++++ images/capi/packer/goss/goss-command.yaml | 5 ++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/images/capi/ansible/windows/roles/providers/tasks/azure.yml b/images/capi/ansible/windows/roles/providers/tasks/azure.yml index e66f8a7b78..a1bb32347c 100644 --- a/images/capi/ansible/windows/roles/providers/tasks/azure.yml +++ b/images/capi/ansible/windows/roles/providers/tasks/azure.yml @@ -46,3 +46,18 @@ members: "{{ users }}" vars: users: "{{ wire_server_users.split(',') if (wire_server_users is defined) and (wire_server_users | length > 0) else [] }}" + +- name: Download Azure CLI MSI installer + ansible.windows.win_get_url: + url: https://aka.ms/installazurecliwindowsx64 + dest: C:\azure-cli.msi + +- name: Install Azure CLI + ansible.windows.win_package: + path: C:\azure-cli.msi + state: present + +- name: Clean up Azure CLI Installer file + ansible.windows.win_file: + path: C:\azure-cli.msi + state: absent diff --git a/images/capi/packer/goss/goss-command.yaml b/images/capi/packer/goss/goss-command.yaml index 422ffd7cdb..cf7d4827e9 100644 --- a/images/capi/packer/goss/goss-command.yaml +++ b/images/capi/packer/goss/goss-command.yaml @@ -220,7 +220,7 @@ command: - True stderr: [] timeout: 30000 - + # this could be moved to place for other providers if they want to install it Key Vault gMSA binary is installed: exec: powershell -command "Test-Path -Path C:\Windows\System32\CCGAKVPlugin.dll" @@ -246,6 +246,9 @@ command: stdout: - "ICcgDomainAuthCredentials" timeout: 30000 + Check Azure CLI is installed via alias: + exec: powershell -command "az" + exit-status: 0 {{end}} {{ if ne .Vars.ssh_source_url "" }}