-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
cloud-config.yml
executable file
·74 lines (67 loc) · 1.82 KB
/
cloud-config.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
#cloud-config
## Set your hostname here, the manage_etc_hosts will update the hosts file entries as well
hostname: k8s-master-01
manage_etc_hosts: true
## Set the locale of the system
locale: 'en_AU.UTF-8'
#locale: 'en_US.UTF-8'
## Set the timezone
## Value of 'timezone' must exist in /usr/share/zoneinfo
timezone: 'Australia/Melbourne'
#timezone: 'America/New_York'
apt_preserve_sources_list: true
apt_update: true
apt_upgrade: true
users:
- name: pi
primary-group: users
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
groups: users
ssh_import_id: None
## To enable SSH password log in
## mkpasswd --method=SHA-512 --rounds=4096
# passwd: ""
# lock_passwd: false
# ssh_pwauth: true
lock_passwd: true
ssh_pwauth: false
ssh_authorized_keys:
- 'ssh-rsa '
write_files:
- path: /etc/netplan/50-cloud-init.yaml
permissions: '0644'
content: |
network:
version: 2
ethernets:
eth0:
dhcp4: no
addresses:
- 192.168.1.121/24
gateway4: 192.168.1.1
nameservers:
addresses:
- 1.1.1.1
- 8.8.8.8
## To enable WiFi network connection
## Note: IP allocation is dynamic and won't match the defined state as in eth0.
## This will require manually configuring the Ansible inventory file with
## the assigned IP values.
# wifis:
# wlan0:
# optional: true
# dhcp4: true
# access-points:
# 'YOUR-SSID-NAME':
# password: 'YOUR-NETWORK-PASSWORD'
runcmd:
- [sudo, netplan, apply]
- [
sudo,
sed,
-i,
's/PasswordAuthentication no/PasswordAuthentication yes/g',
/etc/ssh/sshd_config,
]
- [sudo, systemctl, restart, sshd]