infrastructure/templates/cloud-init.yaml.tpl

40 lines
1.3 KiB
Smarty

#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_key}"
- name: ansible
gecos: Ansible User
groups: users,admin,wheel
sudo: "ALL=(ALL) NOPASSWD:ALL"
shell: /bin/bash
lock_passwd: true
ssh_authorized_keys:
- "${default_ssh_key}"
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}']