1
0
Fork 0
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:
L3D 2021-01-02 21:24:29 +01:00
parent 62f06aee92
commit eb76bb68d7
Signed by: l3d
GPG key ID: CD08445BFF4313D1
4 changed files with 25 additions and 1 deletions

View file

@ -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"

View 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 }}"

View file

@ -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

View 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 %}