ansible-sshd/tasks/install_namespace.yml
Jakub Jelen 6e3257736e Rename handlers to start with sshd_ prefix
The documentation says there is only one global scope for handlers:

> There is only one global scope for handlers (handler names and listen topics)
> regardless of where the handlers are defined. This also includes handlers
> defined in roles.

So following the naming convention as we do in all the other variables
sounds like a good idea.

https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
2024-12-19 11:33:26 +01:00

24 lines
858 B
YAML

---
- name: Update configuration file snippet
vars:
sshd_skip_defaults: true
ansible.builtin.blockinfile:
path: "{{ sshd_config_file }}"
owner: "{{ sshd_config_owner }}"
group: "{{ sshd_config_group }}"
mode: "{{ sshd_config_mode }}"
block: |
{{ __sshd_compat_match_all }}
{{ lookup('template', 'sshd_config_snippet.j2') }}
create: true
marker: "# {mark} sshd system role managed block: namespace {{ sshd_config_namespace }}"
validate: >-
{% if not __sshd_supports_validate %}
true %s
{% elif sshd_test_hostkey is defined and sshd_test_hostkey.path is defined %}
{{ sshd_binary | quote }} -t -f %s -h {{ sshd_test_hostkey.path | quote }}/rsa_key
{% else %}
{{ sshd_binary | quote }} -t -f %s
{% endif %}
backup: "{{ sshd_backup }}"
notify: sshd_reload