AETHER-918 Initial commit of BIRD role
Change-Id: I00d3d893c2c571bb69aac3580f27e26afa0313fb
diff --git a/tasks/Debian.yml b/tasks/Debian.yml
new file mode 100644
index 0000000..23453a6
--- /dev/null
+++ b/tasks/Debian.yml
@@ -0,0 +1,32 @@
+---
+# bird tasks/Debian.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+# Docs: https://launchpad.net/~cz.nic-labs/+archive/ubuntu/bird
+- name: Add BIRD apt repo key
+ apt_key:
+ data: "{{ lookup('file','bird_signing.key') }}"
+ state: "present"
+
+- name: Add BIRD package repo
+ apt_repository:
+ repo: >-
+ deb http://ppa.launchpad.net/cz.nic-labs/bird/{{ ansible_lsb['id'] | lower }}
+ {{ ansible_lsb['codename'] }} main
+ update_cache: true
+
+- name: Install BIRD packages (Debian)
+ apt:
+ name: "{{ bird_package }}"
+ state: "present"
+ update_cache: true
+ cache_valid_time: 3600
+ notify:
+ - start-bird
+
+- name: Enable BIRD Service
+ service:
+ name: "{{ bird_service }}"
+ enabled: true
diff --git a/tasks/main.yml b/tasks/main.yml
new file mode 100644
index 0000000..3e9f150
--- /dev/null
+++ b/tasks/main.yml
@@ -0,0 +1,21 @@
+---
+# bird tasks/main.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+- name: include OS-specific vars
+ include_vars: "{{ ansible_os_family }}.yml"
+
+- name: include OS-specific tasks
+ include_tasks: "{{ ansible_os_family }}.yml"
+
+- name: Create BIRD configuration from template
+ template:
+ src: "bird.conf.j2"
+ dest: "/etc/bird/bird.conf"
+ owner: "{{ bird_username }}"
+ group: "{{ bird_groupname }}"
+ mode: 0640
+ notify:
+ - reload-bird