Merge commit 'e9cb0886303f54b81592a6464dacfdc873018a97' as 'lemp-rhel7/roles/ansible-role-postfix'

pull/63/head
Ivan Grynenko 8 years ago
commit fb878613a9
  1. 36
      lemp-rhel7/roles/ansible-role-postfix/.travis.yml
  2. 31
      lemp-rhel7/roles/ansible-role-postfix/README.md
  3. 1
      lemp-rhel7/roles/ansible-role-postfix/defaults/main.yml
  4. 23
      lemp-rhel7/roles/ansible-role-postfix/meta/main.yml
  5. 11
      lemp-rhel7/roles/ansible-role-postfix/tasks/main.yml
  6. 1
      lemp-rhel7/roles/ansible-role-postfix/tests/inventory
  7. 5
      lemp-rhel7/roles/ansible-role-postfix/tests/test.yml

@ -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,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,5 @@
---
- hosts: localhost
remote_user: root
roles:
- ansible-role-postfix