Commit a4f43a95 authored by zaiken's avatar zaiken 💬 Committed by root

Ajout du DNS dans keepalived

parent ef60549a
---
# Install Matrix Synapse on corresponding containers
- hosts: dns
# Install dns on routers
- hosts: gateways
remote_user: root
roles:
- dns
/var/local/dns/** rw,
/usr/local/dns/generated/dns.rez.zone r,
/usr/local/dns/generated/** r,
......@@ -142,86 +142,3 @@ zone "2.69.10.in-addr.arpa" {
// Duplication autorisée pour les NS Supélec
allow-transfer { supelec-ns; };
};
- name: Install bind9
apt:
name: bind9
- file:
path: /var/log/named
state: directory
mode: 0764
- file:
path: /var/local/dns
state: directory
mode: 0764
- name: Recursively remove directory Re2oapi
file:
path: /usr/local/dns/re2oapi
state: absent
- name: Copy configuration LOCAL
copy:
src: named.conf.local
dest: /etc/bind/named.conf.local
mode: 0644
owner: bind
group: bind
- name: Copy configuration LOGGING
copy:
src: named.conf.logging
dest: /etc/bind/named.conf.logging
mode: 0744
owner: bind
group: bind
- name: Copy configuration DEFAULT
copy:
src: named.conf.default
dest: /etc/bind/named.conf.default
mode: 0644
owner: bind
group: bind
- name: Copy configuration OPTIONS
copy:
src: named.conf.options
dest: /etc/bind/named.conf.options
mode: 0644
owner: bind
group: bind
- name: Copy zone rezo
copy:
src: zone_rezo
dest: /var/local/dns/zones_rezo
mode: 0644
owner: bind
group: bind
- name: Copy apparmor configuration
copy:
src: usr.sbin.named
dest: /etc/apparmor.d/local/usr.sbin.named
mode: 0644
owner: bind
group: bind
- name: Get re2o-service for dns
git:
repo: https://gitlab.federez.net/re2o/dns.git
dest: /usr/local/dns
force: yes
- name: Get re2oApi for dns
git:
repo: https://gitlab.federez.net/re2o/re2oapi.git
dest: /usr/local/dns/re2oapi
force: yes
- name: Create generated directory
file:
path: /usr/local/dns/generated
state: directory
mode: 0755
- name: Configure service
template:
src: config.ini.j2
dest: /usr/local/dns/config.ini
mode: 0600
- name: Reload apparmor
service:
name: apparmor
state: reloaded
- name: Create crontab
cron:
cron_file: re2o-services
name: Update dns entries
user: root
job: "cd /usr/local/dns/ && /usr/bin/python3 /usr/local/dns/main.py > /dev/null 2>&1 && systemctl reload bind9"
- name: Restart bind9
service:
name: bind9
state: restarted
......@@ -2,3 +2,5 @@
hostname = {{ re2o_address }}
username = {{ service_user }}
password = {{ service_user_password }}
use_tls = true
use_knot = false
......@@ -22,6 +22,7 @@ vrrp_instance VI_ROUT {
bond0.20
bond0.2
bond0.13
bond0.66
eno1
}
......
......@@ -5,7 +5,6 @@
- hosts: gateways
remote_user: root
roles:
- dns
- configure_routers_network
- keepalived
- install_network_driver
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment