-
Notifications
You must be signed in to change notification settings - Fork 1
/
slim-static.yaml
48 lines (48 loc) · 1.15 KB
/
slim-static.yaml
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
#cloud-config
hostname: ${VM_NAME}
fqdn: ${VM_NAME}
disable_root: false
network:
config: disabled
users:
- name: ${USERNAME}
groups: users, admin, docker, sudo
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
lock_passwd: false
passwd: ${PASSWORD}
- name: ${VM_ADMIN}
gecos: system acct
groups: users, admin, docker, sudo
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
lock_passwd: false
passwd: ${PASSWORD}
ssh_authorized_keys:
- ${VM_KEY}
write_files:
- path: /etc/netplan/99-my-new-config.yaml
permissions: '0644'
content: |
network:
ethernets:
${INTERFACE}:
dhcp4: no
dhcp6: no
addresses: [${STATIC_IP_ADDRESS}/24]
routes:
- to: default
via: ${GATEWAY_IP}
mtu: 1500
nameservers:
addresses: [${DNS_SERVER_IP}]
renderer: networkd
version: 2
package_update: true
package_upgrade: false
runcmd:
- /usr/sbin/netplan --debug generate
- /usr/sbin/netplan --debug apply
- rm /etc/netplan/50*
- apt-get install -y ssh-import-id
- sudo -u ${USERNAME} ssh-import-id-gh ${GITHUB_USER}