Files
ansible/roles/system/tasks/sshd.yml
2024-07-05 11:53:33 +02:00

30 lines
693 B
YAML

---
- name: SSH configuration file
ansible.builtin.template:
src: sshd_config.j2
dest: /etc/ssh/sshd_config
mode: 0644
notify:
- Restart sshd
- name: SSH keys home
ansible.posix.authorized_key:
user: root
state: present
key: "{{ lookup('file', 'ssh/home.id_rsa.pub') }}"
- name: SSH keys work
ansible.posix.authorized_key:
user: root
state: present
key: "{{ lookup('file', 'ssh/work.id_rsa.pub') }}"
- name: SSH keys stef
ansible.posix.authorized_key:
user: root
state: present
key: "{{ lookup('file', 'ssh/stefofficiel.id_rsa.pub') }}"
path: "~/.ssh/instance_keys"
when: inventory_hostname in groups['fedinupesservers']