Add mailcatcher handling

This commit is contained in:
Benoît Burnichon
2015-11-27 14:44:55 +01:00
parent f1dccd0632
commit 43997f9372
6 changed files with 49 additions and 11 deletions

View File

@@ -12,5 +12,5 @@
- php - php
- xdebug - xdebug
- composer - composer
- app
- mailcatcher - mailcatcher
- app

View File

@@ -1,2 +1,8 @@
--- ---
mailcatcher_gem: mailcatcher mailcatcher_gem: mailcatcher
mailcatcher_user: mailcatcher
mailcatcher_smtp_ip: '0.0.0.0'
mailcatcher_smtp_port: '1025'
mailcatcher_http_ip: '0.0.0.0'
mailcatcher_http_port: '1080'
mailcatcher_log_path: '/var/log/mailcatcher'

View File

@@ -0,0 +1,3 @@
---
- name: restart mailcatcher
supervisorctl: name=mailcatcher state=restarted

View File

@@ -0,0 +1,14 @@
---
- name: Create mailcatcher user
user: name={{ mailcatcher_user }} comment='Mailcatcher Mock Smtp Service User' home='/var/spool/mailcatcher' shell='/bin/true'
- name: Create mailcatcher log directory
file: path={{ mailcatcher_log_path }} owner=mailcatcher mode=0755 state=directory
- name: Install Mailcatcher
gem: name={{ mailcatcher_gem }} user_install=no state=latest
notify: restart mailcatcher
- name: Install mailcatcher supervisord conf
template: src='program_mailcatcher.conf.j2' dest='/etc/supervisor/conf.d/program_mailcatcher.conf'
notify: restart mailcatcher

View File

@@ -0,0 +1,9 @@
[program:mailcatcher]
command=/usr/local/bin/mailcatcher --http-ip {{ mailcatcher_http_ip }} --http-port {{ mailcatcher_http_port }} --smtp-ip {{ mailcatcher_smtp_ip }} --smtp-port {{ mailcatcher_smtp_port }} -f
priority=100
autostart=true
autorestart=true
user={{ mailcatcher_user }}
stdout_logfile={{ mailcatcher_log_path }}/program_mailcatcher.log
stderr_logfile={{ mailcatcher_log_path }}/program_mailcatcher.error
environment=PATH='/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin'

View File

@@ -2,16 +2,19 @@
server: server:
install: '1' install: '1'
packages: packages:
- vim - vim
- git - git
- imagemagick - imagemagick
- htop - htop
- nodejs - nodejs
- npm - npm
- iotop - iotop
- pkg-config - pkg-config
- libzmq3-dev - libzmq3-dev
- supervisor - supervisor
- ruby-dev
- sqlite3
- libsqlite3-dev
timezone: UTC timezone: UTC
locales: locales:
- en_GB.UTF-8 - en_GB.UTF-8
@@ -51,3 +54,6 @@ xdebug:
composer: composer:
install: '1' install: '1'
mailcatcher:
install: '1'