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

Merge pull request #7 from roles-ansible/r

improve docs, sshd and pubkeys
This commit is contained in:
L3D 2024-04-09 18:30:13 +02:00 committed by GitHub
commit 7a8f000d4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 15 additions and 8 deletions

View file

@ -69,7 +69,7 @@ There is a third directory-variable called ``l3d_users__ssh_login: []`` which on
- name: 'charlie'
state: 'present'
l3d_users__limit_login: true
l3d_users__create_ansible: true
submodules_versioncheck: true
l3d_users__bashrc: true
l3d_users__vimrc: true
l3d_users__tmuxcfg: true
```

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:

View file

@ -5,7 +5,7 @@
user: "{{ user.name }}"
state: 'present'
key: "{{ user.pubkeys | default() }}"
exclusive: true
exclusive: "{{ user.exklusive_pubkeys | default(true) }}"
loop: "{{ _l3d_users__merged_users }}"
loop_control:
label: "user={{ user.name }}"

View file

@ -31,6 +31,7 @@
user: 'ansible'
state: "{{ l3d_users__ansible_user_state | ternary('present', 'absent') }}"
key: "{{ user.pubkeys | default() }}"
exclusive: false
loop: "{{ _l3d_users__merged_users }}"
when: user.admin | default(false) | bool and user.admin_ansible_login | default(true) | bool
loop_control:

View file

@ -1,3 +1,3 @@
---
playbook_version_number: 11
playbook_version_number: 12
playbook_version_path: 'l3d.users.user.version'