mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-09 11:20:18 +01:00
Squashed 'lemp-rhel7/roles/ansible-role-postfix/' content from commit 3abdcbc
git-subtree-dir: lemp-rhel7/roles/ansible-role-postfix git-subtree-split: 3abdcbc53d9c23202eb2451e7a0da5a83e7a2eb9
This commit is contained in:
commit
e9cb088630
7 changed files with 108 additions and 0 deletions
36
.travis.yml
Normal file
36
.travis.yml
Normal file
|
@ -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/
|
31
README.md
Normal file
31
README.md
Normal file
|
@ -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/).
|
1
defaults/main.yml
Normal file
1
defaults/main.yml
Normal file
|
@ -0,0 +1 @@
|
|||
---
|
23
meta/main.yml
Normal file
23
meta/main.yml
Normal file
|
@ -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
|
11
tasks/main.yml
Normal file
11
tasks/main.yml
Normal file
|
@ -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
|
1
tests/inventory
Normal file
1
tests/inventory
Normal file
|
@ -0,0 +1 @@
|
|||
localhost
|
5
tests/test.yml
Normal file
5
tests/test.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- ansible-role-postfix
|
Loading…
Reference in a new issue