---
# Email alias set-up
- name: Install the Python script to get the <pkg>-owner email alias
  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
  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"
        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
  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
  copy: src=syslog dest=/etc/logrotate.d/syslog owner=root group=root
  tags:
  - install
  - packager_alias
