forked from UCCNetsoc/NaC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-nfs.yml
65 lines (62 loc) · 1.79 KB
/
create-nfs.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
---
- name: "Ensure NFS"
hosts: lovelace
roles:
- role: proxmox-infra-cloudinit-vm
vars:
vm:
name: "nfs.vm.netsoc.co"
protection: yes
clone: "netsoc-ubuntu-server-{{ inventory_hostname }}"
timeout: 300
description: |
groups:
- vm
- nfs
vars:
ansible_ssh_private_key_file: "/root/NaC-repo/keys/nfs/id_rsa"
net:
net0: "virtio,bridge=vmbr0,tag=30"
additional_disks:
virtio1: "local-lvm:25,format=raw"
cores: 4
memory: 4096
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: nfs.vm.netsoc.co
networkconfig: |
version: 2
ethernets:
30a:
match:
name: ens18
addresses:
- {{ ip_allocation.nfs }}
gateway4: 10.0.30.1
nameservers:
search: {{ ip_allocation.search }}
addresses: {{ ip_allocation.nameservers }}
wait_for_ssh: "{{ ip_allocation.nfs }}"
vars:
ssh_key_sig: "{{ lookup('file', './keys/nfs/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-nfs.yml