- 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
* RHEL 6, 7
* 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
Role Variables
@ -94,3 +94,5 @@ Author Information
------------------
Based on ansible-zimbradev by pbruna
Modified by paulbsd

View File

@ -2,4 +2,7 @@
# handlers file for cartertdte.mta
- 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
dest=/etc/hosts
owner=root
group=root
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:
name=dnsmasq
state=stopped
enabled=no
enabled=yes
- name: Ensure handlers run now
meta: flush_handlers
- name: Create Source Software Directory
file: path=/opt/src state=directory
@ -56,5 +81,6 @@
- name: Start zimbra
service: name=zimbra state=restarted
ignore_errors: yes
- 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

View File

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