1
0
Fork 0
mirror of https://github.com/DO1JLR/ansible_playbook_servers.git synced 2024-09-14 19:53:56 +02:00
ansible_playbook_servers/roles/mailserver_preperation/tasks/main.yml
2021-01-03 01:01:18 +01:00

33 lines
692 B
YAML

---
- name: "set {{ inventory_hostname }} as hostname"
become: true
hostname:
name: "{{ inventory_hostname }}"
- name: Add hostname to /etc/hosts
become: true
lineinfile:
dest: /etc/hosts
regexp: "^127.0.1.1"
line: "127.0.1.1 {{ inventory_hostname }} {{ ansible_hostname }} {{ additional_dns_maildomains }}"
state: present
- name: Set /etc/mailname
become: true
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
- name: configure mariadb
include_tasks: mariadb.yml