ADD import roles

This commit is contained in:
2024-09-15 09:42:20 +02:00
parent 4798dde38c
commit e6027e9078
36 changed files with 1129 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
radvd_enabled: false
+6
View File
@@ -0,0 +1,6 @@
---
- name: Restart radvd
ansible.builtin.systemd_service:
name: radvd.service
state: restarted
enabled: true
+52
View File
@@ -0,0 +1,52 @@
---
- name: Set OS dependent variables
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_distribution | lower }}_{{ ansible_distribution_version | lower }}.yml"
- "{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_os_family | lower }}.yml"
- "{{ ansible_system | lower }}.yml"
paths:
- "{{ role_path }}/vars"
ignore_errors: True
tags:
- always
- name: OS is supported
assert:
that: __os_supported
quiet: True
vars:
__os_supported: "{{ lookup('vars', '{}_os_supported'.format(role_name)) | bool }}"
tags:
- always
- name: Install required packages
package:
name: "{{ item }}"
state: present
with_items: "{{ lookup('vars', '{}_packages'.format(role_name)) | list }}"
when: radvd_enabled
tags:
- install
- name: Install radvd configuration
template:
src: radvd.conf.j2
dest: "/etc/radvd.conf"
owner: root
group: root
mode: 0644
tags:
- configure
no_log: false
notify: Restart radvd
- name: Enable radvd service
ansible.builtin.systemd_service:
name: radvd.service
state: started
enabled: true
+24
View File
@@ -0,0 +1,24 @@
# {{ ansible_managed }}
{% for iface in radvd_interfaces | default([]) %}
interface {{ iface.name }} {
AdvSendAdvert on;
MinRtrAdvInterval 5;
MaxRtrAdvInterval 15;
route ::/0 {};
AdvManagedFlag off;
AdvOtherConfigFlag off;
prefix {{ iface.prefix }} {
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
};
{% if iface.source is defined %}
AdvRASrcAddress {
{{ iface.source }};
};
{% endif %}
RDNSS {{ iface.dns | default(['2a00:1398::1', '2a00:1398::2']) | join(' ') }} {
AdvRDNSSLifetime {{ iface.dns_lifetime | default(3600) }};
};
};
{% endfor %}
+3
View File
@@ -0,0 +1,3 @@
radvd_os_supported: true
radvd_packages:
- radvd
+1
View File
@@ -0,0 +1 @@
bird_os_supported: false