Skip to content
Snippets Groups Projects
Commit 18e2172e authored by jurgenhaas's avatar jurgenhaas
Browse files

customer/bitegra/portal/support#2 Initial commit

parents
No related branches found
No related tags found
No related merge requests found
---
# file: roles/suitecrm/handlers/main.yml
- name: Re-create the suitecrm containers
docker_service:
project_src: /mnt/{{ item.id }}
recreate: always
with_items: '{{ suitecrm_settings }}'
---
dependencies:
- role: docker
---
# file: roles/suitecrm/tasks/main.yml
- name: SuiteCRM Role
set_fact:
role_suitecrm_started: yes
tags:
- always
- block:
- name: Import suitecrm
import_tasks: suitecrm.yml
- name: Remember that this role had been run
set_fact:
role_suitecrm_completed: yes
tags:
- always
when: (not excluded_roles or "suitecrm" not in excluded_roles) and role_suitecrm_completed is not defined
---
# file: roles/suitecrm/tasks/suitecrm.yml
- name: Pull docker image
docker_image:
name: bitnami/suitecrm
source: pull
force_source: yes
notify:
- Re-create the suitecrm containers
- name: Create directories
file:
path: /mnt/{{ item.0.id }}/{{ item.1 }}
state: directory
mode: 0775
with_nested:
- '{{ suitecrm_settings }}'
- ['app', 'db']
- name: Copy docker compose files
template:
src: docker-compose.yml
dest: /mnt/{{ item.id }}/docker-compose.yml
with_items: '{{ suitecrm_settings }}'
notify:
- Re-create the suitecrm containers
- name: Create apache config
template:
src: vhost.conf
dest: /etc/apache/sites-available/{{ item.id }}.conf
with_items: '{{ suitecrm_settings }}'
version: '2'
services:
mariadb:
image: 'bitnami/mariadb:latest'
environment:
- MARIADB_USER=bn_suitecrm
- MARIADB_DATABASE=bitnami_suitecrm
- ALLOW_EMPTY_PASSWORD=yes
volumes:
- '/mnt/{{ item.id }}/db:/bitnami'
restart: always
application:
image: 'bitnami/suitecrm:latest'
environment:
- MARIADB_HOST=mariadb
- MARIADB_PORT_NUMBER=3306
- SUITECRM_DATABASE_USER=bn_suitecrm
- SUITECRM_DATABASE_NAME=bitnami_suitecrm
- ALLOW_EMPTY_PASSWORD=yes
- SUITECRM_SMTP_HOST={{ item.smtp.host }}
- SUITECRM_SMTP_PORT={{ item.smtp.port }}
- SUITECRM_SMTP_USER={{ item.smtp.user }}
- SUITECRM_SMTP_PASSWORD={{ item.smtp.password }}
- SUITECRM_SMTP_PROTOCOL={{ item.smtp.protocol }}
volumes:
- '/mnt/{{ item.id }}/app:/bitnami'
restart: always
depends_on:
- mariadb
ports:
- '{{ item.port }}:80'
<VirtualHost *:80>
Include /etc/apache2/conf-available/global-redirect.conf
ServerName {{ item.domain }}
Include /etc/apache2/conf-available/redirect-ssl.conf
Include /etc/apache2/conf-available/letsencrypt-redirect.conf
</VirtualHost>
<VirtualHost *:443>
Include /etc/apache2/conf-available/global-redirect.conf
ServerName {{ item.domain }}
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/{{ item.domain }}/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/{{ item.domain }}/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/{{ item.domain }}/chain.pem
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256$
SSLProtocol All -SSLv2 -SSLv3
SSLCompression off
SSLHonorCipherOrder on
SetEnvIf Host "^(.*)$" THE_HOST=$1
RequestHeader setifempty X-Forwarded-Proto https
RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e
ProxyAddHeaders Off
ProxyPassMatch (.*)(\/websocket)$ "ws://127.0.0.1:{{ item.port }}/$1$2"
ProxyPass / "http://127.0.0.1:{{ item.port }}/"
ProxyPassReverse / "http://127.0.0.1:{{ item.port }}/"
</VirtualHost>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment