From 3392556d4806cef534ac246507ed42c903a088cf Mon Sep 17 00:00:00 2001 From: Nemo Date: Sun, 2 Aug 2020 18:17:48 +0200 Subject: [PATCH] Update postfix role --- roles/postfix/README.md | 2 -- roles/postfix/tasks/main.yml | 10 ++++++++++ roles/postfix/tests/README.md | 11 ----------- roles/postfix/tests/test.yml | 15 --------------- 4 files changed, 10 insertions(+), 28 deletions(-) delete mode 100644 roles/postfix/tests/README.md delete mode 100644 roles/postfix/tests/test.yml diff --git a/roles/postfix/README.md b/roles/postfix/README.md index 8944629..39ac3e3 100644 --- a/roles/postfix/README.md +++ b/roles/postfix/README.md @@ -1,7 +1,5 @@ # Ansible Role: Postfix -[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-postfix.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-postfix) - Installs postfix on RedHat/CentOS, Gentoo or Debian/Ubuntu. ## Requirements diff --git a/roles/postfix/tasks/main.yml b/roles/postfix/tasks/main.yml index 6b5e91d..e07be3d 100644 --- a/roles/postfix/tasks/main.yml +++ b/roles/postfix/tasks/main.yml @@ -17,6 +17,16 @@ when: alias_email != "root" and 'mail_server' not in group_names notify: update aliases +- name: Update mailname file. + copy: + dest: "/etc/mailname" + content: "{{ inventory_hostname }}\n" + owner: root + group: root + mode: 0644 + when: ansible_distribution == 'Debian' and 'mail_server' not in group_names + notify: update aliases + - name: Update Postfix configuration. lineinfile: dest: "{{ postfix_config_file }}" diff --git a/roles/postfix/tests/README.md b/roles/postfix/tests/README.md deleted file mode 100644 index 6fb2117..0000000 --- a/roles/postfix/tests/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Ansible Role tests - -To run the test playbook(s) in this directory: - - 1. Install and start Docker. - 1. Download the test shim (see .travis.yml file for the URL) into `tests/test.sh`: - - `wget -O tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/` - 1. Make the test shim executable: `chmod +x tests/test.sh`. - 1. Run (from the role root directory) `distro=[distro] playbook=[playbook] ./tests/test.sh` - -If you don't want the container to be automatically deleted after the test playbook is run, add the following environment variables: `cleanup=false container_id=$(date +%s)` diff --git a/roles/postfix/tests/test.yml b/roles/postfix/tests/test.yml deleted file mode 100644 index 2505c1d..0000000 --- a/roles/postfix/tests/test.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- hosts: all - - pre_tasks: - - name: Update apt cache. - apt: update_cache=yes cache_valid_time=600 - when: ansible_os_family == 'Debian' - - - name: Override postfix_inet_protocols (RHEL). - set_fact: - postfix_inet_protocols: ipv4 - when: ansible_os_family == 'RedHat' - - roles: - - role_under_test