From 9f4c612a690c5b88876e79d07915a28fe17afd67 Mon Sep 17 00:00:00 2001 From: L3D Date: Mon, 30 Oct 2023 01:58:00 +0100 Subject: [PATCH] Improve rspamd stuff --- .github/workflows/ansible-linting-check.yml | 1 + README.md | 19 +++---------------- requirements.txt | 1 + tasks/packages.yml | 11 +++++------ vars/main.yml | 2 +- 5 files changed, 11 insertions(+), 23 deletions(-) create mode 100644 requirements.txt diff --git a/.github/workflows/ansible-linting-check.yml b/.github/workflows/ansible-linting-check.yml index 1a76d38..9f13b8c 100644 --- a/.github/workflows/ansible-linting-check.yml +++ b/.github/workflows/ansible-linting-check.yml @@ -20,3 +20,4 @@ jobs: uses: ansible-actions/ansible-lint-action@v1.0.2 with: target: "./" + python_dependency_file: 'requirements.txt' diff --git a/README.md b/README.md index 95d31aa..5511f6e 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,5 @@ -# ansible_role_template -Template for Ansible roles +# ansible_role_rspamd - Testing ----------- -This role is tested with [these github-action](https://github.com/search?q=topic%3Acheck-ansible+topic%3Agithub-actions+org%3Aroles-ansible&type=Repositories) tests for different versions of differen linux systems. Linting is tested via travis-ci and the [ansible-lint action](https://github.com/marketplace/actions/ansible-lint). -If you want to find out more about our tests, please have a look at the github marketplace. +Use at your own risk. Sorry for not having a proper docs. -| test status | Github Marketplace | -| :--------- | :---------------- | -| [![Ansible Lint check](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20Lint%20check/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+Lint+check%22) | [ansible-lint action](https://github.com/marketplace/actions/ansible-lint) | -| ![Yamllint GitHub Actions](https://github.com/roles-ansible/ansible_role_template/workflows/Yamllint%20GitHub%20Actions/badge.svg) | [yamllint gitHub actions](https://github.com/marketplace/actions/yamllint-github-action) | -| | | -| [![Ansible check debian:stable](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20debian:stable/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+debian%3Astable%22) | [ansible test with debian stable](https://github.com/marketplace/actions/check-ansible-debian-stable) | -| [![Ansible check debian:latest](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20debian:latest/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+debian%3Alatest%22) | [ansible test with debian latest](https://github.com/marketplace/actions/check-ansible-debian-latest) | -| [![Ansible check debian:sid](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20debian:sid/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+debian%3Asid%22) | [ansible test with debian sid](https://github.com/marketplace/actions/check-ansible-debian-sid) | -| [![Ansible check debian:buster](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20debian:buster/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+debian%3Abuster%22) | [ansible test with debian buster](https://github.com/marketplace/actions/check-ansible-debian-buster) | -| [![Ansible check debian:stretch](https://github.com/roles-ansible/ansible_role_template/workflows/Ansible%20check%20debian:stretch/badge.svg)](https://github.com/roles-ansible/ansible_role_template/actions?query=workflow%3A%22Ansible+check+debian%3Astretch%22) | [ansible test with debian stretch](https://github.com/marketplace/actions/check-ansible-debian-stretch) | +THis role will be deprecated soon™ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0fb8d70 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +passlib[bcrypt]>=1.7.4 diff --git a/tasks/packages.yml b/tasks/packages.yml index c7c5ec9..d1ea850 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -26,12 +26,11 @@ - 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' + 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 - name: Add rspamd repo become: true diff --git a/vars/main.yml b/vars/main.yml index fd14881..6a9f721 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -5,4 +5,4 @@ playbook_version_path: 'do1jlr.rspamd.version' # https://github.com/ansible/ansible/issues/36129 # yamllint disable-line rule:line-length -rspamd__admin_password_with_salt: "{{ rspamd__admin_password | password_hash('bcrypt', ('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' | shuffle(seed=inventory_hostname) | join)[:21] + ('Oeu' | shuffle(seed=inventory_hostname) | join)[1], rounds=9) }}" +rspamd__admin_password_with_salt: "{{ rspamd__admin_password | ansible.builtin.password_hash('bcrypt', ('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' | shuffle(seed=inventory_hostname) | join)[:21] + ('Oeu' | ansible.builtin.shuffle(seed=inventory_hostname) | join)[1], rounds=9) }}"