2021-01-21 20:50:04 +01:00
|
|
|
---
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Update repo-cache for debian/ubuntu
|
2021-01-21 20:50:04 +01:00
|
|
|
become: true
|
2022-04-07 23:10:30 +02:00
|
|
|
ansible.builtin.apt:
|
2021-01-21 20:50:04 +01:00
|
|
|
update_cache: true
|
|
|
|
cache_valid_time: 3600
|
|
|
|
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Install requirements to add new package repos
|
2021-01-21 20:50:04 +01:00
|
|
|
become: true
|
2022-04-07 23:10:30 +02:00
|
|
|
ansible.builtin.apt:
|
2023-10-29 15:42:13 +01:00
|
|
|
name: "{{ item }}"
|
|
|
|
state: 'present'
|
|
|
|
loop:
|
|
|
|
- 'lsb-release'
|
|
|
|
- 'wget'
|
|
|
|
- 'debian-goodies'
|
|
|
|
- 'apt-dater-host'
|
|
|
|
- 'apt-transport-https'
|
2021-01-21 20:50:04 +01:00
|
|
|
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Add rspam repo key
|
2021-01-21 20:50:04 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.apt_key:
|
|
|
|
url: 'https://rspamd.com/apt-stable/gpg.key'
|
2023-10-29 15:42:13 +01:00
|
|
|
state: 'present'
|
|
|
|
notify: Run sudo apt update
|
2021-01-21 20:50:04 +01:00
|
|
|
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Add rspamd repo
|
2021-01-21 20:50:04 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.apt_repository:
|
|
|
|
repo: "deb https://rspamd.com/apt-stable/ {{ ansible_distribution_release }} main"
|
2023-10-29 15:42:13 +01:00
|
|
|
state: 'present'
|
|
|
|
mode: '0644'
|
|
|
|
notify: Run sudo apt update
|
2021-01-21 20:50:04 +01:00
|
|
|
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Add rspamd srv-repo
|
2021-01-21 20:50:04 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.apt_repository:
|
|
|
|
repo: "deb-src https://rspamd.com/apt-stable/ {{ ansible_distribution_release }} main"
|
2023-10-29 15:42:13 +01:00
|
|
|
state: 'present'
|
|
|
|
mode: '0644'
|
|
|
|
notify: Run sudo apt update
|
2021-01-21 20:50:04 +01:00
|
|
|
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Run update if something changed
|
2022-04-07 23:10:30 +02:00
|
|
|
ansible.builtin.meta: flush_handlers
|
2021-01-21 20:50:04 +01:00
|
|
|
|
2023-10-29 15:42:13 +01:00
|
|
|
- name: Install rspamd
|
2021-01-21 20:50:04 +01:00
|
|
|
become: true
|
2022-04-07 23:10:30 +02:00
|
|
|
ansible.builtin.apt:
|
2023-10-29 15:42:13 +01:00
|
|
|
name: 'rspamd'
|
|
|
|
state: 'present'
|
|
|
|
notify: Run systemctl restart rspamd
|