Add role variables to meta content itself for more flexibility.

Migrate email server setup to use supervisor template and dev environment flag.
This commit is contained in:
Dorian 2015-03-09 16:02:32 -04:00
parent acd8ed563c
commit 950bd84b87
7 changed files with 33 additions and 23 deletions

View File

@ -1,8 +0,0 @@
; Mailsink configuration
[program:mailsink]
command=/srv/www/virtualenvs/mail_server/bin/mailsinkd -w 8025 -s 25
stopsignal=TERM
stdout_logfile = /srv/www/logs/supervisor/mailsink-application.log
stdout_logfile_backups = 5
stderr_logfile=/srv/www/logs/supervisor/mailsink-error.log
stderr_logfile_backups=5

View File

@ -1,13 +0,0 @@
---
- hosts: all
sudo: yes
vars:
web_server_home: /srv/www
email_server_venv: "{{ web_server_home }}/virtualenvs/mail_server"
tasks:
- name: install mailsink test server into target virtualenv
pip: name=mailsink virtualenv={{ email_server_venv }} version=0.0.2
- name: restart up the mailsink program
supervisorctl: name=mailsink state=restarted config=/etc/supervisor/supervisor.conf

View File

@ -122,7 +122,7 @@ galaxy_info:
- web - web
dependencies: dependencies:
- { role: dorianpula.nginx-uwsgi-supervisor, - { role: dorianpula.nginx-uwsgi-supervisor,
app_name: rookeries, app_name: "{{ rookeries_app_name }}",
app_nginx_hostname: localhost, app_nginx_hostname: localhost,
app_uwsgi_port: 8001, app_uwsgi_port: 8001,
app_uwsgi_executable: "rookeries:make_rookeries_app()" } app_uwsgi_executable: "rookeries:make_rookeries_app()" }

View File

@ -0,0 +1,14 @@
---
# Sets up and runs a SMTP email sink to assist with development.
- name: install mailsink test server into target virtualenv
pip: name=mailsink virtualenv={{ rookeries_dev_email_server_venv }} version=0.0.2
when: rookeries_environ_type == "dev"
- name: upload supervisor configuration to web server home
template: src=dev_supervisor/mailsink_supervisor.conf dest=/etc/supervisor/conf.d/mailsink_supervisor.conf
sudo: yes
when: rookeries_environ_type == "dev"
- name: restart up the mailsink program
supervisorctl: name=mailsink state=restarted config=/etc/supervisor/supervisor.conf
when: rookeries_environ_type == "dev"

View File

@ -1,3 +1,4 @@
--- ---
- include: mysql_db.yaml - include: mysql_db.yaml
- include: nodejs.yaml - include: nodejs.yaml
- include: dev_email_server.yaml

View File

@ -0,0 +1,8 @@
; Mailsink configuration
[program:mailsink]
command= {{ rookeries_dev_email_server_venv }}/bin/mailsinkd -w 8025 -s 25
stopsignal=TERM
stdout_logfile = {{ web_root_path }}/logs/supervisor/mailsink-application.log
stdout_logfile_backups = 5
stderr_logfile={{ web_root_path }}/logs/supervisor/mailsink-error.log
stderr_logfile_backups=5

View File

@ -1,6 +1,14 @@
--- ---
# vars file for ansible-rookeries # TODO Move into defaults/main.yaml
databases: databases:
rookeries: rookeries:
username: rookeries username: rookeries
password: system_admin password: system_admin
# TODO Move into defaults/main.yaml
rookeries_app_name: rookeries
# The mode of the setup. Setting to "dev" enables the use of a SMTP fake server to help with development.
# TODO Move into defaults/main.yaml
rookeries_environ_type: dev
rookeries_dev_email_server_venv: "{{ virtualenv_root_path }}/mail_server"