Refs #8013: Playbook Claves ssh - authorized_keys2 added with users list. Split ssh task, generate keys & configure. #36

Merged
juan merged 1 commits from 8013-Playbook_Claves_ssh into main 2024-10-21 14:33:45 +00:00
5 changed files with 26 additions and 13 deletions

View File

@ -6,8 +6,8 @@
tags: resolv
- import_tasks: timesync.yml
tags: timesync
- import_tasks: ssh.yml
tags: ssh
- import_tasks: sshd_configure.yml
tags: sshd_configure
- import_tasks: defuser.yml
tags: defuser
- import_tasks: install.yml

View File

@ -0,0 +1,17 @@
- name: Configure sshd_config settings
copy:
dest: /etc/ssh/sshd_config.d/vn-listenipv4.conf
content: |
# Do not edit this file! Ansible will overwrite it.
ListenAddress 0.0.0.0
owner: root
group: root
mode: u=rw,g=r,o=r
notify: restart sshd
- name: Deploy custom authorized_keys for root
copy:
dest: /root/.ssh/authorized_keys2
content: "{{ public_keys }}"
owner: root
group: root
mode: u=rw,g=,o=

View File

@ -2,3 +2,7 @@
service:
name: nslcd
state: restarted
- name: restart-ssh
systemd:
name: ssh
state: restarted

View File

@ -2,3 +2,5 @@
tags: auth
- import_tasks: sudoers.yml
tags: sudoers
- import_tasks: ssh_keys.yml
tags: ssh_keys

View File

@ -18,14 +18,4 @@
path: /etc/vn.ini
section: witness
option: ssh_keys_generated
value: true
- name: Configure sshd_config settings
copy:
dest: /etc/ssh/sshd_config.d/vn-listenipv4.conf
content: |
# Do not edit this file! Ansible will overwrite it.
ListenAddress 0.0.0.0
owner: root
group: root
mode: u=rw,g=r,o=r
notify: restart sshd
value: true