Actualiser 01 - Infrastructure Azure
@@ -9,10 +9,15 @@ Il faut notamment installer :
|
||||
|
||||
Connexion à Azure
|
||||
az login
|
||||
[OPTIONNEL]
|
||||
a- Créer un Service Principal dans Azure :
|
||||
az ad sp create-for-rbac --name "AnsibleServicePrincipal" --role="Contributor" --scopes="/subscriptions/<subscription_id>"
|
||||
|
||||
|
||||
## a- Créer un Service Principal dans Azure :
|
||||
|
||||
`az ad sp create-for-rbac --name "AnsibleServicePrincipal" --role="Contributor" --scopes="/subscriptions/<subscription_id>"`
|
||||
|
||||
Option Description
|
||||
|
||||
|
||||
az ad sp create-for-rbac Crée un Service Principal avec un rôle basé sur RBAC (Role-Based Access Control).
|
||||
--name "AnsibleServicePrincipal" Donne un nom au Service Principal (ici, AnsibleServicePrincipal). Tu peux le remplacer par un autre nom si besoin.
|
||||
--role "Contributor" Attribue le rôle Contributor au Service Principal. Ce rôle lui permet de gérer toutes les ressources dans la portée définie, sans pouvoir modifier les
|
||||
@@ -20,6 +25,17 @@ autorisations d’accès.
|
||||
--scopes
|
||||
"/subscriptions/<subscription_id>"
|
||||
Définit la portée des permissions. Ici, on applique le rôle à tout l’abonnement Azure. Tu dois remplacer <subscription_id> par l’ID de ton abonnement.
|
||||
|
||||
| **Option** | **Description** |
|
||||
| -------- | -------- |
|
||||
| az ad sp create-for-rbac| Crée un Service Principal avec un rôle basé sur RBAC (Role-Based Access Control). |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
"appId": "212debe2-a0fa-XXXX-9aa5-97f7524036cf",
|
||||
"displayName": "AnsibleServicePrincipal",
|
||||
@@ -56,9 +72,9 @@ A ajouter dans le fichier yml :
|
||||
changed_when: false
|
||||
- name: Afficher les informations du compte Azure
|
||||
debug:
|
||||
ANSIBLE Page 2
|
||||
debug:
|
||||
msg: "{{ azure_account.stdout }}"
|
||||
msg: "{{ azure_account.stdout }}"
|
||||
|
||||
|
||||
# 2- Déploiement via Ansible
|
||||
|
||||
On commence par créer le mot de passe sécurisé :
|
||||
|
||||
Reference in New Issue
Block a user