-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure2.yml
43 lines (39 loc) · 1.14 KB
/
azure2.yml
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
42
43
- hosts: azure_infra
connection: local
gather_facts: yes
vars:
location: westeurope
tasks:
- name: Create a ressource groupe sn-infra
azure_rm_resourcegroup:
name: "{{ resource_group }}"
location: "{{ location }}"
- name: Create Azure Deploy
azure_rm_deployment:
state: present
resource_group_name: "{{ resource_group }}"
location: "{{ location }}"
template_link: 'https://raw.githubusercontent.com/angegar/ansible/master/azure-templates/windows_server.json'
parameters:
serverName:
value : "{{ vm_name }}"
login:
value: "{{ login }}"
password:
value: "{{ mdp }}"
location:
value: "{{ location }}"
dataDiskSize:
value: 200
publisher:
value: "{{ publisher }}"
offer:
value: "{{ offer }}"
sku:
value: "{{ sku }}"
register: "server"
- name: Register the VM in the Windows group
add_host:
hostname: "{{ item['ips'][0].public_ip }}"
groupname: "jenkins_group"
with_items: "{{ server.deployment.instances }}"