1
0

Actualiser 01_AnsibleAzure.yaml

This commit is contained in:
2025-01-30 16:35:22 +01:00
parent 5c256faa9f
commit 2a5a3c67ca
+6 -3
View File
@@ -1,4 +1,3 @@
Créer le fichier infra_azure.yml :
- name: Déployer une infrastructure Azure complète
hosts: localhost
gather_facts: no
@@ -27,6 +26,7 @@ Créer le fichier infra_azure.yml :
azure.azcollection.azure_rm_resourcegroup:
name: "{{ resource_group }}"
location: "{{ location }}"
# Créer un Virtual Network
- name: Créer un Virtual Network
azure.azcollection.azure_rm_virtualnetwork:
@@ -35,6 +35,7 @@ Créer le fichier infra_azure.yml :
location: "{{ location }}"
address_prefixes:
- "10.0.0.0/16"
# Créer un Subnet
- name: Créer un Subnet
azure.azcollection.azure_rm_subnet:
@@ -42,6 +43,7 @@ Créer le fichier infra_azure.yml :
resource_group: "{{ resource_group }}"
virtual_network: "{{ virtual_network }}"
address_prefix: "10.0.1.0/24"
# Créer une IP publique
- name: Créer une IP publique
azure.azcollection.azure_rm_publicipaddress:
@@ -49,6 +51,7 @@ Créer le fichier infra_azure.yml :
resource_group: "{{ resource_group }}"
allocation_method: Static
location: "{{ location }}"
# Créer un Network Security Group
- name: Créer un Network Security Group (NSG)
azure.azcollection.azure_rm_securitygroup:
@@ -81,13 +84,12 @@ Créer le fichier infra_azure.yml :
destination_port_range: '*'
source_address_prefix: '*'
destination_address_prefix: '*'
# Créer une interface réseau (NIC)
- name: Créer une interface réseau pour la VM
azure.azcollection.azure_rm_networkinterface:
name: "{{ network_interface }}"
resource_group: "{{ resource_group }}"
ANSIBLE Page 3
resource_group: "{{ resource_group }}"
location: "{{ location }}"
security_group: "{{ NSG }}"
virtual_network: "{{ virtual_network }}"
@@ -95,6 +97,7 @@ Créer le fichier infra_azure.yml :
ip_configurations:
- name: "ipconfig"
public_ip_address_name: "{{ IP_publique }}"
# Créer une VM Linux (exemple avec Ubuntu)
- name: Créer une VM Linux Ubuntu
azure.azcollection.azure_rm_virtualmachine: