Skip to content

Instantly share code, notes, and snippets.

@tsuchm
Last active March 9, 2020 02:48
Show Gist options
  • Save tsuchm/1124d815bc3b31c894d6a1112a2aa128 to your computer and use it in GitHub Desktop.
Save tsuchm/1124d815bc3b31c894d6a1112a2aa128 to your computer and use it in GitHub Desktop.
Ansible task file to install Azure CLI
# Ansible task to install Azure CLI.
# These steps are re-implementation of the procedure descrbed at
# https://docs.microsoft.com/cli/azure/install-azure-cli-apt
- name: Install packages required by Azure CLI
apt:
name: ['ca-certificates', 'curl', 'apt-transport-https', 'lsb-release', 'gnupg']
state: present
- name: Add Azure CLI repository key
apt_key:
url: https://packages.microsoft.com/keys/microsoft.asc
state: present
- name: Add Azure CLI repository source
apt_repository:
repo: deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ {{ansible_distribution_release}} main
state: present
filename: azure-cli
- name: Install Azure CLI
apt:
name: ['azure-cli']
state: latest
update_cache: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment