summaryrefslogtreecommitdiff
path: root/ansible/ssh-dev.yml
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-07-31 16:56:57 +0300
committerLars Wirzenius <liw@liw.fi>2022-07-31 16:56:57 +0300
commit7e6e7ef34ed70a50ef4d42ea8eaa2b27d2790e51 (patch)
treee3aca1e3dc15342a05c319f523a7a1bfd992f916 /ansible/ssh-dev.yml
parent4aff2b8258eeb5a16abe5006bb342b102348a7c4 (diff)
downloadansibleness-7e6e7ef34ed70a50ef4d42ea8eaa2b27d2790e51.tar.gz
ssh-dev: set sshd port
Sponsored-by: author
Diffstat (limited to 'ansible/ssh-dev.yml')
-rw-r--r--ansible/ssh-dev.yml32
1 files changed, 32 insertions, 0 deletions
diff --git a/ansible/ssh-dev.yml b/ansible/ssh-dev.yml
new file mode 100644
index 0000000..dd20b79
--- /dev/null
+++ b/ansible/ssh-dev.yml
@@ -0,0 +1,32 @@
+- hosts: ssh-dev
+ remote_user: debian
+ become: yes
+ roles:
+ - role: sane_debian_system
+ - role: unix_users
+ tasks:
+ - name: "Configure SSH server port"
+ when: sshd_port is defined
+ copy:
+ content: |
+ Port {{ sshd_port }}
+ dest: /etc/ssh/sshd_config.d/port.conf
+ notify: sshd_restart
+ handlers:
+ - name: sshd_restart
+ systemd:
+ name: ssh
+ state: restarted
+ vars:
+ ansible_python_interpreter: /usr/bin/python3
+
+ sane_debian_system_version: 2
+ sane_debian_system_hostname: "{{ inventory_hostname }}"
+ sane_debian_system_codename: bullseye
+ sane_debian_system_mirror: deb.debian.org
+
+ unix_users_version: 2
+ unix_users:
+ - username: liw
+
+ sshd_port: 22