Rewrite playbook

This commit is contained in:
Lucas Costa Beyeler
2017-07-08 16:12:58 -03:00
parent 990ed3d585
commit 4efa68ab68
25 changed files with 1 additions and 1361 deletions
-8
View File
@@ -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
-8
View File
@@ -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
-26
View File
@@ -1,26 +0,0 @@
# 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
ignore_errors: true
-87
View File
@@ -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
-59
View File
@@ -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/
-42
View File
@@ -1,42 +0,0 @@
# Change the default logo inside the webmail and on the login screen
# This playbook is not required to run for a 100% install. To skip, just don't
# inform the vars zmlogologin and zmlogoapp.
# WARNING: It's required to use this playbook both files: The logo for the
# webmail and the logo for the login screen.
- name: Send the logo file (LOGIN) from your PC to the Server
copy:
src: '{{ zmlogologin }}'
dest: /opt/zimbra/jetty/webapps/zimbra/img/logoLoginBanner.png
owner: zimbra
group: zimbra
mode: 0644
- name: Send the logo file (WEBMAIL) from your PC to the Server
copy:
src: '{{ zmlogoapp }}'
dest: /opt/zimbra/jetty/webapps/zimbra/img/logoAppBanner.png
owner: zimbra
group: zimbra
mode: 0644
- name: Configure the Zimbra Server to find the new logos
shell: './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'
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'
args:
chdir: /opt/zimbra/bin
become: true
become_user: zimbra
-29
View File
@@ -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
-13
View File
@@ -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.11_GA/
- name: Check if your distro is Ubuntu Server 16.04 LTS
set_fact: zmpkg=zcs-8.7.11_GA_1854.UBUNTU14_64.20170531151956
when: ansible_distribution_major_version|int >= 16
- name: Check if your distro is Ubuntu Server 14.04 LTS
set_fact: zmpkg=zcs-8.7.11_GA_1854.UBUNTU14_64.20170531151956
when: ansible_distribution_major_version|int >= 14 and ansible_distribution_major_version|int <= 15
-13
View File
@@ -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.11_GA/
- name: Check if your distro is Red Hat Enterprise Linux or CentOS (Major 6)
set_fact: zmpkg=zcs-8.7.11_GA_1854.RHEL6_64.20170531151956
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.11_GA_1854.RHEL7_64.20170531151956
when: ansible_distribution_major_version == "7"