2020-05-08 15:54:54 +02:00
|
|
|
---
|
|
|
|
|
2020-08-08 17:10:01 +02:00
|
|
|
# XXX: YES, this is ugly as fuck.
|
|
|
|
- name: set IP suffix (main)
|
|
|
|
set_fact:
|
2020-11-04 20:11:31 +01:00
|
|
|
router_hard_ip_suffix: 240
|
2020-08-08 17:10:01 +02:00
|
|
|
when: "'backup' not in ansible_hostname"
|
|
|
|
|
|
|
|
- name: set IP suffix (backup)
|
|
|
|
set_fact:
|
2020-11-04 20:11:31 +01:00
|
|
|
router_hard_ip_suffix: 140
|
2020-08-08 17:10:01 +02:00
|
|
|
when: "'backup' in ansible_hostname"
|
|
|
|
|
2020-05-08 15:54:54 +02:00
|
|
|
- name: Enable IPv4 packet forwarding
|
2020-05-21 18:06:37 +02:00
|
|
|
ansible.posix.sysctl:
|
2020-05-08 15:54:54 +02:00
|
|
|
name: net.ipv4.ip_forward
|
|
|
|
value: '1'
|
2020-11-04 19:58:54 +01:00
|
|
|
sysctl_set: true
|
2020-08-01 15:46:41 +02:00
|
|
|
|
|
|
|
- name: Enable IPv6 packet forwarding
|
|
|
|
ansible.posix.sysctl:
|
2020-08-01 17:48:39 +02:00
|
|
|
name: net.ipv6.conf.all.forwarding
|
2020-08-01 15:46:41 +02:00
|
|
|
value: '1'
|
2020-11-04 19:58:54 +01:00
|
|
|
sysctl_set: true
|
2020-05-08 15:54:54 +02:00
|
|
|
|
2020-08-08 17:10:01 +02:00
|
|
|
- name: Configure /etc/network/interfaces for routeur-aurore*
|
|
|
|
template:
|
|
|
|
src: interfaces-aurore
|
|
|
|
dest: /etc/network/interfaces
|
|
|
|
mode: 0644
|
|
|
|
when: "'routeur-aurore' in ansible_hostname"
|
|
|
|
|
2020-05-08 15:54:54 +02:00
|
|
|
- name: Install aurore-firewall (re2o-service)
|
|
|
|
import_role:
|
|
|
|
name: re2o-service
|
|
|
|
vars:
|
|
|
|
service_repo: https://gitlab.federez.net/aurore/aurore-firewall.git
|
|
|
|
service_name: aurore-firewall
|
|
|
|
service_version: aurore
|
|
|
|
service_config:
|
|
|
|
hostname: re2o.auro.re
|
|
|
|
username: service-user
|
|
|
|
password: "{{ vault_serviceuser_passwd }}"
|
|
|
|
notify: run aurore-firewall
|
|
|
|
|
2020-08-08 17:10:01 +02:00
|
|
|
- name: Configure aurore-firewall for local router
|
2020-05-08 15:54:54 +02:00
|
|
|
template:
|
|
|
|
src: firewall_config.py
|
|
|
|
dest: /var/local/re2o-services/aurore-firewall/firewall_config.py
|
|
|
|
mode: 0644
|
|
|
|
notify: run aurore-firewall
|
2020-08-08 17:10:01 +02:00
|
|
|
when: "'routeur-aurore' not in ansible_hostname"
|
|
|
|
|
|
|
|
- name: Configure aurore-firewall for routeur-aurore*
|
|
|
|
template:
|
|
|
|
src: firewall_config_aurore.py
|
|
|
|
dest: /var/local/re2o-services/aurore-firewall/firewall_config.py
|
|
|
|
mode: 0644
|
|
|
|
notify: run aurore-firewall
|
|
|
|
when: "'routeur-aurore' in ansible_hostname"
|
2020-05-08 15:54:54 +02:00
|
|
|
|
|
|
|
- name: Install keepalived
|
|
|
|
apt:
|
|
|
|
name: keepalived
|
|
|
|
update_cache: true
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
|
|
|
|
2020-08-08 17:10:01 +02:00
|
|
|
- name: configure keepalived for local router
|
2020-05-08 15:54:54 +02:00
|
|
|
template:
|
|
|
|
src: keepalived.conf
|
|
|
|
dest: /etc/keepalived/keepalived.conf
|
|
|
|
mode: 0644
|
|
|
|
notify: restart keepalived
|
2020-08-08 17:10:01 +02:00
|
|
|
when: "'routeur-aurore' not in ansible_hostname"
|
2020-05-08 15:54:54 +02:00
|
|
|
|
2021-02-04 01:48:40 +01:00
|
|
|
- name: install notify-quagga on routeur-aurore*
|
|
|
|
template:
|
|
|
|
src: notify-quagga.j2
|
|
|
|
dest: /usr/local/sbin/notify-quagga
|
|
|
|
mode: u=rx,g=r,o=r
|
|
|
|
when: "'routeur-aurore' in ansible_hostname"
|
|
|
|
|
2020-08-08 17:10:01 +02:00
|
|
|
- name: configure keepalived for routeur-aurore*
|
|
|
|
template:
|
|
|
|
src: keepalived-aurore.conf
|
|
|
|
dest: /etc/keepalived/keepalived.conf
|
|
|
|
mode: 0644
|
|
|
|
notify: restart keepalived
|
|
|
|
when: "'routeur-aurore' in ansible_hostname"
|
2020-05-08 15:54:54 +02:00
|
|
|
|
|
|
|
- name: Configure cron
|
|
|
|
template:
|
|
|
|
src: cron.d/re2o-services
|
|
|
|
dest: /etc/cron.d/re2o-services
|
|
|
|
mode: 0644
|