mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-20 03:57:02 +08:00
64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
---
|
|
#
|
|
# This task sets up mail aliases scripts
|
|
# It installs python packages, scripts and configure cron to run it.
|
|
#
|
|
|
|
- name: Install python packages
|
|
ansible.builtin.package:
|
|
state: present
|
|
name:
|
|
- python3-aiohttp
|
|
- python3-requests
|
|
tags:
|
|
- install
|
|
- packager_alias
|
|
|
|
# Email alias set-up
|
|
- name: Install the Python script to get the <pkg>-owner email alias
|
|
ansible.builtin.copy:
|
|
src: owner-email-from-pagure.py
|
|
dest: /usr/local/bin/owner-email.py
|
|
owner: root
|
|
group: root
|
|
mode: "0755"
|
|
tags:
|
|
- install
|
|
- packager_alias
|
|
|
|
- name: Install the script to generate the <pkg>-owner email alias
|
|
ansible.builtin.copy:
|
|
src: package-owner-aliases.sh
|
|
dest: /usr/local/bin/package-owner-aliases.sh
|
|
owner: root
|
|
group: root
|
|
mode: "0755"
|
|
tags:
|
|
- install
|
|
- packager_alias
|
|
|
|
- name: Configure cron to generate the <pkg>-owner email alias
|
|
cron: name="package-owner-aliases" minute="49" user="root" hour="*/3"
|
|
job="/usr/local/bin/lock-wrapper package-owner-aliases /usr/local/bin/package-owner-aliases.sh"
|
|
cron_file=package-owner-aliases
|
|
tags:
|
|
- install
|
|
- packager_alias
|
|
|
|
- name: Remove the old <pkg>-owner email alias script
|
|
ansible.builtin.file:
|
|
path: /etc/cron.hourly/package-owner-aliases.sh
|
|
state: absent
|
|
tags:
|
|
- packager_alias
|
|
|
|
#
|
|
# Since this host has mail aliases, it's a mail hub. Compress logs since there will be a ton of them
|
|
#
|
|
|
|
- name: Install modified logrotate syslog script to compress maillog on mailhub
|
|
ansible.builtin.copy: src=syslog dest=/etc/logrotate.d/syslog owner=root group=root
|
|
tags:
|
|
- install
|
|
- packager_alias
|