Update ansible
parent
b6dbbaf94c
commit
0667dc13a5
42
ansible.md
42
ansible.md
|
@ -12,3 +12,45 @@ fatal: [localhost]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_m
|
|||
```
|
||||
|
||||
then issue this command: `ln -s /usr/bin/python3 /usr/bin/python`.
|
||||
|
||||
|
||||
## Setup azure
|
||||
|
||||
`sudo apt install azure-cli`
|
||||
|
||||
`python3 -m venv ~/.venv-azure`
|
||||
|
||||
`source ~/.venv-azure/bin/activate`
|
||||
|
||||
`ansible-galaxy collection install azure.azcollection`
|
||||
|
||||
`pip3 install "ansible[azure]"` (in venv preferably)
|
||||
|
||||
Then go to Azure website and generate a new resource group.
|
||||
Try to generate az command for that
|
||||
|
||||
Then execute command:
|
||||
|
||||
```bash
|
||||
az ad sp create-for-rbac --name <some_random_name> \
|
||||
--role Contributor \
|
||||
--scopes /subscriptions/<subscription-ID>/resourceGroups/<resource-group-name>
|
||||
```
|
||||
to get the password. Other stuff can be fethced with `az account list`.
|
||||
|
||||
|
||||
Now write these creds into file:
|
||||
`$HOME/.azure/credentials`
|
||||
|
||||
like so:
|
||||
```
|
||||
[default]
|
||||
subscription_id= (when you create group)
|
||||
client_id= (appId in az ad)
|
||||
secret= (az ad sp password)
|
||||
tenant= (tennantId in both)
|
||||
```
|
||||
|
||||
## Clear all pip packages
|
||||
|
||||
`pip freeze | xargs pip uninstall -y`
|
||||
|
|
Loading…
Reference in New Issue