Skip to content

Commit 770ade3

Browse files
author
lucascbeyeler
committed
Rewriting playbook for multiserver purpose
1 parent e82a889 commit 770ade3

File tree

19 files changed

+1132
-109
lines changed

19 files changed

+1132
-109
lines changed

.travis.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
language: python
3+
python: "2.7"
4+
5+
# Use the new container infrastructure
6+
sudo: true
7+
8+
# This playbook need to run on Ubuntu 14.04 or later
9+
dist: trust
10+
11+
# Install ansible
12+
addons:
13+
apt:
14+
packages:
15+
- python-pip
16+
17+
install:
18+
# Install ansible
19+
- pip install ansible
20+
21+
# Check ansible version
22+
- ansible --version
23+
24+
# Create ansible.cfg with correct roles_path
25+
- printf '[defaults]\nroles_path=../' >ansible.cfg
26+
27+
# Install ansible-commons
28+
- ansible-galaxy install lucascbeyeler.baseline
29+
30+
script:
31+
# Basic role syntax check
32+
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
33+
34+
notifications:
35+
webhooks: https://galaxy.ansible.com/api/v1/notifications/

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Ansible-Zimbra
2+
=========
3+
4+
Ansible role to install and configure Zimbra Collaboration Open Source Edition in a monoserver environment
5+
6+
[![Build Status](https://travis-ci.org/lucascbeyeler/ansible-zimbra.svg?branch=master)](https://travis-ci.org/lucascbeyeler/ansible-zimbra)
7+
[![Zimbra Version](https://img.shields.io/badge/Zimbra-8.7.11-blue.svg)](https://www.zimbra.com/downloads/zimbra-collaboration-open-source/)
8+
9+
Requirements
10+
------------
11+
12+
* [Ansible](https://github.com/ansible/ansible) 2.2.0 or superior. Less than this and you will have problems running Zimbra's Playbook. See ansible-modules-core Bug #4202
13+
14+
* Configure de file /etc/ansible/ansible.cfg (create if don't exist) and set this options - not required if you using key and the ssh user is "root" already:
15+
```
16+
[defaults]
17+
host_key_checking=False
18+
stdout_callback=skippy
19+
20+
[ssh_connection]
21+
pipelining=True
22+
```
23+
24+
Install
25+
--------------
26+
ansible-zimbra is already in Ansible Galaxy, so the only thing you need to install this script in your machine is just use ansible-galaxy command:
27+
28+
```
29+
ansible-galaxy install lucascbeyeler.ansible-zimbra
30+
```
31+
32+
Update
33+
--------------
34+
When a new version of ansible-zimbra is released, you will need to run the install process again, but with the "-f" or "--force" parameter.
35+
36+
```
37+
ansible-galaxy install -f lucascbeyeler.ansible-zimbra
38+
```
39+
40+
Features
41+
--------------
42+
43+
* Configuring SpamAssassin, Pyzor and Razor;
44+
* Configure a logo for your server - **WARNING**: [Read this article for more details about the logo](https://blog.zimbra.com/2015/09/change-login-app-logo-open-source-network-edition/);
45+
* Enable PolicyD service and web admin;
46+
* Proxy Admin;
47+
* HTTP to HTTPS redirect;
48+
* LMTP Host Lookup in Native mode;
49+
* Chat and ownCloud plugin;
50+
51+
52+
Role Variables
53+
--------------
54+
55+
* **hostname:** set the hostname of your server **WITHOUT** the domain;
56+
* **domain:** set the domain for the server and the primary domain for your Zimbra server;
57+
* **zmpasswd:** set the password used for every single service in your Zimbra server, like the admin account and the LDAPServer - **WARNING:** do not put special characters in the password during the install;
58+
* **zmnetwork:** set the network the Zimbra server is;
59+
* **zmlogologin:** Inform the path for your logo (Login Screen) - don't inform and no image will be applied;
60+
* **zmlogoapp:** Inform the path for your logo (Application Screen) - don't inform and no image will be applied;
61+
* **timezone:** inform the timezone the playbook should set in your server;
62+
63+
Dependencies
64+
------------
65+
66+
To run this playbook, you will need to run [lucascbeyeler.commons](https://github.com/lucascbeyeler/ansible-commons) too. We do not cover any kind of server preparation, like upgrade the system or change the hostname (even put the hostname in /etc/hosts is made by commons). The motive is because all my playbooks will need some kind of preparation before executed, so to not including the same code in every single project, I made a different playbook that will do everything that is considered "common" in each one of my playbooks.
67+
68+
Example Playbook
69+
----------------
70+
```
71+
- hosts: zimbra
72+
become: yes
73+
become_method: sudo
74+
roles:
75+
- role: lucascbeyeler.ansible-zimbra
76+
hostname: warudo
77+
domain: hollowbastion.com
78+
timezone: America/Sao_Paulo
79+
zmpasswd: 123change
80+
zmnetwork: 192.168.122.0/24
81+
zmlogologin: /tmp/login.png
82+
zmlogoapp: /tmp/app.png
83+
```
84+
85+
License
86+
-------
87+
88+
GNU GENERAL PUBLIC LICENSE
89+
90+
Author Information
91+
------------------
92+
93+
https://github.com/lucascbeyeler

files/config.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
# mysql:host=xx;dbname=yyy
4+
#
5+
# pgsql:host=xx;dbname=yyy
6+
#
7+
# sqlite:////full/unix/path/to/file.db?mode=0666
8+
#
9+
#$DB_DSN="sqlite:////tmp/cluebringer.sqlite";
10+
#$DB_DSN="mysql:host=localhost;dbname=cluebringer";
11+
$DB_DSN="sqlite:/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb";
12+
$DB_USER="root";
13+
#$DB_PASS="";
14+
$DB_TABLE_PREFIX="";
15+
16+
17+
#
18+
# THE BELOW SECTION IS UNSUPPORTED AND MEANT FOR THE ORIGINAL SPONSOR OF V2
19+
#
20+
21+
#$DB_POSTFIX_DSN="mysql:host=localhost;dbname=postfix";
22+
#$DB_POSTFIX_USER="root";
23+
#$DB_POSTFIX_PASS="";
24+
25+
?>

files/sauser.cf

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Pyzor's Config - Change only if you know what are you doing
2+
use_pyzor 1
3+
pyzor_path /usr/bin/pyzor
4+
pyzor_timeout 20
5+
6+
# Razor's Config - Change only if you know what are you doing
7+
use_razor2 1
8+
9+
#SpamAssassin's Scores - Change THIS file and not salocal.cf
10+
11+
score ALL_TRUSTED -4.000
12+
score DATE_IN_PAST_12_24 2.000
13+
score DCC_CHECK 2.500
14+
score DNS_FROM_AHBL_RHSBL 0
15+
score FORGED_OUTLOOK_HTML 1.500
16+
score HEADER_FROM_DIFFERENT_DOMAINS 2.000
17+
score HTML_FONT_LOW_CONTRAST 2.000
18+
score HTML_IMAGE_RATIO_02 2.000
19+
score HTML_IMAGE_RATIO_04 1.700
20+
score HTML_IMAGE_RATIO_06 1.400
21+
score HTML_IMAGE_RATIO_08 0.500
22+
score HTML_MESSAGE 0.400
23+
score HTML_MIME_NO_HTML_TAG 1.000
24+
score MIME_HTML_ONLY 2.000
25+
score PYZOR_CHECK 3.250
26+
score RAZOR2_CHECK 3.250
27+
score RCVD_IN_BRBL_LASTEXT 3.500
28+
score RCVD_IN_PBL 0.905
29+
score RCVD_IN_RP_CERTIFIED -2.500
30+
score RCVD_IN_RP_SAFE -1.500
31+
score RDNS_NONE 0.000
32+
score REMOTE_IMAGE 2.500
33+
score SPAMCOP_BL 3.500
34+
score SPF_FAIL 10.000
35+
score SPF_HELO_FAIL 10.000
36+
score SPF_PASS -0.900
37+
score SUBJ_ALL_CAPS 2.000
38+
score SUBJ_ILLEGAL_CHARS 2.500
39+
score T_AXB_XM_SENTBY 2.000
40+
score T_FSL_HELO_NON_FQDN_2 0.800
41+
score T_HEADER_FROM_DIFFERENT_DOMAINS 2.000
42+
score T_HTML_ATTACH 1.000
43+
score T_HTML_ATTACH 2.000
44+
score T_LONG_HEADER_LINE_80 0.500
45+
score T_NOT_A_PERSON 0.500
46+
score T_OBFU_HTML_ATTACH 1.000
47+
score T_REMOTE_IMAGE 2.500
48+
score UPPERCASE_50_75 0.700
49+
score URIBL_BLACK 4.250
50+
score URIBL_DBL_REDIR 1.500
51+
score URIBL_DBL_SPAM 5.000
52+
score URIBL_JP_SURB 5.000
53+
score URIBL_JP_SURBL 5.000
54+
score URIBL_WS_SURBL 5.000
55+
score SUBJ_ALL_CAPS 1.000
56+
score LOTS_OF_MONEY 0.700
57+
score T_HK_MUCHMONEY 0.700
58+
score T_KHOP_FOREIGN_CLICK 0.700
59+
score T_SHORTENED_URL_HREF 0.400
60+
score T_URL_SHORTENER 0.400
61+
score BAD_ENC_HEADER 0.400
62+
score T_UNKNOWN_ORIGIN 0.700
63+
score RP_MATCHES_RCVD -0.000

meta/main.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
galaxy_info:
2+
author: Lucas Costa Beyeler
3+
description: Ansible role to install and configure Zimbra Collaboration Open Source Edition
4+
company: Beyeler
5+
license: GPLv3
6+
min_ansible_version: 2.3
7+
github_branch: master
8+
platforms:
9+
- name: Ubuntu
10+
versions:
11+
- trusty
12+
- xenial
13+
- name: EL
14+
versions:
15+
- 6
16+
- 7
17+
galaxy_tags:
18+
- zimbra
19+
- community
20+
dependencies:
21+
- { role: lucascbeyeler.baseline }

tasks/configure.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,4 @@
11
---
2-
#
3-
# Configuring Zimbra OSE
4-
################################################################################
5-
- name: Configuring Zimbra OSE's services for use
6-
command: ./zmsetup.pl -c /tmp/zcs/installZimbraScript
7-
args:
8-
chdir: /opt/zimbra/libexec/
9-
10-
- name: Setting LMTP Host Lookup from DNS to Native
11-
command: ./zmprov mcf zimbraMtaLmtpHostLookup native
12-
args:
13-
chdir: /opt/zimbra/bin/
14-
15-
- name: Enabling Zimbra's admin tthrough Proxy Server
16-
command: ./zmproxyconfig -e -w -C -H {{ hostname }}.{{ domain }}
17-
args:
18-
chdir: /opt/zimbra/libexec/
19-
become: yes
20-
become_user: zimbra
21-
22-
- name: Enabling HTTP to HTTPS redirect
23-
command: ./zmprov ms {{ hostname }}.{{ domain }} zimbraReverseProxyMailMode redirect
24-
args:
25-
chdir: /opt/zimbra/bin/
26-
272
#
283
# Configuring SpamAssassin
294
################################################################################

tasks/configure/all.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
#
3+
# Configuring Zimbra OSE
4+
################################################################################
5+
- name: Configuring Zimbra OSE's services for use
6+
command: ./zmsetup.pl -c /tmp/zcs/installZimbraScript
7+
args:
8+
chdir: /opt/zimbra/libexec/

tasks/configure/mailbox.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
#
3+
# Configuring Zimbra OSE
4+
################################################################################
5+
- name: Enabling Zimbra's admin through Proxy Server
6+
command: ./zmproxyconfig -e -w -C -H {{ hostname }}.{{ domain }}
7+
args:
8+
chdir: /opt/zimbra/libexec/
9+
become: yes
10+
become_user: zimbra
11+
12+
- name: Enabling HTTP to HTTPS redirect
13+
command: ./zmprov ms {{ hostname }}.{{ domain }} zimbraReverseProxyMailMode redirect
14+
args:
15+
chdir: /opt/zimbra/bin/

tasks/configure/mta.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
#
3+
# Configuring Zimbra OSE
4+
################################################################################
5+
- name: Setting LMTP Host Lookup from DNS to Native
6+
command: ./zmprov mcf zimbraMtaLmtpHostLookup native
7+
args:
8+
chdir: /opt/zimbra/bin/

0 commit comments

Comments
 (0)