1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_collection_users.git synced 2024-08-16 10:29:50 +02:00

Improve sshd template

This commit is contained in:
L3D 2024-04-09 18:23:58 +02:00
parent 1a44a2dbed
commit c82bd91683
Signed by: l3d
GPG key ID: CD08445BFF4313D1
3 changed files with 9 additions and 3 deletions

View file

@ -9,11 +9,17 @@
ansible.builtin.set_fact:
_sshd_version: "{{ _sshd_version_cmd.stderr.split('_')[1].split(',')[0].split('p')[0] }}"
- name: Show detected ssh version
- name: Show detected ssh version (optional)
ansible.builtin.debug:
msg: "SSH Version: {{ _sshd_version }}"
verbosity: 1
- name: Show detected ssh version is > 8.0 (optional)
ansible.builtin.debug:
msg: "SSH Version: {{ _sshd_version }} is > 8.0"
verbosity: 1
when: _sshd_version | default(7.0) | float > 8.0
- name: Create SSHD configuration
become: true
ansible.builtin.template:

View file

@ -4,7 +4,7 @@
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
{% if _sshd_version | default(7.0) | float > 8.0 | bool %}
{% if _sshd_version | default(7.0) | float > 8.0 %}
# Include SSHD config snippets
# Support fot this starts with sshd 8.0
Include /etc/ssh/sshd_config.d/*.conf

View file

@ -1,5 +1,5 @@
---
playbook_version_number: 5
playbook_version_number: 6
playbook_version_path: 'l3d.users.sshd.version'
l3d_users_sshd__service_var_path: