infrastructure/tf-templates/cloud-init.yaml.tpl

41 lines
1.3 KiB
Smarty
Raw Normal View History

2024-09-25 11:23:52 +00:00
#cloud-config
users:
- name: serguzim
gecos: Serguzim
groups: users,admin,wheel
sudo: "ALL=(ALL) ALL"
shell: /bin/bash
lock_passwd: false
ssh_authorized_keys:
2024-09-28 01:24:03 +00:00
- "${default_ssh_key}"
2024-09-25 11:23:52 +00:00
- name: ansible
gecos: Ansible User
groups: users,admin,wheel
sudo: "ALL=(ALL) NOPASSWD:ALL"
shell: /bin/bash
lock_passwd: true
ssh_authorized_keys:
2024-09-28 01:24:03 +00:00
- "${default_ssh_key}"
2024-09-25 11:23:52 +00:00
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 tailscale ### Install tailscale ### Install tailscale ###
#####################################################################
# One-command install, from https://tailscale.com/download/
- ['sh', '-c', 'curl -fsSL https://tailscale.com/install.sh | sh']
- ['tailscale', 'up', '--authkey=${tailscale_authkey}']