Set-OPS — moteur d'ecosystemes numeriques souverains (Alliance Boreale)
This commit is contained in:
commit
3dd3f43ad8
308 changed files with 13649 additions and 0 deletions
3
roles/ssh_baseline/README.md
Normal file
3
roles/ssh_baseline/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Rôle ssh_baseline
|
||||
|
||||
Déploie la configuration SSH de base.
|
||||
4
roles/ssh_baseline/defaults/main.yml
Normal file
4
roles/ssh_baseline/defaults/main.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
ssh_baseline_password_authentication: "no"
|
||||
ssh_baseline_permit_root_login: "no"
|
||||
ssh_baseline_pubkey_authentication: "yes"
|
||||
11
roles/ssh_baseline/handlers/main.yml
Normal file
11
roles/ssh_baseline/handlers/main.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
- name: Valider la configuration SSH
|
||||
ansible.builtin.command: sshd -t
|
||||
changed_when: false
|
||||
listen: Validate and reload ssh
|
||||
|
||||
- name: Recharger SSH
|
||||
ansible.builtin.systemd:
|
||||
name: ssh
|
||||
state: reloaded
|
||||
listen: Validate and reload ssh
|
||||
28
roles/ssh_baseline/tasks/main.yml
Normal file
28
roles/ssh_baseline/tasks/main.yml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
- name: Installer openssh-server
|
||||
ansible.builtin.apt:
|
||||
name: openssh-server
|
||||
state: present
|
||||
|
||||
- name: Créer le répertoire sshd_config.d
|
||||
ansible.builtin.file:
|
||||
path: /etc/ssh/sshd_config.d
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
|
||||
- name: Déployer la configuration SSH Set-OPS
|
||||
ansible.builtin.template:
|
||||
src: 10-setops.conf.j2
|
||||
dest: /etc/ssh/sshd_config.d/10-setops.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify: Validate and reload ssh
|
||||
|
||||
- name: Activer et démarrer SSH
|
||||
ansible.builtin.systemd:
|
||||
name: ssh
|
||||
enabled: true
|
||||
state: started
|
||||
14
roles/ssh_baseline/templates/10-setops.conf.j2
Normal file
14
roles/ssh_baseline/templates/10-setops.conf.j2
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Managed by Ansible — Set-OPS
|
||||
|
||||
PermitRootLogin {{ ssh_baseline_permit_root_login }}
|
||||
PubkeyAuthentication {{ ssh_baseline_pubkey_authentication }}
|
||||
PasswordAuthentication {{ ssh_baseline_password_authentication }}
|
||||
AuthenticationMethods publickey
|
||||
KbdInteractiveAuthentication no
|
||||
ChallengeResponseAuthentication no
|
||||
PermitEmptyPasswords no
|
||||
HostbasedAuthentication no
|
||||
IgnoreRhosts yes
|
||||
X11Forwarding no
|
||||
PermitUserEnvironment no
|
||||
UsePAM yes
|
||||
Loading…
Reference in a new issue