Skip to content

Commit

Permalink
fix: Accomodate Ubuntu 24.04 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwillsher committed Jun 7, 2024
1 parent dbf59af commit e68be48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions templates/sshd.socket.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Accept=yes
{% else %}
Accept=no
{% endif %}
{% if ansible_facts["distribution"]=="Ubuntu" and ansible_facts["distribution_version"] is version('24.04', '>=') %}
FreeBind=yes
{% endif %}

[Install]
WantedBy=sockets.target
{% if ansible_facts["distribution"]=="Ubuntu" and ansible_facts["distribution_version"] is version('24.04', '>=') %}
RequiredBy=ssh.service
{% endif %}
2 changes: 2 additions & 0 deletions tests/tests_systemd_services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
# * I do not think the ConditionPathExists is much useful so skipping on Ubuntu
# * Before= does not make any sense in combination with Conflicts=
# * I do not think the Description needs to match verbatim either
# * Accept varies in the default file between Ubuntu versions and is explicit anyway
- name: Construct the options list from old socket file
ansible.builtin.set_fact:
__sshd_socket_list: "{{ __sshd_socket_list + [item] }}"
Expand All @@ -102,6 +103,7 @@
- not item.startswith("ConditionPathExists=")
- not item.startswith("Before=")
- not item.startswith("Description=")
- not item.startswith("Accept=")
loop:
"{{ socket_old.splitlines() }}"

Expand Down

0 comments on commit e68be48

Please sign in to comment.