proftpd: remove whitelist block if feature is disabled

This commit is contained in:
Jérémy Lecour 2024-04-30 17:38:14 +02:00 committed by Jérémy Lecour
parent 1d5415237c
commit e3746d18fb
Signed by: jlecour
SSH key fingerprint: SHA256:h+5LgHRKwN9lS0SsdVR5yZPeFlJE4Mt+8UtL4CcP8dY
2 changed files with 11 additions and 1 deletions

View file

@ -13,6 +13,8 @@ The **patch** part is incremented if multiple releases happen the same month
### Added
proftpd: optional configuration of IP whitelists per groups of users
### Changed
* autosysadmin-agent: upstream release 24.03.2

View file

@ -61,7 +61,7 @@
tags:
- proftpd
- name: Whitelist ip for users (SFTP)
- name: IP Whitelists for SFTP users are present
ansible.builtin.blockinfile:
dest: /etc/proftpd/conf.d/sftp.conf
marker: "# {mark} ANSIBLE MANAGED BLOCK - Whitelist ip for users"
@ -82,6 +82,14 @@
notify: restart proftpd
when: proftpd_sftp_enable_user_whitelist | bool
- name: IP Whitelists for SFTP users are absent
ansible.builtin.blockinfile:
dest: /etc/proftpd/conf.d/sftp.conf
marker: "# {mark} ANSIBLE MANAGED BLOCK - Whitelist ip for users"
state: absent
notify: restart proftpd
when: not (proftpd_sftp_enable_user_whitelist | bool)
- name: Allow keys for SFTP account
ansible.builtin.template:
dest: "/etc/proftpd/sftp.authorized_keys/{{ _proftpd_account.name }}"