-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path37738.yml
41 lines (41 loc) · 1.38 KB
/
37738.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
- name: Create Linux image
hosts: localhost
connection: local
gather_facts: yes
vars:
key_data: |
{{ lookup('file', 'ssh_keys/dom-desktop-rsa') }}
{{ lookup('file', 'ssh_keys/henti-desktop-rsa') }}
vars_files:
- vars/azure-resources.yml
tasks:
- name: Create public IP address
azure_rm_publicipaddress:
resource_group: "{{resourcegroups.name}}"
allocation_method: Dynamic
name: "lin-ip-{{ ansible_date_time.date }}"
domain_name_label: az-lin-img-01
- name: Create virtual network inteface card
azure_rm_networkinterface:
resource_group: "{{resourcegroups.name}}"
name: "lin-nic-{{ ansible_date_time.date }}"
virtual_network: "{{virtualnetworks.name}}"
subnet: "{{virtualsubnets.name}}"
public_ip_name: "lin-ip-{{ ansible_date_time.date }}"
security_group: "{{securitygroups.name}}"
- name: Create VM
azure_rm_virtualmachine:
resource_group: "{{resourcegroups.name}}"
name: "lin-vm-{{ ansible_date_time.date }}"
vm_size: Standard_F8s_v2
admin_username: semmle
ssh_password_enabled: false
ssh_public_keys:
- path: /home/semmle/.ssh/authorized_keys
key_data: "{{ key_data }}"
network_interfaces: "lin-nic-{{ ansible_date_time.date }}"
image:
offer: Debian
publisher: credativ
sku: '9'
version: latest