forked from UCCNetsoc/NaC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-auth.yml
77 lines (74 loc) · 2.32 KB
/
create-auth.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
- name: "Ensure Auth server"
hosts: lovelace
roles:
- role: proxmox-infra-cloudinit-vm
vars:
vm:
name: "auth.vm.netsoc.co"
protection: no
clone: "netsoc-ubuntu-server-{{ inventory_hostname }}"
timeout: 300
description: |
groups:
- vm
- auth
vars:
ansible_ssh_private_key_file: "/root/NaC-repo/keys/auth/id_rsa"
net:
net0: "virtio,bridge=vmbr0,tag=30"
net1: "virtio,bridge=vmbr0,tag=30"
resize_disks:
virtio0: "+5G"
additional_disks:
virtio1: "local-lvm:25,format=raw"
cores: 4
memory: 2048
cloudinit:
metadata: ""
userdata: |
#cloud-config
users:
- name: netsoc
gecos: Netsoc Management User
primary_group: netsoc
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys:
- {{ ssh_key_sig }}
preserve_hostname: false
manage_etc_hosts: true
fqdn: auth.vm.netsoc.co
networkconfig: |
version: 2
ethernets:
30a:
match:
name: ens18
addresses:
- {{ ip_allocation.freeipa_base }}
gateway4: 10.0.30.1
nameservers:
search: {{ ip_allocation.search }}
addresses: {{ ip_allocation.nameservers }}
30b:
match:
name: ens19
addresses:
- {{ ip_allocation.keycloak_base }}
gateway4: 10.0.30.1
nameservers:
search: {{ ip_allocation.search }}
addresses: {{ ip_allocation.nameservers }}
wait_for_ssh: "{{ ip_allocation.freeipa_base | ipmath(ansible_play_hosts_all.index(inventory_hostname)) }}"
vars:
ssh_key_sig: "{{ lookup('file', './keys/auth/id_rsa.pub') }}"
vars_files:
- vars/ip_allocation.yml
- vars/proxmox.yml
- vars/secrets.yml
- name: "Reload inventory to pull new VMs"
hosts: 127.0.0.1
connection: local
tasks:
- meta: refresh_inventory
- import_playbook: provision-auth.yml