algo/files/cloud-init/base.yml
Jack Ivanov d635c76b50
Change default SSH port and introduce cloud-init support (#1636)
* Change default SSH port

* Iptables to ansible_ssh_port

* Add Scaleway

* permissions and groups fixes

* update firewall docs

* SSH fixes

* add missing cloudinit to cloud-azure

* remove ansible_ssh_user from the tests

* congrats message fix
2020-01-07 14:28:19 +01:00

30 lines
621 B
YAML

#cloud-config
output: {all: '| tee -a /var/log/cloud-init-output.log'}
package_update: true
package_upgrade: true
packages:
- sudo
users:
- default
- name: algo
homedir: /home/algo
sudo: ALL=(ALL) NOPASSWD:ALL
groups: adm,netdev
shell: /bin/bash
lock_passwd: true
ssh_authorized_keys:
- "{{ lookup('file', '{{ SSH_keys.public }}') }}"
write_files:
- path: /etc/ssh/sshd_config
content: |
{{ lookup('template', 'files/cloud-init/sshd_config') | indent(width=6) }}
runcmd:
- set -x
- sudo apt-get remove -y --purge sshguard || true
- systemctl restart sshd.service