Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Created October 16, 2018 06:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save guitarrapc/b9bda8052c066158d793b44b19dc94a9 to your computer and use it in GitHub Desktop.
ansible playbook to install azcli for Ubuntu. follow to https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-apt?view=azure-cli-latest
---
- name: modify sources list for azcli
become: yes
apt_repository:
repo: deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ {{ ansible_distribution_release }} main
state: present
filename: azure-cli.list
tags: azcli
- name: Add an Apt signing key for azcli
become: yes
apt_key:
url: https://packages.microsoft.com/keys/microsoft.asc
state: present
tags: azcli
- name: Update and upgrade apt packages
become: yes
apt:
upgrade: dist
update_cache: yes
tags: azcli
- name: apt-get install azcli
become: yes
apt: pkg={{ item }} state=present update_cache=yes
with_items:
- apt-transport-https
- azure-cli
tags: azcli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment