-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup
executable file
·41 lines (34 loc) · 929 Bytes
/
setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /bin/bash
SUBSCRIPTION="DS Data Magnet Incubations"
ansible-playbook <(
cat <<YAML
- name: Install the Azure CLI
hosts: localhost
vars:
azure_cli_apt_repo: "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ {{ ansible_distribution_release }} main"
tasks:
- name: Install playbook dependencies
become: yes
apt:
name:
- ca-certificates
- apt-transport-https
- gnupg
update_cache: yes
- name: Download and install Microsoft's signing key
become: yes
apt_key:
url: https://packages.microsoft.com/keys/microsoft.asc
- name: Add the Azure CLI software repository
become: yes
apt_repository:
repo: "{{ azure_cli_apt_repo }}"
update_cache: yes
- name: Install the Azure CLI
become: yes
apt: name=azure-cli
YAML
)
az login
echo "Setting Azure subscription to '$SUBSCRIPTION'" 1>&2
az account set -s "$SUBSCRIPTION"