mirror of
https://github.com/roles-ansible/ansible_role_rspamd.git
synced 2024-08-16 17:09:51 +02:00
60 lines
1.5 KiB
YAML
60 lines
1.5 KiB
YAML
---
|
|
- name: Update repo-cache for debian/ubuntu
|
|
become: true
|
|
ansible.builtin.apt:
|
|
update_cache: true
|
|
cache_valid_time: 3600
|
|
|
|
- name: Install requirements to add new package repos
|
|
become: true
|
|
ansible.builtin.apt:
|
|
name: "{{ item }}"
|
|
state: 'present'
|
|
loop:
|
|
- 'lsb-release'
|
|
- 'wget'
|
|
- 'debian-goodies'
|
|
- 'apt-dater-host'
|
|
- 'apt-transport-https'
|
|
|
|
- name: Add rspam repo key
|
|
become: true
|
|
ansible.builtin.apt_key:
|
|
url: 'https://rspamd.com/apt-stable/gpg.key'
|
|
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 [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 [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: Run update if something changed
|
|
ansible.builtin.meta: flush_handlers
|
|
|
|
- name: Install rspamd
|
|
become: true
|
|
ansible.builtin.apt:
|
|
name: 'rspamd'
|
|
state: 'present'
|
|
notify: 'Run systemctl restart rspamd'
|