summaryrefslogtreecommitdiff
path: root/roles/uvok_bird/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/uvok_bird/tasks')
-rw-r--r--roles/uvok_bird/tasks/main.yml59
1 files changed, 53 insertions, 6 deletions
diff --git a/roles/uvok_bird/tasks/main.yml b/roles/uvok_bird/tasks/main.yml
index 4bdcf35..2918f48 100644
--- a/roles/uvok_bird/tasks/main.yml
+++ b/roles/uvok_bird/tasks/main.yml
@@ -1,12 +1,24 @@
---
# tasks file for uvok_bird
-- name: Ensure bird directory exists
+- name: Install routing software
+ package:
+ name:
+ - bird2
+ state: present
+- name: Ensure bird config directory exists
ansible.builtin.file:
path: '{{ uvok_bird_opts.config_dir }}'
state: directory
mode: '0750'
owner: 'bird'
group: 'bird'
+- name: Ensure bird log directory exists
+ ansible.builtin.file:
+ path: '/var/log/bird/'
+ state: directory
+ mode: '0750'
+ owner: 'bird'
+ group: 'bird'
- name: Install common templates
template:
src: '{{ item.src }}'
@@ -17,17 +29,32 @@
loop:
- { src: 'bird.conf.j2', dest: '{{ uvok_bird_opts.config_dir }}/bird.conf' }
- { src: 'defines.conf.j2', dest: '{{ uvok_bird_opts.config_dir }}/defines.conf' }
+ notify: configure bird
+- name: Copy remaining common files
+ copy:
+ src: files/{{ item }}
+ dest: '{{ uvok_bird_opts.config_dir }}/{{ item }}'
+ mode: '0640'
+ owner: 'bird'
+ group: 'bird'
+ loop:
+ - "common.conf"
+ - "logging.conf"
+ notify: configure bird
- name: Install clearnet templates
template:
- src: clearnet.conf.j2
- dest: '{{ uvok_bird_opts.config_dir }}/clearnet.conf'
+ src: '{{ item.src }}'
+ dest: '{{ item.dest }}'
mode: '0640'
owner: 'bird'
group: 'bird'
when:
- uvok_bird_opts.clearnet
+ loop:
+ - { src: 'clearnet.conf.j2', dest: '{{ uvok_bird_opts.config_dir }}/clearnet.conf' }
+ - { src: 'clear_defines.conf.j2', dest: '{{ uvok_bird_opts.config_dir }}/clear_defines.conf' }
notify: configure bird
-- name: Copy remaining files
+- name: Copy remaining clearnet files
copy:
src: files/{{ item }}
dest: '{{ uvok_bird_opts.config_dir }}/{{ item }}'
@@ -35,6 +62,26 @@
owner: 'bird'
group: 'bird'
loop:
- - "common.conf"
- - "logging.conf"
+ - "clear_functions.conf"
+ when:
+ - uvok_bird_opts.clearnet
notify: configure bird
+- name: Ensure bird peer directory exists
+ ansible.builtin.file:
+ path: '{{ uvok_bird_opts.config_dir }}/clear_peers/'
+ state: directory
+ mode: '0750'
+ owner: 'bird'
+ group: 'bird'
+ when:
+ - uvok_bird_opts.clearnet
+- name: Remove clearnet config files
+ ansible.builtin.file:
+ path: '{{ item }}'
+ state: absent
+ loop:
+ - '{{ uvok_bird_opts.config_dir }}/clearnet.conf'
+ - '{{ uvok_bird_opts.config_dir }}/clear_defines.conf'
+ - '{{ uvok_bird_opts.config_dir }}/clear_functions.conf'
+ when:
+ - not uvok_bird_opts.clearnet