2016-04-28 23:24:10 +02:00
|
|
|
---
|
|
|
|
# tasks file for cartertdte.mta
|
|
|
|
|
|
|
|
- name: Include distribution specific variables
|
|
|
|
include_vars: "{{ ansible_distribution }}.yml"
|
|
|
|
tags: zimbra
|
|
|
|
|
|
|
|
- include: CentOS.yml
|
|
|
|
when: ansible_distribution == "CentOS"
|
|
|
|
tags: zimbra
|
|
|
|
|
|
|
|
- include: Ubuntu.yml
|
|
|
|
when: ansible_distribution == "Ubuntu"
|
|
|
|
tags: zimbra
|
|
|
|
|
|
|
|
- name: Set hostname
|
|
|
|
command: hostname {{ zimbra_hostname }}
|
|
|
|
|
|
|
|
- name: Set hosts file
|
|
|
|
template:
|
|
|
|
src=hosts.j2
|
|
|
|
dest=/etc/hosts
|
|
|
|
owner=root
|
2016-05-21 21:06:18 +02:00
|
|
|
group=root
|
2016-04-28 23:24:10 +02:00
|
|
|
mode=0644
|
2016-05-21 21:06:18 +02:00
|
|
|
notify:
|
|
|
|
- dnsmasq restart
|
2016-04-28 23:24:10 +02:00
|
|
|
|
2016-05-21 21:06:18 +02:00
|
|
|
- name: Set resolv.conf file
|
|
|
|
template:
|
|
|
|
src=resolv.conf.j2
|
|
|
|
dest=/etc/resolv.conf
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
mode=0644
|
|
|
|
notify:
|
|
|
|
- dnsmasq restart
|
|
|
|
|
|
|
|
- name: Resolv self hostname via dnsmasq
|
|
|
|
template:
|
|
|
|
src=hostname.dnsmasq.j2
|
|
|
|
dest=/etc/dnsmasq.d/{{ ansible_hostname }}
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
mode=0644
|
|
|
|
notify:
|
|
|
|
- dnsmasq restart
|
|
|
|
|
|
|
|
- name: Enable dnsmasq service
|
2016-04-28 23:24:10 +02:00
|
|
|
service:
|
|
|
|
name=dnsmasq
|
2016-05-21 21:06:18 +02:00
|
|
|
enabled=yes
|
|
|
|
|
|
|
|
- name: Ensure handlers run now
|
|
|
|
meta: flush_handlers
|
2016-04-28 23:24:10 +02:00
|
|
|
|
|
|
|
- name: Create Source Software Directory
|
|
|
|
file: path=/opt/src state=directory
|
|
|
|
|
|
|
|
- name: 'Download Zimbra .tgz file'
|
|
|
|
get_url:
|
|
|
|
url={{ zimbra_download_url }}
|
|
|
|
dest=/opt/src/{{ zimbra_file }}.tgz
|
|
|
|
timeout=60
|
|
|
|
sha256sum={{ zimbra_256sum_file }}
|
|
|
|
|
|
|
|
- name: Check if Zimbra is installed
|
|
|
|
stat: path=/opt/zimbra/bin/zmprov
|
|
|
|
register: zimbra_check_installation
|
|
|
|
|
|
|
|
- include: install_zimbra.yml
|
|
|
|
when: zimbra_check_installation.stat.islnk is not defined
|
|
|
|
|
|
|
|
- name: Check if Zimbra is configured
|
|
|
|
command: /opt/zimbra/bin/zmprov gd {{ zimbra_default_domain }}
|
|
|
|
ignore_errors: yes
|
|
|
|
register: zimbra_check_configuration
|
|
|
|
|
|
|
|
- include: configure_zimbra.yml
|
|
|
|
when: zimbra_check_configuration.rc != 0
|
|
|
|
|
|
|
|
- name: Start zimbra
|
|
|
|
service: name=zimbra state=restarted
|
2016-05-21 21:06:18 +02:00
|
|
|
ignore_errors: yes
|
2016-04-28 23:24:10 +02:00
|
|
|
|
|
|
|
- include: provision_zimbra.yml
|