mirror of https://github.com/lucascbeyeler/zimbra
Compare commits
65 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
a283e67fdd | |
|
|
e15bdb4af2 | |
|
|
11a626355e | |
|
|
6b02ae84f9 | |
|
|
4e39e65ac1 | |
|
|
774a027d8f | |
|
|
02dc7b81cc | |
|
|
a4a5c710f3 | |
|
|
f6cab03c39 | |
|
|
07fdf94835 | |
|
|
df5f2f64f0 | |
|
|
b584847a3d | |
|
|
173dc5d2b2 | |
|
|
ae30094f38 | |
|
|
52cde71718 | |
|
|
a220d76add | |
|
|
703aa09a6b | |
|
|
5b1dc256f0 | |
|
|
68eb3d980f | |
|
|
5083afead5 | |
|
|
3bda4ac1e6 | |
|
|
79156641a8 | |
|
|
1b7e74a629 | |
|
|
9d7563a37b | |
|
|
8e2be51f11 | |
|
|
732a0d8a81 | |
|
|
844c9eb9e5 | |
|
|
90bc5a8e21 | |
|
|
651cc2d3d2 | |
|
|
4b41e04660 | |
|
|
a087dfe4b0 | |
|
|
7ff56df9f9 | |
|
|
d077dc7041 | |
|
|
6c9017fe07 | |
|
|
2c40358b68 | |
|
|
4c185f74da | |
|
|
a51733fd35 | |
|
|
a9e2ebd47f | |
|
|
eef095e327 | |
|
|
44c7b99c62 | |
|
|
bd5df26f88 | |
|
|
9ccb985d7b | |
|
|
fd004472fd | |
|
|
eb6920f849 | |
|
|
67db274b0f | |
|
|
a814e994a6 | |
|
|
7c33cb8def | |
|
|
af496f1ab0 | |
|
|
2570903fa7 | |
|
|
535568b78e | |
|
|
fc3379029d | |
|
|
f2ac5cbb61 | |
|
|
6c51c8ca67 | |
|
|
caaf3aa210 | |
|
|
72057a6504 | |
|
|
6be782c631 | |
|
|
de171a0fdd | |
|
|
968047063e | |
|
|
d595f6bce7 | |
|
|
770ade33bd | |
|
|
e82a8896c9 | |
|
|
4efa68ab68 | |
|
|
990ed3d585 | |
|
|
4b4fae19fd | |
|
|
b4268d9d77 |
|
|
@ -0,0 +1,3 @@
|
|||
# These are supported funding model platforms
|
||||
|
||||
github: [lucascbeyeler]
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
OLD
|
||||
.idea
|
||||
|
|
@ -25,7 +25,7 @@ install:
|
|||
- printf '[defaults]\nroles_path=../' >ansible.cfg
|
||||
|
||||
# Install ansible-commons
|
||||
- ansible-galaxy install lucascbeyeler.commons
|
||||
- ansible-galaxy install lucascbeyeler.baseline
|
||||
|
||||
script:
|
||||
# Basic role syntax check
|
||||
|
|
|
|||
65
README.md
65
README.md
|
|
@ -1,32 +1,25 @@
|
|||
Ansible-Zimbra
|
||||
Zimbra
|
||||
=========
|
||||
|
||||
Ansible role to install and configure Zimbra Collaboration Open Source Edition in a monoserver environment
|
||||
Non-Official ansible role to install and configure Zimbra Collaboration Open Source Edition on Red Hat, CentOS and Ubuntu Server.
|
||||
|
||||
[](https://travis-ci.org/lucascbeyeler/ansible-zimbra)
|
||||
[](https://www.zimbra.com/downloads/zimbra-collaboration-open-source/)
|
||||
[](https://travis-ci.org/lucascbeyeler/zimbra)
|
||||
[](https://www.zimbra.com/downloads/zimbra-collaboration-open-source/)
|
||||

|
||||

|
||||
[](https://www.ansible.com/)
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
* [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
|
||||
|
||||
* 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:
|
||||
```
|
||||
[defaults]
|
||||
host_key_checking=False
|
||||
stdout_callback=skippy
|
||||
|
||||
[ssh_connection]
|
||||
pipelining=True
|
||||
```
|
||||
* [Ansible](https://github.com/ansible/ansible) 2.9.6 or high.
|
||||
|
||||
Install
|
||||
--------------
|
||||
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:
|
||||
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:
|
||||
|
||||
```
|
||||
ansible-galaxy install lucascbeyeler.ansible-zimbra
|
||||
ansible-galaxy install lucascbeyeler.zimbra
|
||||
```
|
||||
|
||||
Update
|
||||
|
|
@ -34,19 +27,20 @@ Update
|
|||
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.
|
||||
|
||||
```
|
||||
ansible-galaxy install -f lucascbeyeler.ansible-zimbra
|
||||
ansible-galaxy install -f lucascbeyeler.zimbra
|
||||
```
|
||||
|
||||
Features
|
||||
--------------
|
||||
|
||||
* Run many times you want to apply the configuration - installatin only occur if the server has no Zimbra installed
|
||||
* Configuring SpamAssassin, Pyzor and Razor;
|
||||
* 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/);
|
||||
* Enable PolicyD service and web admin;
|
||||
* Proxy Admin;
|
||||
* HTTP to HTTPS redirect;
|
||||
* LMTP Host Lookup in Native mode;
|
||||
* Chat and ownCloud plugin;
|
||||
* Customize your Zimbra OSE server;
|
||||
|
||||
|
||||
Role Variables
|
||||
|
|
@ -59,11 +53,30 @@ Role Variables
|
|||
* **zmlogologin:** Inform the path for your logo (Login Screen) - don't inform and no image will be applied;
|
||||
* **zmlogoapp:** Inform the path for your logo (Application Screen) - don't inform and no image will be applied;
|
||||
* **timezone:** inform the timezone the playbook should set in your server;
|
||||
* **zimbra_version:** Inform which version of Zimbra you want to install. Default: 8.8.15
|
||||
|
||||
Service Variables - Inform "y" or "n"
|
||||
--------------
|
||||
|
||||
* **zimbra_ldap:** Enable Zimbra LDAP Server - default: **y**
|
||||
* **zimbra_logger:** Enable Zimbra Logger Service - default: **y**
|
||||
* **zimbra_mta:** Enable Zimbra MTA Service - default: **y**
|
||||
* **zimbra_dnscache:** Enable Zimbra DNS Cache Service (unbound) - default: **n**
|
||||
* **zimbra_snmp:** Enable Zimbra SNMP Checks - default: **n**
|
||||
* **zimbra_store:** Enable Zimbra Store Service - default: **y**
|
||||
* **zimbra_apache:** Enable Zimbra Web Interface (Apache Web Server) - default: **y**
|
||||
* **zimbra_spell:** Enable Zimbra Spell Check - default: **y**
|
||||
* **zimbra_memcached:** Enable Zimbra Cache Service (Memcached) - default: **y**
|
||||
* **zimbra_proxy:** Enable Zimbra Proxy Service - default: **y**
|
||||
* **zimbra_chat:** Enable Zimbra Chat - default: **n**
|
||||
* **zimbra_drive:** Enable Zimbra ownCloud Drive - default: **n**
|
||||
* **zimbra_imapd:** Enable Zimbra IMAPD Solo Service **BETA** - default: **n**
|
||||
* **zimbra_policyd:** Enable Zimbra PolicyD Service - default: **n**
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
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.
|
||||
To run this playbook, you will need to run [lucascbeyeler.baseline](https://github.com/lucascbeyeler/baseline) 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.
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
|
@ -72,9 +85,9 @@ Example Playbook
|
|||
become: yes
|
||||
become_method: sudo
|
||||
roles:
|
||||
- role: lucascbeyeler.ansible-zimbra
|
||||
hostname: warudo
|
||||
domain: hollowbastion.com
|
||||
- role: lucascbeyeler.zimbra
|
||||
hostname: localhost
|
||||
domain: localdomain
|
||||
timezone: America/Sao_Paulo
|
||||
zmpasswd: 123change
|
||||
zmnetwork: 192.168.122.0/24
|
||||
|
|
@ -85,9 +98,11 @@ Example Playbook
|
|||
License
|
||||
-------
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
[](http://www.gnu.org/licenses/gpl.html)
|
||||
|
||||
View official GNU site <http://www.gnu.org/licenses/gpl.html>.
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
https://github.com/lucascbeyeler
|
||||
* [Lucas Costa Beyeler](https://github.com/lucascbeyeler) - lucas.costab@outlook.com
|
||||
|
|
|
|||
|
|
@ -1,2 +1,47 @@
|
|||
---
|
||||
# defaults file for zimbra
|
||||
absent:
|
||||
- postfix
|
||||
- sendmail
|
||||
|
||||
ubuntu:
|
||||
- razor
|
||||
- pyzor
|
||||
|
||||
centos:
|
||||
- pyzor
|
||||
- perl-Razor-Agent
|
||||
|
||||
#
|
||||
# Products to be installed
|
||||
################################################################################
|
||||
zimbra_ldap: y
|
||||
zimbra_logger: y
|
||||
zimbra_mta: y
|
||||
zimbra_dnscache: n
|
||||
zimbra_snmp: n
|
||||
zimbra_store: y
|
||||
zimbra_apache: y
|
||||
zimbra_spell: y
|
||||
zimbra_memcached: y
|
||||
zimbra_proxy: y
|
||||
zimbra_chat: n
|
||||
zimbra_drive: n
|
||||
zimbra_imapd: n
|
||||
zimbra_policyd: n
|
||||
|
||||
#
|
||||
# Zimbra configuration
|
||||
################################################################################
|
||||
|
||||
hostname: "localhost"
|
||||
domain: "localdomain"
|
||||
zmpasswd: "!23Change"
|
||||
zmnetwork: "192.168.200.0/8"
|
||||
timezone: UTC
|
||||
#hosts_lines:
|
||||
# - "198.162.1.3 {{ hostname }}.{{ domain }} {{ hostname }}"
|
||||
|
||||
#
|
||||
# Zimbra configuration
|
||||
################################################################################
|
||||
zimbra_version: 8.8.15
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
|
|
@ -6,6 +6,14 @@ pyzor_timeout 20
|
|||
# Razor's Config - Change only if you know what are you doing
|
||||
use_razor2 1
|
||||
|
||||
# Enabling Bayesian mail filtering
|
||||
use_bayes 1
|
||||
score BAYES_90 4.300
|
||||
score BAYES_80 3.500
|
||||
score BAYES_60 3.000
|
||||
score BAYES_50 2.500
|
||||
score BAYES_00 -0.500
|
||||
|
||||
#SpamAssassin's Scores - Change THIS file and not salocal.cf
|
||||
|
||||
score ALL_TRUSTED -4.000
|
||||
|
|
@ -61,3 +69,4 @@ score T_URL_SHORTENER 0.400
|
|||
score BAD_ENC_HEADER 0.400
|
||||
score T_UNKNOWN_ORIGIN 0.700
|
||||
score RP_MATCHES_RCVD -0.000
|
||||
score
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
# handlers file for zimbra
|
||||
|
|
@ -1,21 +1,21 @@
|
|||
galaxy_info:
|
||||
author: Lucas Costa Beyeler
|
||||
description: Ansible role to install and configure Zimbra Collaboration Open Source Edition in a monoserver environment
|
||||
company: 4Linux - Open Software Specialists
|
||||
description: Ansible role to install and configure Zimbra Collaboration Open Source Edition
|
||||
company: Beyeler
|
||||
license: GPLv3
|
||||
min_ansible_version: 2.2
|
||||
min_ansible_version: 2.9.6
|
||||
github_branch: master
|
||||
platforms:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- trusty
|
||||
- xenial
|
||||
- bionic
|
||||
- name: EL
|
||||
versions:
|
||||
- 6
|
||||
- 7
|
||||
- 8
|
||||
galaxy_tags:
|
||||
- zimbra
|
||||
- monoserver
|
||||
dependencies:
|
||||
- { role: lucascbeyeler.commons }
|
||||
- community
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
# Here we will download some packages that are needed to be present during the
|
||||
# Zimbra install
|
||||
|
||||
- name: Download all the Zimbra's dependency for CentOS/RHEL System
|
||||
apt: pkg='{{ dependency }}' state=installed
|
||||
|
||||
- name: Ensure Postfix/dnsmasq not installed
|
||||
apt: pkg='{{ absent }}' state=absent
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# Here we will download some packages that are needed to be present during the
|
||||
# Zimbra install
|
||||
|
||||
- name: Download all the Zimbra's dependency for CentOS/RHEL System
|
||||
yum: pkg='{{ dependency }}' state=installed
|
||||
|
||||
- name: Ensure Postfix not installed
|
||||
yum: pkg='{{ absent }}' state=absent
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
#
|
||||
# Configuring Zimbra OSE
|
||||
################################################################################
|
||||
- name: Enabling HTTP to HTTPS redirect
|
||||
command: ./zmprov ms "{{ hostname }}"."{{ domain }}" zimbraReverseProxyMailMode redirect
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
|
||||
- name: Setting LMTP Host Lookup from DNS to Native
|
||||
command: ./zmprov mcf zimbraMtaLmtpHostLookup native
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
|
||||
#
|
||||
# Configuring RBLs
|
||||
################################################################################
|
||||
- name: Importing zen.spamhaus.org RBL
|
||||
command: ./zmprov ms "{{hostname}}"."{{domain}}" +zimbraMtaRestriction 'reject_rbl_client zen.spamhaus.org'
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Importing sbl.spamhaus.org RBL
|
||||
command: ./zmprov ms "{{hostname}}"."{{domain}}" +zimbraMtaRestriction 'reject_rbl_client sbl.spamhaus.org'
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Importing dsn.rfc-ignorant.org RBL
|
||||
command: ./zmprov ms "{{hostname}}"."{{domain}}" +zimbraMtaRestriction 'reject_rbl_client dsn.rfc-ignorant.org'
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Importing bl.spamcop.net RBL
|
||||
command: ./zmprov ms "{{hostname}}"."{{domain}}" +zimbraMtaRestriction 'reject_rbl_client bl.spamcop.net'
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Importing dnsbl.sorbs.net RBL
|
||||
command: ./zmprov ms "{{hostname}}"."{{domain}}" +zimbraMtaRestriction 'reject_rbl_client dnsbl.sorbs.net'
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
---
|
||||
#
|
||||
# Configuring SpamAssassin
|
||||
################################################################################
|
||||
- name: Downloading and Installing Kevin McGrail's Custom Rules
|
||||
get_url:
|
||||
url: https://www.pccc.com/downloads/SpamAssassin/contrib/KAM.cf
|
||||
dest: /opt/zimbra/data/spamassassin/localrules/sakam.cf
|
||||
mode: 0440
|
||||
owner: zimbra
|
||||
group: zimbra
|
||||
|
||||
- name: Configuring sauser.cf With new Scores
|
||||
copy:
|
||||
src: sauser.cf
|
||||
dest: /opt/zimbra/data/spamassassin/localrules/sauser.cf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0440
|
||||
|
||||
- name: Enabling SpamAssassin Auto Update
|
||||
command: ./zmlocalconfig -e antispam_enable_rule_updates=true
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Enabling Amavis to restart when the rules are update
|
||||
command: ./zmlocalconfig -e antispam_enable_restarts=true
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Enabling SpamAssassin rule compilation
|
||||
command: ./zmlocalconfig -e antispam_enable_rule_compilation=true
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
#
|
||||
# Configuring Pyzor
|
||||
################################################################################
|
||||
- name: Downloading and Configuring Pyzor's Anti-spam Base
|
||||
command: pyzor --homedir /opt/zimbra/data/amavisd/.pyzor discover
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
#
|
||||
# Configuring Razor
|
||||
################################################################################
|
||||
- name: Creating Razor's Anti-spam Base
|
||||
command: razor-admin -home=/opt/zimbra/data/amavisd/.razor -create
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Downloading Razor's Anti-spam Base
|
||||
command: razor-admin -home=/opt/zimbra/data/amavisd/.razor -discover
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Registering your Razor installation
|
||||
command: 'razor-admin -home=/opt/zimbra/data/amavisd/.razor -register'
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
#
|
||||
# Configuring PolicyD
|
||||
################################################################################
|
||||
- name: Configuring PolicyD Database
|
||||
copy:
|
||||
src: 'config.php'
|
||||
dest: /opt/zimbra/common/share/webui/includes/config.php
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: zimbra_policyd == 'y'
|
||||
|
||||
- name: Configuring PolicyD Web Interface
|
||||
file:
|
||||
src: /opt/zimbra/common/share/webui
|
||||
dest: /opt/zimbra/data/httpd/htdocs/webui
|
||||
state: link
|
||||
when: zimbra_policyd == 'y'
|
||||
|
||||
- name: Enable PolicyD Web Interface
|
||||
lineinfile:
|
||||
dest: /opt/zimbra/conf/httpd.conf
|
||||
regexp: "^ DirectoryIndex index.html index.html.var"
|
||||
line: " DirectoryIndex index.html index.html.var index.php"
|
||||
state: present
|
||||
when: zimbra_policyd == 'y'
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#
|
||||
# Configuring Zimbra OSE
|
||||
################################################################################
|
||||
- name: Enabling Zimbra's admin through Proxy Server
|
||||
command: ./zmproxyconfig -e -w -C -H "{{ hostname }}"."{{ domain }}"
|
||||
args:
|
||||
chdir: /opt/zimbra/libexec/
|
||||
become: yes
|
||||
become_user: zimbra
|
||||
|
|
@ -21,21 +21,21 @@
|
|||
mode: 0644
|
||||
|
||||
- name: Configure the Zimbra Server to find the new logos
|
||||
shell: './zmprov md {{ domain }} zimbraSkinLogoURL https://{{ hostname }}.{{ domain }}'
|
||||
command: './zmprov md {{ domain }} zimbraSkinLogoURL https://{{ hostname }}.{{ domain }}'
|
||||
args:
|
||||
chdir: /opt/zimbra/bin
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Configure the path for the login logo file
|
||||
shell: './zmprov md {{ domain }} zimbraSkinLogoLoginBanner /img/logoLoginBanner.png'
|
||||
command: './zmprov md {{ domain }} zimbraSkinLogoLoginBanner /img/logoLoginBanner.png'
|
||||
args:
|
||||
chdir: /opt/zimbra/bin
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Configure the path for the webmail logo file
|
||||
shell: './zmprov md {{ domain }} zimbraSkinLogoAppBanner /img/logoAppBanner.png'
|
||||
command: './zmprov md {{ domain }} zimbraSkinLogoAppBanner /img/logoAppBanner.png'
|
||||
args:
|
||||
chdir: /opt/zimbra/bin
|
||||
become: true
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
#
|
||||
# Installing dependencies and removing other smtp servers
|
||||
################################################################################
|
||||
- name: Ensure Sendmail and Postfix is not installed
|
||||
package:
|
||||
name: "{{ absent }}"
|
||||
state: absent
|
||||
|
||||
- name: Ensure Pyzor and Razor is installed (CentOS/RedHat)
|
||||
yum:
|
||||
name: "{{ centos }}"
|
||||
state: present
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- name: Ensure Pyzor and Razor is installed (Ubuntu)
|
||||
apt:
|
||||
name: "{{ ubuntu }}"
|
||||
state: present
|
||||
when: ansible_os_family == "Debian"
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
#
|
||||
# Install PolicyD
|
||||
################################################################################
|
||||
- name: Installing PolicyD Service
|
||||
command: ./zmprov ms "{{ hostname }}"."{{ domain }}" +zimbraServiceInstalled cbpolicyd +zimbraServiceEnabled cbpolicyd
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
---
|
||||
#
|
||||
# Download and install Zimbra OSE
|
||||
################################################################################
|
||||
|
||||
- name: Update /etc/hosts
|
||||
lineinfile:
|
||||
path: /etc/hosts
|
||||
line: "{{ item }}"
|
||||
state: present
|
||||
with_items: "{{ hosts_lines }}"
|
||||
when: hosts_lines is defined
|
||||
|
||||
- name: Download and unpacking Zimbra OSE
|
||||
unarchive:
|
||||
validate_certs: no
|
||||
src: '{{ zmurl }}{{ zmpkg }}.tgz'
|
||||
dest: /usr/local/src/
|
||||
copy: no
|
||||
|
||||
- name: Create the folder to upload the scripts
|
||||
file:
|
||||
path: /tmp/zcs
|
||||
state: directory
|
||||
|
||||
- name: Uploading keystroke file
|
||||
template:
|
||||
src: 'installZimbra-keystrokes'
|
||||
dest: /tmp/zcs/installZimbra-keystrokes
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Uploading installer configuration file
|
||||
template:
|
||||
src: 'installZimbraScript.j2'
|
||||
dest: /tmp/zcs/installZimbraScript
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Installing Zimbra OSE
|
||||
shell: ./install.sh -s < /tmp/zcs/installZimbra-keystrokes
|
||||
args:
|
||||
chdir: '/usr/local/src/{{ zmpkg }}/'
|
||||
|
||||
- name: Configuring Zimbra OSE's services for use
|
||||
command: ./zmsetup.pl -c /tmp/zcs/installZimbraScript
|
||||
args:
|
||||
chdir: /opt/zimbra/libexec/
|
||||
|
|
@ -1,26 +1,48 @@
|
|||
# This is the main file for the role.
|
||||
|
||||
---
|
||||
#
|
||||
# Loading variables
|
||||
###################################
|
||||
- include_vars: file='{{ ansible_os_family }}/packages.yml'
|
||||
- include: 'vars/zimbra-{{ ansible_os_family }}.yml'
|
||||
|
||||
#
|
||||
# Starting the install
|
||||
###################################
|
||||
- include: '{{ ansible_os_family }}/packages.yml'
|
||||
- include: nodistro/install-zimbra.yml
|
||||
- include: nodistro/install-spamassassin.yml
|
||||
- include: nodistro/modify-logo.yml
|
||||
when: zmlogologin is defined and zmlogoapp is defined
|
||||
- include: nodistro/policyd.yml
|
||||
|
||||
#
|
||||
# Rebooting the Machine
|
||||
###################################
|
||||
- name: Rebooting the machine to apply the changes
|
||||
shell: sleep 2 && shutdown -r now "Ansible updates triggered"
|
||||
async: 1
|
||||
poll: 0
|
||||
# Validations before run the playbook
|
||||
################################################################################
|
||||
- name: Checking if there is an Zimbra OSE install already
|
||||
command: getent passwd zimbra
|
||||
register: getent_passwd
|
||||
ignore_errors: true
|
||||
|
||||
#
|
||||
# Installation process
|
||||
################################################################################
|
||||
- import_tasks: 'vars/{{zimbra_version}}.yml'
|
||||
when: getent_passwd.rc == 2
|
||||
- import_tasks: 'install/dependencies.yml'
|
||||
when: getent_passwd.rc == 2
|
||||
- import_tasks: 'install/zimbra.yml'
|
||||
when: getent_passwd.rc == 2
|
||||
- import_tasks: 'install/policyd.yml'
|
||||
when: zimbra_policyd == 'y'
|
||||
|
||||
#
|
||||
# Configuration process
|
||||
################################################################################
|
||||
- import_tasks: 'configure/proxy.yml'
|
||||
when: zimbra_proxy == 'y'
|
||||
- import_tasks: 'configure/mailbox.yml'
|
||||
when: zimbra_store == 'y'
|
||||
- import_tasks: 'configure/mta.yml'
|
||||
when: zimbra_mta == 'y'
|
||||
|
||||
#
|
||||
# Extras configuration process
|
||||
################################################################################
|
||||
- import_tasks: 'extras/modify-logo.yml'
|
||||
when: zmlogologin is defined and zmlogoapp is defined
|
||||
|
||||
#
|
||||
# Restarting Zimbra
|
||||
################################################################################
|
||||
- name: 'Reloading Zimbra OSE Services'
|
||||
shell: source /opt/zimbra/.bashrc && ./zmcontrol restart
|
||||
args:
|
||||
executable: /bin/bash
|
||||
chdir: '/opt/zimbra/bin/'
|
||||
become: yes
|
||||
become_user: zimbra
|
||||
retries: 3
|
||||
|
|
|
|||
|
|
@ -1,87 +0,0 @@
|
|||
# Here we will download and install the Zimbra Server for first use. This
|
||||
# playbook was made in a way to be used the same code for ever distro.
|
||||
# PLEASE - If you made a change here, remember to do in a way that every distro
|
||||
# can use this change. Otherwise, please use the folder RedHat/Debian.
|
||||
|
||||
#
|
||||
# Downloading packages
|
||||
###################################
|
||||
- name: Downloading and Installing Kevin McGrail's Custom Rules
|
||||
get_url:
|
||||
url: https://www.pccc.com/downloads/SpamAssassin/contrib/KAM.cf
|
||||
dest: /opt/zimbra/data/spamassassin/localrules/sakam.cf
|
||||
mode: 0440
|
||||
owner: zimbra
|
||||
group: zimbra
|
||||
|
||||
- name: Downloading and Configuring Pyzor's Anti-spam Base
|
||||
shell: pyzor --homedir /opt/zimbra/data/amavisd/.pyzor discover
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Creating Razor's Anti-spam Base
|
||||
shell: razor-admin -home=/opt/zimbra/data/amavisd/.razor -create
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Downloading Razor's Anti-spam Base
|
||||
shell: razor-admin -home=/opt/zimbra/data/amavisd/.razor -discover
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
#
|
||||
# Registering Razor Install
|
||||
###################################
|
||||
- name: Registering your Razor installation - DEFAULT
|
||||
shell: 'razor-admin -home=/opt/zimbra/data/amavisd/.razor -register'
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
#
|
||||
# Configuring the Spamassassin
|
||||
###################################
|
||||
- name: Configuring sauser.cf With new Scores
|
||||
copy:
|
||||
src: sauser.cf
|
||||
dest: /opt/zimbra/data/spamassassin/localrules/sauser.cf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0440
|
||||
|
||||
#
|
||||
# Installing the RBL's
|
||||
###################################
|
||||
- name: Importing zen.spamhaus.org RBL
|
||||
shell: ./zmprov ms {{hostname}}.{{domain}} +zimbraMtaRestriction 'reject_rbl_client zen.spamhaus.org'
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Importing sbl.spamhaus.org RBL
|
||||
shell: ./zmprov ms {{hostname}}.{{domain}} +zimbraMtaRestriction 'reject_rbl_client sbl.spamhaus.org'
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Importing dsn.rfc-ignorant.org RBL
|
||||
shell: ./zmprov ms {{hostname}}.{{domain}} +zimbraMtaRestriction 'reject_rbl_client dsn.rfc-ignorant.org'
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Importing bl.spamcop.net RBL
|
||||
shell: ./zmprov ms {{hostname}}.{{domain}} +zimbraMtaRestriction 'reject_rbl_client bl.spamcop.net'
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
||||
- name: Importing dnsbl.sorbs.net RBL
|
||||
shell: ./zmprov ms {{hostname}}.{{domain}} +zimbraMtaRestriction 'reject_rbl_client dnsbl.sorbs.net'
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
become: true
|
||||
become_user: zimbra
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
# Here we will download and install the Zimbra Server for first use. This
|
||||
# playbook was made in a way to be used the same code for ever distro.
|
||||
# PLEASE - If you made a change here, remember to do in a way that every distro
|
||||
# can use this change. Otherwise, please use the folder RedHat/Debian.
|
||||
|
||||
- name: Download and Unpacking Zimbra Collaboration - Open Source Edition
|
||||
unarchive:
|
||||
validate_certs: no
|
||||
src: '{{ zmurl }}{{ zmpkg }}.tgz'
|
||||
dest: /usr/local/src/
|
||||
copy: no
|
||||
|
||||
- name: Create the Folder Structure for the Installer (TEMP)
|
||||
file:
|
||||
path: /tmp/zcs
|
||||
state: directory
|
||||
|
||||
- name: Uploading Keystroke File (TEMP)
|
||||
copy:
|
||||
src: 'installZimbra-keystrokes'
|
||||
dest: /tmp/zcs/installZimbra-keystrokes
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Uploading Installer Configuration File (TEMP)
|
||||
template:
|
||||
src: 'installZimbraScript.j2'
|
||||
dest: /tmp/zcs/installZimbraScript
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Installing Zimbra Collaboration's Packages
|
||||
shell: ./install.sh -s < /tmp/zcs/installZimbra-keystrokes
|
||||
args:
|
||||
chdir: '/usr/local/src/{{ zmpkg }}/'
|
||||
|
||||
- name: Configuring the Server for First Use - This will take a while...
|
||||
shell: ./zmsetup.pl -c /tmp/zcs/installZimbraScript
|
||||
args:
|
||||
chdir: /opt/zimbra/libexec/
|
||||
|
||||
- name: Setting LMTP Host Lookup from DNS to Native
|
||||
shell: ./zmprov mcf zimbraMtaLmtpHostLookup native
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
|
||||
- name: Setting Admin via Proxy Server
|
||||
shell: ./zmproxyconfig -e -w -C -H {{ hostname }}.{{ domain }}
|
||||
args:
|
||||
chdir: /opt/zimbra/libexec/
|
||||
become: yes
|
||||
become_user: zimbra
|
||||
|
||||
- name: Redirecting HTTP to HTTPS
|
||||
shell: ./zmprov ms {{ hostname }}.{{ domain }} zimbraReverseProxyMailMode redirect
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
# Playbook file to install and activate the PolicyD service in the Open Source Edition.
|
||||
# PLEASE - If you made a change here, remember to do in a way that every distro
|
||||
# can use this change. Otherwise, please use the folder RedHat/Debian.
|
||||
|
||||
- name: Installing and Enabling the PolicyD Service
|
||||
shell: ./zmprov ms {{ hostname }}.{{ domain }} +zimbraServiceInstalled cbpolicyd +zimbraServiceEnabled cbpolicyd
|
||||
args:
|
||||
chdir: /opt/zimbra/bin/
|
||||
|
||||
- name: Configuring PolicyD Database
|
||||
copy:
|
||||
src: 'config.php'
|
||||
dest: /opt/zimbra/common/share/webui/includes/config.php
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Configuring PolicyD Web Interface
|
||||
file:
|
||||
src: /opt/zimbra/common/share/webui
|
||||
dest: /opt/zimbra/data/httpd/htdocs/webui
|
||||
state: link
|
||||
|
||||
- name: Enable PolicyD Web Interface
|
||||
lineinfile:
|
||||
dest: /opt/zimbra/conf/httpd.conf
|
||||
regexp: "^ DirectoryIndex index.html index.html.var"
|
||||
line: " DirectoryIndex index.html index.html.var index.php"
|
||||
state: present
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
#
|
||||
# Setting variables
|
||||
################################################################################
|
||||
- name: Loading the address to the most recent release of Zimbra OSE (8.8.15)
|
||||
set_fact: zmurl=https://files.zimbra.com/downloads/8.8.15_GA/
|
||||
|
||||
- name: Check if your distro is Ubuntu Server 16.04 LTS
|
||||
set_fact: zmpkg=zcs-8.8.15_GA_3869.UBUNTU16_64.20190918004220
|
||||
when: ansible_distribution_major_version|int >= 16 and ansible_distribution_major_version|int <= 17
|
||||
|
||||
- name: Check if your distro is Ubuntu Server 18.04 LTS
|
||||
set_fact: zmpkg=zcs-8.8.15_GA_3869.UBUNTU18_64.20190918004220
|
||||
when: ansible_distribution_major_version|int >= 18 and ansible_distribution_major_version|int <= 19
|
||||
|
||||
- name: Check if your distro is Ubuntu Server 20.04 LTS
|
||||
set_fact: zmpkg=zcs-8.8.15_GA_4179.UBUNTU20_64.20211118033954
|
||||
when: ansible_distribution_major_version|int >= 20
|
||||
|
||||
- name: Check if your distro is Ubuntu Server 14.04 LTS
|
||||
set_fact: zmpkg=zcs-8.8.15_GA_3869.UBUNTU14_64.20190918004220
|
||||
when: ansible_distribution_major_version|int >= 14 and ansible_distribution_major_version|int <= 15
|
||||
|
||||
- name: Check if your distro is Red Hat Enterprise Linux or CentOS (Major 6)
|
||||
set_fact: zmpkg=zcs-8.8.15_GA_3869.RHEL6_64.20190918004220
|
||||
when: ansible_distribution_major_version == "6"
|
||||
|
||||
- name: Check if your distro is Red Hat Enterprise Linux or CentOS (Major 7)
|
||||
set_fact: zmpkg=zcs-8.8.15_GA_3869.RHEL7_64.20190918004220
|
||||
when: ansible_distribution_major_version == "7"
|
||||
|
||||
- name: Check if your distro is Red Hat Enterprise Linux or CentOS (Major 8)
|
||||
set_fact: zmpkg=zcs-8.8.15_GA_3953.RHEL8_64.20200629025823
|
||||
when: ansible_distribution_major_version == "8"
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# This is where the Ansible will check which S.O. you are using and select the
|
||||
# correct package to install
|
||||
|
||||
- name: Set the Playbook to Install Zimbra Collaboration 8.7 - Open Source Edition
|
||||
set_fact: zmurl=https://files.zimbra.com/downloads/8.7.7_GA/
|
||||
|
||||
- name: Check if your distro is Ubuntu Server 16.04 LTS
|
||||
set_fact: zmpkg=zcs-8.7.7_GA_1787.UBUNTU16_64.20170410133400
|
||||
when: ansible_distribution_major_version|int >= 16
|
||||
|
||||
- name: Check if your distro is Ubuntu Server 14.04 LTS
|
||||
set_fact: zmpkg=zcs-8.7.7_GA_1787.UBUNTU14_64.20170410133400
|
||||
when: ansible_distribution_major_version|int >= 14 and ansible_distribution_major_version|int <= 15
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# This is where the Ansible will check which S.O. you are using and select the
|
||||
# correct package to install
|
||||
|
||||
- name: Set the Playbook to Install Zimbra Collaboration 8.7 - Open Source Edition
|
||||
set_fact: zmurl=https://files.zimbra.com/downloads/8.7.7_GA/
|
||||
|
||||
- name: Check if your distro is Red Hat Enterprise Linux or CentOS (Major 6)
|
||||
set_fact: zmpkg=zcs-8.7.7_GA_1787.RHEL6_64.20170410133400
|
||||
when: ansible_distribution_major_version == "6"
|
||||
|
||||
- name: Check if your distro is Red Hat Enterprise Linux or CentOS (Major 7)
|
||||
set_fact: zmpkg=zcs-8.7.7_GA_1787.RHEL7_64.20170410133400
|
||||
when: ansible_distribution_major_version == "7"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
::1 localhost.localdomain localhost
|
||||
127.0.0.1 localhost.localdomain localhost
|
||||
127.0.0.1 {{ hostname }}.{{ domain }} {{ hostname }}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
y
|
||||
y
|
||||
{{ zimbra_ldap }}
|
||||
{{ zimbra_logger }}
|
||||
{{ zimbra_mta }}
|
||||
{{ zimbra_dnscache }}
|
||||
{{ zimbra_snmp }}
|
||||
{{ zimbra_store }}
|
||||
{{ zimbra_apache }}
|
||||
{{ zimbra_spell }}
|
||||
{{ zimbra_memcached }}
|
||||
{{ zimbra_proxy }}
|
||||
{{ zimbra_chat }}
|
||||
{{ zimbra_drive }}
|
||||
{{ zimbra_imapd }}
|
||||
y
|
||||
|
|
@ -70,7 +70,7 @@ mailboxd_directory="/opt/zimbra/mailboxd"
|
|||
mailboxd_keystore="/opt/zimbra/mailboxd/etc/keystore"
|
||||
mailboxd_keystore_password="{{ zmpasswd }}"
|
||||
mailboxd_server="jetty"
|
||||
mailboxd_truststore="/opt/zimbra/common/lib/jvm/java/jre/lib/security/cacerts"
|
||||
mailboxd_truststore="/opt/zimbra/common/etc/java/cacerts"
|
||||
mailboxd_truststore_password="changeit"
|
||||
postfix_mail_owner="postfix"
|
||||
postfix_setgid_group="postdrop"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
remote_user: root
|
||||
roles:
|
||||
|
||||
- role: ansible-zimbra
|
||||
- role: zimbra
|
||||
hostname: localhost
|
||||
domain: localdomain
|
||||
zmpasswd: 123change
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
# Here you can set the packages name installed by zimbra's role
|
||||
|
||||
# Dependency is where you inform the packages Zimbra need to be installed before
|
||||
# you run the installer
|
||||
|
||||
dependency:
|
||||
- libgmp10
|
||||
- pax
|
||||
- sqlite3
|
||||
- dnsmasq
|
||||
- wget
|
||||
- libaio1
|
||||
- razor
|
||||
- pyzor
|
||||
|
||||
absent:
|
||||
- postfix
|
||||
- sendmail
|
||||
- dnsmasq
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
# Here you can set the packages name installed by zimbra's role
|
||||
|
||||
# Dependency is where you inform the packages Zimbra need to be installed before
|
||||
# you run the installer
|
||||
|
||||
dependency:
|
||||
- nmap-ncat
|
||||
- perl-core
|
||||
- gcc
|
||||
- openssl-devel
|
||||
- kernel-devel
|
||||
- pyzor
|
||||
- perl-Razor-Agent
|
||||
|
||||
absent:
|
||||
- postfix
|
||||
- sendmail
|
||||
Loading…
Reference in New Issue