Adding multiples ansible roles, playbooks and inventory

This commit is contained in:
2026-02-26 22:06:15 +00:00
parent d0a13e6f62
commit a4ccfe25ae
23 changed files with 1195 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
---
- name: S'assurer que le répertoire .ssh existe
file:
path: "~/.ssh"
state: directory
mode: '0700'
- name: Ajouter la clé publique au fichier authorized_keys
ansible.posix.authorized_key:
user: root
state: present
key: "{{ lookup('file', '/home/riesjack/.ssh/ansible.pub') }}"
- name: Ajouter la clé publique au fichier authorized_keys
ansible.posix.authorized_key:
user: root
state: present
key: "{{ lookup('file', '/home/riesjack/.ssh/riesjack.pub') }}"
- name: Inject ssh config to remove open ssh root
copy:
src: ../files/sshd_config
dest: /etc/ssh/sshd_config
- name: Restart SSH service
ansible.builtin.systemd:
name: ssh
state: restarted
enabled: yes