postfix: split packmail.yml, create packmail-spam.yml to be called separately for update
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2611|15|2596|16|:+1: Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/307//ansiblelint">Evolix » ansible-roles » unstable #307</a>
gitea/ansible-roles/pipeline/head This commit looks good

This commit is contained in:
William Hirigoyen 2023-07-26 09:37:45 +02:00
parent 3c3db4fefa
commit 5bd6893dac
2 changed files with 40 additions and 38 deletions

View file

@ -0,0 +1,39 @@
---
- name: "mount /usr in rw"
ansible.builtin.command:
cmd: 'mount -o remount,rw /usr'
changed_when: False
tags: postfix
- name: copy spam.sh script
ansible.builtin.copy:
src: spam.sh
dest: /usr/share/scripts/spam.sh
mode: "0700"
tags: postfix
- name: Check if cron is installed
ansible.builtin.shell:
cmd: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
executable: /bin/bash
check_mode: no
failed_when: False
changed_when: False
register: is_cron_installed
tags: postfix
- name: enable spam.sh cron
ansible.builtin.lineinfile:
dest: /etc/cron.d/spam
line: "42 * * * * root /usr/share/scripts/spam.sh"
create: yes
state: present
mode: "0640"
when: is_cron_installed.rc == 0
tags: postfix
- name: update antispam list
ansible.builtin.command:
cmd: /usr/share/scripts/spam.sh
changed_when: False
tags: postfix

View file

@ -99,42 +99,5 @@
tags:
- postfix
- ansible.builtin.include_role:
name: evolix/remount-usr
tags:
- postfix
- ansible.builtin.include: packmail-spam.yml
- name: copy spam.sh script
ansible.builtin.copy:
src: spam.sh
dest: /usr/share/scripts/spam.sh
mode: "0700"
tags:
- postfix
- name: Check if cron is installed
ansible.builtin.shell:
cmd: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
executable: /bin/bash
check_mode: no
failed_when: False
changed_when: False
register: is_cron_installed
- name: enable spam.sh cron
ansible.builtin.lineinfile:
dest: /etc/cron.d/spam
line: "42 * * * * root /usr/share/scripts/spam.sh"
create: yes
state: present
mode: "0640"
when: is_cron_installed.rc == 0
tags:
- postfix
- name: update antispam list
ansible.builtin.command:
cmd: /usr/share/scripts/spam.sh
changed_when: False
tags:
- postfix