1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_rspamd.git synced 2024-08-16 17:09:51 +02:00
ansible_role_rspamd/tasks/packages.yml

60 lines
1.5 KiB
YAML
Raw Permalink Normal View History

2021-01-21 20:50:04 +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
- 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:
name: "{{ item }}"
2023-10-29 15:42:13 +01:00
state: 'present'
loop:
- 'lsb-release'
- 'wget'
- 'debian-goodies'
- 'apt-dater-host'
2023-10-29 15:42:13 +01:00
- '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'
state: 'present'
notify: Run sudo apt update
2021-01-21 20:50:04 +01:00
2023-10-29 23:42:22 +01:00
- name: Download /etc/apt/keyrings/rspamd.gpg
become: true
2023-10-30 01:58:00 +01:00
ansible.builtin.apt_key:
url: 'https://rspamd.com/apt-stable/gpg.key'
keyring: '/etc/apt/keyrings/rspamd.gpg'
state: 'present'
notify: Run sudo apt update
2023-10-29 23:42:22 +01:00
- name: Add rspamd repo
2021-01-21 20:50:04 +01:00
become: true
ansible.builtin.apt_repository:
2023-10-29 23:42:22 +01:00
repo: "deb [signed-by=/etc/apt/keyrings/rspamd.gpg] https://rspamd.com/apt-stable/ {{ ansible_distribution_release }} main"
2021-01-21 20:50:04 +01:00
state: present
2023-10-29 15:42:13 +01:00
mode: '0644'
notify: Run sudo apt update
2021-01-21 20:50:04 +01:00
- name: Add rspamd srv-repo
2021-01-21 20:50:04 +01:00
become: true
ansible.builtin.apt_repository:
2023-10-29 23:42:22 +01:00
repo: "deb-src [signed-by=/etc/apt/keyrings/rspamd.gpg] https://rspamd.com/apt-stable/ {{ ansible_distribution_release }} main"
2021-01-21 20:50:04 +01:00
state: present
2023-10-29 15:42:13 +01:00
mode: '0644'
notify: Run sudo apt update
2021-01-21 20:50:04 +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
- 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'
2023-10-29 23:54:39 +01:00
notify: 'Run systemctl restart rspamd'