Skip to content

Commit

Permalink
users and group are actually lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
buluma committed Jan 22, 2024
1 parent d04a5dd commit c006309
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 23 deletions.
4 changes: 2 additions & 2 deletions templates/sshd_config_Alpine.j2
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ AcceptEnv {{ item }}
Subsystem {{ openssh_subsystem }}

{% if openssh_allow_users is defined %}
AllowUsers {{ openssh_allow_users }}
AllowUsers {{ openssh_allow_users | join(' ') }}
{% endif %}

{% if openssh_allow_groups is defined %}
AllowGroups {{ openssh_allow_groups }}
AllowGroups {{ openssh_allow_groups | join(' ') }}
{% endif %}
5 changes: 2 additions & 3 deletions templates/sshd_config_Archlinux.j2
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,10 @@ AcceptEnv {{ item }}
Subsystem {{ openssh_subsystem }}

{% if openssh_allow_users is defined %}
AllowUsers {{ openssh_allow_users }}
AllowUsers {{ openssh_allow_users | join(' ') }}
{% endif %}

{% if openssh_allow_groups is defined %}
AllowGroups {{ openssh_allow_groups }}
{% endif %}
AllowGroups {{ openssh_allow_groups | join(' ') }}

TrustedUserCAKeys {{ openssh_trusted_user_ca_keys }}
4 changes: 2 additions & 2 deletions templates/sshd_config_Debian.j2
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ AcceptEnv {{ item }}
Subsystem {{ openssh_subsystem }}

{% if openssh_allow_users is defined %}
AllowUsers {{ openssh_allow_users }}
AllowUsers {{ openssh_allow_users | join(' ') }}
{% endif %}

{% if openssh_allow_groups is defined %}
AllowGroups {{ openssh_allow_groups }}
AllowGroups {{ openssh_allow_groups | join(' ') }}
{% endif %}

TrustedUserCAKeys {{ openssh_trusted_user_ca_keys }}
4 changes: 2 additions & 2 deletions templates/sshd_config_Fedora.j2
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ AcceptEnv {{ item }}
Subsystem {{ openssh_subsystem }}

{% if openssh_allow_users is defined %}
AllowUsers {{ openssh_allow_users }}
AllowUsers {{ openssh_allow_users | join(' ') }}
{% endif %}

{% if openssh_allow_groups is defined %}
AllowGroups {{ openssh_allow_groups }}
AllowGroups {{ openssh_allow_groups | join(' ' ) }}
{% endif %}

TrustedUserCAKeys {{ openssh_trusted_user_ca_keys }}
4 changes: 2 additions & 2 deletions templates/sshd_config_RedHat-7.j2
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ AcceptEnv {{ item }}
Subsystem {{ openssh_subsystem }}

{% if openssh_allow_users is defined %}
AllowUsers {{ openssh_allow_users }}
AllowUsers {{ openssh_allow_users | join(' ') }}
{% endif %}

{% if openssh_allow_groups is defined %}
AllowGroups {{ openssh_allow_groups }}
AllowGroups {{ openssh_allow_groups | join(' ') }}
{% endif %}

TrustedUserCAKeys {{ openssh_trusted_user_ca_keys }}
4 changes: 2 additions & 2 deletions templates/sshd_config_RedHat.j2
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ Subsystem {{ openssh_subsystem }}
# ForceCommand cvs server

{% if openssh_allow_users is defined %}
AllowUsers {{ openssh_allow_users }}
AllowUsers {{ openssh_allow_users | join(' ') }}
{% endif %}

{% if openssh_allow_groups is defined %}
AllowGroups {{ openssh_allow_groups }}
AllowGroups {{ openssh_allow_groups | join(' ') }}
{% endif %}

TrustedUserCAKeys {{ openssh_trusted_user_ca_keys }}
4 changes: 2 additions & 2 deletions templates/sshd_config_Suse.j2
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ AcceptEnv {{ item }}
Subsystem {{ openssh_subsystem }}

{% if openssh_allow_users is defined %}
AllowUsers {{ openssh_allow_users }}
AllowUsers {{ openssh_allow_users | join(' ') }}
{% endif %}

{% if openssh_allow_groups is defined %}
AllowGroups {{ openssh_allow_groups }}
AllowGroups {{ openssh_allow_groups | join(' ') }}
{% endif %}

TrustedUserCAKeys {{ openssh_trusted_user_ca_keys }}
12 changes: 4 additions & 8 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ _openssh_packages:

openssh_packages: "{{ _openssh_packages[ansible_os_family] | default(_openssh_packages['default']) }}"

_openssh_key_types:
default:
- rsa
- ecdsa
- ed25519

openssh_key_types: "{{ _openssh_key_types[ansible_distribution ~ '-' ~ ansible_distribution_major_version] | default(_openssh_key_types['default'] ) }}"
openssh_key_types:
- rsa
- ecdsa
- ed25519

openssh_run_directory: /run/sshd

Expand All @@ -26,7 +23,6 @@ _openssh_service:
Debian-bullseye: ssh
Ubuntu-19: ssh
Ubuntu-20: ssh
Kali-kali-rolling: ssh

openssh_service: "{{ _openssh_service[ansible_distribution ~ '-' ~ ansible_distribution_release] | default(_openssh_service['default'] ) }}"

Expand Down

0 comments on commit c006309

Please sign in to comment.