mirror of
https://github.com/DO1JLR/ansible_playbook_servers.git
synced 2024-09-14 19:53:56 +02:00
improve mail dns f00
This commit is contained in:
parent
62f06aee92
commit
eb76bb68d7
4 changed files with 25 additions and 1 deletions
|
@ -11,6 +11,9 @@ users:
|
|||
accounts:
|
||||
- l3d
|
||||
|
||||
# mail domains
|
||||
additional_dns_maildomains: 'mail.l3d.space imap.l3d.space smtp.l3d.space'
|
||||
|
||||
# firewall
|
||||
firewall_allowed_tcp_ports:
|
||||
- "22"
|
||||
|
|
5
roles/mailserver_preperation/defaults/main.yml
Normal file
5
roles/mailserver_preperation/defaults/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
set_additional_nameserver: true
|
||||
additional_v4nameserver: '46.182.19.48'
|
||||
additional_v6nameserver: '2a02:2970:1002::18'
|
||||
additional_dns_maildomains: "{{ ansible_fqdn }}"
|
|
@ -10,7 +10,7 @@
|
|||
lineinfile:
|
||||
dest: /etc/hosts
|
||||
regexp: "^127.0.1.1"
|
||||
line: "127.0.1.1 {{ inventory_hostname }} {{ ansible_hostname }}"
|
||||
line: "127.0.1.1 {{ inventory_hostname }} {{ ansible_hostname }} {{ additional_dns_maildomains }}"
|
||||
state: present
|
||||
|
||||
- name: Set /etc/mailname
|
||||
|
@ -18,3 +18,12 @@
|
|||
copy:
|
||||
dest: "/etc/mailname"
|
||||
content: "{{ inventory_hostname }}"
|
||||
|
||||
- name: set own dns resolver
|
||||
become: true
|
||||
template:
|
||||
src: templates/resolve.conf.j2
|
||||
dest: /etc/resolv.conf
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
|
7
roles/mailserver_preperation/templates/resolve.conf.j2
Normal file
7
roles/mailserver_preperation/templates/resolve.conf.j2
Normal file
|
@ -0,0 +1,7 @@
|
|||
# {{ ansible_managed }}
|
||||
nameserver ::1
|
||||
nameserver 127.0.0.1
|
||||
{% if set_additional_nameserver -%}
|
||||
nameserver {{ additional_v4nameserver }}
|
||||
nameserver {{ additional_v6nameserver }}
|
||||
{%- endif %}
|
Loading…
Reference in a new issue