Files
Apache-LXC-Intranet/playbooks/ssh.yml
2026-06-13 13:41:42 +01:00

51 lines
1.1 KiB
YAML

- name: configure ssh
hosts: apache-intranet
become: true
tasks:
- name: copy the favourite icon
copy:
src: ../configs/favicon.ico
dest: /var/www/intranet
owner: root
group: root
mode: 0644
- name: create .ssh dir for jigglypuff
file:
path: "/home/jigglypuff/.ssh"
state: directory
owner: jigglypuff
group: jigglypuff
mode: 0700
- name: create custom jigglypuff ssh parameters
ansible.builtin.copy:
src: "{{ item }}"
dest: /etc/ssh/sshd_config.d/
owner: root
group: root
mode: 0644
loop:
- ../configs/jigglypuff.conf
- ../configs/password-login.conf
- ../configs/root-login.conf
- name: generate jigglypuff's ssh key pair
community.crypto.openssh_keypair:
path: "./jigglypuff"
type: ed25519
delegate_to: localhost
- name: install jigglypuff's public key
ansible.posix.authorized_key:
user: jigglypuff
state: present
key: "{{ lookup('file', playbook_dir + '/jigglypuff.pub') }}"
- name: restart ssh
ansible.builtin.systemd:
name: ssh
state: restarted