From 9e547eb7dc62849658f4be1f5d2dcaddb3350733 Mon Sep 17 00:00:00 2001 From: Jack-Benny Persson Date: Tue, 15 Mar 2022 03:20:34 +0100 Subject: [PATCH] Tweaked the role a bit --- README.md | 4 ++-- meta/main.yml | 38 ++++++++++++++++++++++++++++++++++++-- tasks/main.yml | 6 ++++++ 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f454b05..412882b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Ansible Postfix role This role is an easy way of configuring outgoing mail for local users. It's -intended to be used by local users only, for example, to receive mail from -cronjobs. +intended to be used by local users only, for example, to send mail from +cronjobs to an external address. An aliases file is set up along with Postfix, where all email is forwarded to the current Ansible user. Those emails are then forwarded to an external email diff --git a/meta/main.yml b/meta/main.yml index 79dda0f..06078fa 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,2 +1,36 @@ -dependencies: - - role: update_cache +dependencies: [] + +galaxy_info: + role_name: postfix + author: jackbenny + description: Setup Postfix so local users can send external mail + company: "CyberInfo Sverige" + license: "license GPLv2" + min_ansible_version: 2.9 + platforms: + - name: Debian + versions: + - stretch + - buster + - bullseye + - name: Ubuntu + versions: + - xenial + - bionic + - focal + - impish + - name: CentOS + versions: + - 9 + - name: Fedora + version: + - 30 + - 31 + - 32 + - 33 + - 34 + - 35 + - 36 + galaxy_tags: + - postfix + - system diff --git a/tasks/main.yml b/tasks/main.yml index bea5e6b..e7887f8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -16,6 +16,12 @@ mail will be forwarded to this address" success_msg: "Recipient address is set" +- name: Update the cache if we are on a Debian based system + apt: + update_cache: yes + cache_valid_time: 3600 + when: ansible_os_family == 'Debian' + - name: Install Postfix and s-nail package: state: present