infrastructure/templates/cloud-init.yaml.tpl

42 lines
1.4 KiB
Go Template

#cloud-config
users:
- name: serguzim
gecos: Serguzim
groups: users,admin,wheel
sudo: "ALL=(ALL) ALL"
shell: /bin/bash
lock_passwd: false
ssh_authorized_keys:
- "${default_ssh_keys["openpgp:0xAB920993"]}"
- name: ansible
gecos: Ansible User
groups: users,admin,wheel
sudo: "ALL=(ALL) NOPASSWD:ALL"
shell: /bin/bash
lock_passwd: true
ssh_authorized_keys:
%{ for n, k in default_ssh_keys ~}
- "${k}"
%{ endfor ~}
packages:
- git
- vim
runcmd:
############################################################
### Configure sshd ### Configure sshd ### Configure sshd ###
############################################################
- sed -i 's/\#\?Port .\+/Port 17/' /etc/ssh/sshd_config
- sed -i 's/\#\?PasswordAuthentication .\+/PasswordAuthentication no/' /etc/ssh/sshd_config
- sed -i 's/\#\?PermitRootLogin .\+/PermitRootLogin no/' /etc/ssh/sshd_config
- systemctl restart sshd
###############################################################
### Install netbird ### Install netbird ### Install netbird ###
###############################################################
# One-command install, from https://docs.netbird.io/get-started/install/linux
- ['sh', '-c', 'curl -fsSL https://pkgs.netbird.io/install.sh | sh']
- ['netbird', 'up', '--setup-key=${netbird_setup_key}', '--hostname=${hostname}']