- Added DNS auto-configuration

- Tests on Ubuntu 14.04
This commit is contained in:
Paul 2016-05-21 21:06:18 +02:00
parent 7d058d7dbb
commit 44bece4b1d
6 changed files with 40 additions and 6 deletions

View File

@ -9,7 +9,7 @@ Requirements
* CentOS 6, 7 * CentOS 6, 7
* RHEL 6, 7 * RHEL 6, 7
* Ubuntu 14.04 * Ubuntu 14.04
* Correctly configure DNS * Correctly configure DNS : now auto-configured using dnsmasq
* Correctly configued `/etc/hosts` file : now auto-configured by this ansible role * Correctly configued `/etc/hosts` file : now auto-configured by this ansible role
Role Variables Role Variables
@ -94,3 +94,5 @@ Author Information
------------------ ------------------
Based on ansible-zimbradev by pbruna Based on ansible-zimbradev by pbruna
Modified by paulbsd

View File

@ -2,4 +2,7 @@
# handlers file for cartertdte.mta # handlers file for cartertdte.mta
- name: postfix restart - name: postfix restart
service: name=postfix state=restarted service: name=postfix state=restarted
- name: dnsmasq restart
service: name=dnsmasq state=restarted

View File

@ -21,13 +21,38 @@
src=hosts.j2 src=hosts.j2
dest=/etc/hosts dest=/etc/hosts
owner=root owner=root
group=root
mode=0644 mode=0644
notify:
- dnsmasq restart
- name: Disable and stop dnsmasq service - 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
service: service:
name=dnsmasq name=dnsmasq
state=stopped enabled=yes
enabled=no
- name: Ensure handlers run now
meta: flush_handlers
- name: Create Source Software Directory - name: Create Source Software Directory
file: path=/opt/src state=directory file: path=/opt/src state=directory
@ -56,5 +81,6 @@
- name: Start zimbra - name: Start zimbra
service: name=zimbra state=restarted service: name=zimbra state=restarted
ignore_errors: yes
- include: provision_zimbra.yml - include: provision_zimbra.yml

View File

@ -0,0 +1 @@
address=/{{ zimbra_hostname }}.{{ zimbra_default_domain }}/{{ ansible_eth0.ipv4.address }}

View File

@ -1,2 +1,2 @@
search localdomain ffx.net search localdomain {{ zimbra_default_domain }}
nameserver 127.0.0.1 nameserver 127.0.0.1

View File

@ -10,9 +10,11 @@ zimbra_required_packages:
- unzip - unzip
- perl - perl
- libperl5.18 - libperl5.18
- netcat-openbsd
- pax - pax
- sysstat - sysstat
- sqlite3 - sqlite3
- resolvconf - resolvconf
- dnsmasq - dnsmasq
- dnsutils
- wget - wget