From 60802cb191bd052a7b9e08e671fc21920ed8ef81 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 21 Jan 2021 20:50:04 +0100 Subject: [PATCH] Add rspamd repo and install it --- handlers/main.yml | 5 +++++ tasks/main.yml | 4 ++++ tasks/packages.yml | 49 ++++++++++++++++++++++++++++++++++++++++++++++ vars/main.yml | 2 +- 4 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 handlers/main.yml create mode 100644 tasks/packages.yml diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..09e2126 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: sudo apt update + become: true + apt: + update_cache: true diff --git a/tasks/main.yml b/tasks/main.yml index b37444c..f4aeb63 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,3 +1,7 @@ --- - include_tasks: versioncheck.yml when: submodules_versioncheck|bool + +- name: add apt repos and install rspamd + include_tasks: packages.yml + when: ansible_os_family == 'Debian' diff --git a/tasks/packages.yml b/tasks/packages.yml new file mode 100644 index 0000000..43564dd --- /dev/null +++ b/tasks/packages.yml @@ -0,0 +1,49 @@ +--- +- name: update repo-cache for debian/ubuntu + become: true + apt: + update_cache: true + cache_valid_time: 3600 + +- name: install requirements to add new package repos + become: true + apt: + name: + - lsb-release + - wget + - debian-goodies + - apt-dater-host + - apt-transport-https + state: present + +- name: add rspam repo key + become: true + ansible.builtin.apt_key: + url: 'https://rspamd.com/apt-stable/gpg.key' + state: present + notify: sudo apt update + +- name: add rspamd repo + become: true + ansible.builtin.apt_repository: + repo: "deb https://rspamd.com/apt-stable/ {{ ansible_distribution_release }} main" + state: present + mode: 0644 + notify: 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 + mode: 0644 + notify: sudo apt update + +- name: run update if something changed + meta: flush_handlers + +- name: install rspamd + become: true + apt: + name: rspamd + state: present diff --git a/vars/main.yml b/vars/main.yml index bf4b0d9..f45db43 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,4 +1,4 @@ --- # versionscheck playbook_version_number: 02 # should be a integer -playbook_version_path: 'role-.version' +playbook_version_path: 'do1jlr.rspamd.version'