From a3d7e7514bc389a761817712c258f31a947bcc03 Mon Sep 17 00:00:00 2001 From: lucascbeyeler Date: Sat, 18 Feb 2017 11:32:52 -0200 Subject: [PATCH] Resolving issue #2, updating documentation, and made the reboot task work again --- README.md | 30 ++++++++++++++++++++++++++++-- handlers/main.yml | 6 ------ tasks/main.yml | 10 +++++++++- tasks/nodistro/install-zimbra.yml | 5 ----- tasks/nodistro/policyd.yml | 14 ++++++++------ vars/main.yml | 7 ------- 6 files changed, 45 insertions(+), 27 deletions(-) delete mode 100644 vars/main.yml diff --git a/README.md b/README.md index 16fa77a..2d5c37c 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,33 @@ stdout_callback=skippy pipelining=True ``` +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: + +``` +ansible-galaxy install lucascbeyeler.ansible-zimbra +``` + +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 +``` + +Features +-------------- + +* 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; + + Role Variables -------------- @@ -33,8 +60,7 @@ Role Variables Dependencies ------------ -It's a good idea to apply the role lucascbeyeler.commons before run this playbook, because we do not cover any kind of server preparation, like updates. - +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. Example Playbook ---------------- diff --git a/handlers/main.yml b/handlers/main.yml index 0ae8e49..54f6712 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,8 +1,2 @@ --- # handlers file for zimbra - -- name: reboot-machine - shell: sleep 2 && shutdown -r now "Ansible updates triggered" - async: 1 - poll: 0 - ignore_errors: true diff --git a/tasks/main.yml b/tasks/main.yml index 77a231a..0d1b0b0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -15,4 +15,12 @@ - include: nodistro/modify-logo.yml when: zmlogologin is defined and zmlogoapp is defined - include: nodistro/policyd.yml - notify: reboot-machine + +# +# Rebooting the Machine +################################### +- name: Rebooting the machine to apply the changes + shell: sleep 2 && shutdown -r now "Ansible updates triggered" + async: 1 + poll: 0 + ignore_errors: true diff --git a/tasks/nodistro/install-zimbra.yml b/tasks/nodistro/install-zimbra.yml index c396ecf..531d907 100644 --- a/tasks/nodistro/install-zimbra.yml +++ b/tasks/nodistro/install-zimbra.yml @@ -1,8 +1,3 @@ -# FILE: install-zimbra -# AUTHOR: Lucas Costa Beyeler -# E-MAIL: lucas.costab@outlook.com -# LAST CHANGE: 09/03/2016 -# # 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 diff --git a/tasks/nodistro/policyd.yml b/tasks/nodistro/policyd.yml index 914b554..824214b 100644 --- a/tasks/nodistro/policyd.yml +++ b/tasks/nodistro/policyd.yml @@ -1,14 +1,9 @@ -# FILE: install-zimbra -# AUTHOR: Lucas Costa Beyeler -# E-MAIL: lucas.costab@outlook.com -# LAST CHANGE: 15/02/2017 -# # 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 `zmhostname` +zimbraServiceInstalled cbpolicyd +zimbraServiceEnabled cbpolicyd + shell: ./zmprov ms {{ hostname }}.{{ domain }} +zimbraServiceInstalled cbpolicyd +zimbraServiceEnabled cbpolicyd args: chdir: /opt/zimbra/bin/ @@ -25,3 +20,10 @@ 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 diff --git a/vars/main.yml b/vars/main.yml deleted file mode 100644 index d1ffd0e..0000000 --- a/vars/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# vars file for zimbra - -hostname: localhost -domain: localdomain -zmpasswd: 123change -zmnetwork: 0.0.0.0/8