AETHER-918 Initial commit of BIRD role
Change-Id: I00d3d893c2c571bb69aac3580f27e26afa0313fb
diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml
new file mode 100644
index 0000000..0c3455c
--- /dev/null
+++ b/molecule/default/converge.yml
@@ -0,0 +1,46 @@
+---
+# bird molecule/default/verify.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+- name: Converge
+ hosts: all
+ vars:
+ bird_conf_filters:
+ gcp_tunnel_in: |
+ if (net ~ [ 10.168.0.0/20, 10.52.128.0/17, 10.45.128.0/17 ]) then accept;
+ else reject;
+ gcp_tunnel_out: |
+ if (net ~ [ 10.93.1.0/24, 10.92.1.0/24, 10.53.128.0/17 ]) then accept;
+ else reject;
+ bird_conf_templates:
+ - name: gcp_tunnel
+ protocol: bgp
+ options: |
+ keepalive time 20;
+ hold time 60;
+ graceful restart aware;
+
+ import filter gcp_tunnel_in;
+ import limit 10 action warn;
+
+ export filter gcp_tunnel_out;
+ export limit 10 action warn;
+ bird_conf_protocols:
+ - name: gcp_tunnel1
+ protocol: bgp
+ options: |
+ local 169.254.0.2 as 64521;
+ neighbor 169.254.0.1 as 64520;
+ template: gcp_tunnel
+ - name: gcp_tunnel2
+ protocol: bgp
+ options: |
+ local 169.254.0.6 as 64521;
+ neighbor 169.254.0.5 as 64520;
+ template: gcp_tunnel
+ tasks:
+ - name: "Include bird"
+ include_role:
+ name: "bird"
diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml
new file mode 100644
index 0000000..8e3d472
--- /dev/null
+++ b/molecule/default/molecule.yml
@@ -0,0 +1,21 @@
+---
+# strongswan molecule/default/molecule.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+dependency:
+ name: galaxy
+driver:
+ name: docker
+platforms:
+ - name: "ubuntu-18.04-priv"
+ image: "quay.io/paulfantom/molecule-systemd:ubuntu-18.04"
+ privileged: true
+ volumes:
+ - "/sys/fs/cgroup:/sys/fs/cgroup:ro"
+ user: root
+provisioner:
+ name: ansible
+verifier:
+ name: ansible
diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml
new file mode 100644
index 0000000..c6d5b36
--- /dev/null
+++ b/molecule/default/prepare.yml
@@ -0,0 +1,14 @@
+---
+# bird molecule/default/prepare.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+- name: Prepare
+ hosts: all
+ vars:
+ pre_tasks:
+ - name: Install GPG to support adding apt repo keys
+ apt:
+ name: "gpg"
+ state: "present"
+ update_cache: true
diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml
new file mode 100644
index 0000000..2d7e635
--- /dev/null
+++ b/molecule/default/verify.yml
@@ -0,0 +1,33 @@
+---
+# bird molecule/default/verify.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+- name: Verify
+ hosts: all
+ tasks:
+ - name: Gather package facts
+ package_facts:
+ manager: auto
+
+ - name: Verify BIRD is installed
+ assert:
+ that: "'{{ item }}' in ansible_facts.packages"
+ with_items:
+ - bird
+
+ - name: Verify BIRD daemon operation
+ command: birdc show status
+ register: bird_health
+ changed_when: false
+ failed_when: "'Daemon is up and running' not in bird_health.stdout"
+
+ - name: Verify BIRD configuration
+ command: birdc show protocols
+ register: bird_conf
+ changed_when: false
+ failed_when: item not in bird_conf.stdout
+ with_items:
+ - gcp_tunnel1
+ - gcp_tunnel2