git-subtree-dir: lemp-rhel7/roles/ansible-role-postfix git-subtree-split: 3abdcbc53d9c23202eb2451e7a0da5a83e7a2eb9pull/63/head
commit
e9cb088630
@ -0,0 +1,36 @@ |
|||||||
|
--- |
||||||
|
sudo: required |
||||||
|
language: python |
||||||
|
python: "2.7" |
||||||
|
|
||||||
|
env: |
||||||
|
- SITE=test.yml |
||||||
|
|
||||||
|
before_install: |
||||||
|
- sudo apt-get update -qq |
||||||
|
|
||||||
|
install: |
||||||
|
# Install Ansible. |
||||||
|
- pip install ansible |
||||||
|
|
||||||
|
# Add ansible.cfg to pick up roles path. |
||||||
|
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg" |
||||||
|
|
||||||
|
script: |
||||||
|
# Check the role/playbook's syntax. |
||||||
|
- "ansible-playbook -i tests/inventory tests/$SITE --syntax-check" |
||||||
|
|
||||||
|
# Run the role/playbook with ansible-playbook. |
||||||
|
- "ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo" |
||||||
|
|
||||||
|
# Run the role/playbook again, checking to make sure it's idempotent. |
||||||
|
- > |
||||||
|
ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo |
||||||
|
| grep -q 'changed=0.*failed=0' |
||||||
|
&& (echo 'Idempotence test: pass' && exit 0) |
||||||
|
|| (echo 'Idempotence test: fail' && exit 1) |
||||||
|
|
||||||
|
# TODO - Add test to check if postfix is working correctly. |
||||||
|
|
||||||
|
notifications: |
||||||
|
webhooks: https://galaxy.ansible.com/api/v1/notifications/ |
@ -0,0 +1,31 @@ |
|||||||
|
# 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 or Debian/Ubuntu. |
||||||
|
|
||||||
|
## Requirements |
||||||
|
|
||||||
|
If you're using this as an SMTP relay server, you will need to do that on your own, and open TCP port 25 in your server firewall. |
||||||
|
|
||||||
|
## Role Variables |
||||||
|
|
||||||
|
None. |
||||||
|
|
||||||
|
## Dependencies |
||||||
|
|
||||||
|
None. |
||||||
|
|
||||||
|
## Example Playbook |
||||||
|
|
||||||
|
- hosts: all |
||||||
|
roles: |
||||||
|
- { role: geerlingguy.postfix } |
||||||
|
|
||||||
|
## License |
||||||
|
|
||||||
|
MIT / BSD |
||||||
|
|
||||||
|
## Author Information |
||||||
|
|
||||||
|
This role was created in 2014 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/). |
@ -0,0 +1 @@ |
|||||||
|
--- |
@ -0,0 +1,23 @@ |
|||||||
|
--- |
||||||
|
dependencies: [] |
||||||
|
|
||||||
|
galaxy_info: |
||||||
|
author: geerlingguy |
||||||
|
description: Postfix for RedHat/CentOS or Debian/Ubuntu. |
||||||
|
company: "Midwestern Mac, LLC" |
||||||
|
license: "license (BSD, MIT)" |
||||||
|
min_ansible_version: 1.8 |
||||||
|
platforms: |
||||||
|
- name: EL |
||||||
|
versions: |
||||||
|
- all |
||||||
|
- name: Debian |
||||||
|
versions: |
||||||
|
- all |
||||||
|
- name: Ubuntu |
||||||
|
versions: |
||||||
|
- all |
||||||
|
galaxy_tags: |
||||||
|
- networking |
||||||
|
- system |
||||||
|
- mail |
@ -0,0 +1,11 @@ |
|||||||
|
--- |
||||||
|
- name: Ensure postfix is installed (RedHat). |
||||||
|
yum: name=postfix state=installed |
||||||
|
when: ansible_os_family == 'RedHat' |
||||||
|
|
||||||
|
- name: Ensure postfix is installed (Debian). |
||||||
|
apt: name=postfix state=installed |
||||||
|
when: ansible_os_family == 'Debian' |
||||||
|
|
||||||
|
- name: Ensure postfix is started and enabled at boot. |
||||||
|
service: name=postfix state=started enabled=yes |
@ -0,0 +1 @@ |
|||||||
|
localhost |
@ -0,0 +1,5 @@ |
|||||||
|
--- |
||||||
|
- hosts: localhost |
||||||
|
remote_user: root |
||||||
|
roles: |
||||||
|
- ansible-role-postfix |
Reference in new issue