diff --git a/tasks/main.yml b/tasks/main.yml index 7182711..89ee405 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,11 +13,12 @@ ansible.builtin.include_tasks: file: 'configure.yml' -- name: Rspamd dkim signing +- name: Rspamd dkim signing (TODO) ansible.builtin.include_tasks: file: 'dkim.yml' when: rspamd__configure_dkim | bool + - name: Redis backend ansible.builtin.include_tasks: file: 'redis.yml' diff --git a/tasks/packages.yml b/tasks/packages.yml index eef626c..c7c5ec9 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -24,19 +24,28 @@ state: 'present' notify: Run sudo apt update +- name: Download /etc/apt/keyrings/rspamd.gpg + become: true + ansible.builtin.get_url: + url: '//rspamd.com/apt-stable/gpg.key' + dest: '/etc/apt/keyrings/rspamd.gpg' + mode: '0644' + owner: 'root' + group: 'root' + - name: Add rspamd repo become: true ansible.builtin.apt_repository: - repo: "deb https://rspamd.com/apt-stable/ {{ ansible_distribution_release }} main" - state: 'present' + repo: "deb [signed-by=/etc/apt/keyrings/rspamd.gpg] https://rspamd.com/apt-stable/ {{ ansible_distribution_release }} main" + state: present mode: '0644' notify: Run sudo apt update - name: Add rspamd srv-repo become: true ansible.builtin.apt_repository: - repo: "deb-src https://rspamd.com/apt-stable/ {{ ansible_distribution_release }} main" - state: 'present' + repo: "deb-src [signed-by=/etc/apt/keyrings/rspamd.gpg] https://rspamd.com/apt-stable/ {{ ansible_distribution_release }} main" + state: present mode: '0644' notify: Run sudo apt update @@ -48,4 +57,4 @@ ansible.builtin.apt: name: 'rspamd' state: 'present' - notify: Run systemctl restart rspamd + notify: 'Run systemctl restart rspamd' diff --git a/tasks/redis.yml b/tasks/redis.yml index 94a5ebb..80bcab4 100644 --- a/tasks/redis.yml +++ b/tasks/redis.yml @@ -1,4 +1,11 @@ --- +- name: Update apt cache + become: true + ansible.builtin.apt: + update_cache: true + when: + - ansible_pkg_mgr == "apt" + - name: Install redis backend become: true ansible.builtin.apt: diff --git a/vars/main.yml b/vars/main.yml index a48eae8..fd14881 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,6 +1,6 @@ --- # versionscheck -playbook_version_number: 9 # should be a integer +playbook_version_number: 11 playbook_version_path: 'do1jlr.rspamd.version' # https://github.com/ansible/ansible/issues/36129