Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mautic Support #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Installation
* You should now have your working
* Symfony2 Standard Edition under http://192.168.50.4:8081/
* Laravel Quickstart example app under http://192.168.50.4:8082/
* Mautic installation under http://192.168.50.4:8083/

The installation process will create a folder symfony-standard inside
the main directory of the repository. You can now start working inside
Expand Down
7 changes: 7 additions & 0 deletions playbooks/roles/mautic/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
dependencies:
- { role: base }
- { role: mysql }
- { role: php-fpm }
- { role: php-devtools }
- { role: nginx }
50 changes: 50 additions & 0 deletions playbooks/roles/mautic/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
- name: Install required php packages for mautic
apt: name={{ item }} state=present
with_items:
- php{{ php_version }}-zip
- php{{ php_version }}-xml
- php{{ php_version }}-imap
- php{{ php_version }}-curl
- php{{ php_version }}-bcmath
- php-mailparse

- name: Create MySQL database for mautic
mysql_db: name=mautic state=present

- name: Create MySQL user for mautic
mysql_user: name=mautic password=mautic priv=*.*:ALL state=present

- name: Clone mautic
git: repo=https://github.com/mautic/mautic.git
dest=/vagrant/mautic
update=no
become: true
become_user: "{{ www_user }}"

- name: Install Mautic project dependencies
shell: cd /vagrant/mautic && COMPOSER_PROCESS_TIMEOUT={{composer_process_timeout}} composer install
become: true
become_user: "{{ www_user }}"

- name: Copy across new php-fpm pool config for mautic
template:
src=php-fpm.conf.j2
dest=/etc/php/{{ php_version }}/fpm/pool.d/mautic.conf
notify:
- restart php-fpm

- name: Copy across new virtual host for mautic
template:
src=nginx.conf.j2
dest=/etc/nginx/sites-available/mautic.conf
notify:
- restart nginx

- name: Enable new vagrant virtual host for mautic
file:
src=/etc/nginx/sites-available/mautic.conf
dest=/etc/nginx/sites-enabled/mautic.conf
state=link
notify:
- restart nginx
28 changes: 28 additions & 0 deletions playbooks/roles/mautic/templates/nginx.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
server {
listen 8083 default_server;
listen [::]:8080 default_server ipv6only=on;

server_name 192.168.50.4;
root {{ document_root }}/mautic;

location / {
# try to serve file directly, fallback to app.php
try_files $uri /index.php$is_args$args;
}

location ~ ^/index\.php(/|$) {
fastcgi_pass unix:/var/run/php5-mautic.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
# Prevents URIs that include the front controller. This will 404:
# http://domain.tld/app.php/some-path
# Remove the internal directive to allow URIs like this
# internal;
}

error_log /var/log/nginx/mautic_error.log;
access_log /var/log/nginx/mautic_access.log;
}
Loading