On debian 11 don't use external APT repo
- Change apt gpg key operations to avoid deprecated apt-key command
- Backup config files on changes
- Metadata for galaxy
- Updates for newer ansible-lint
Change-Id: I5f9a75141dd64f867b81c899f1a2c933c51737d6
diff --git a/.reuse/dep5 b/.reuse/dep5
index 0dec132..c6dcb59 100644
--- a/.reuse/dep5
+++ b/.reuse/dep5
@@ -1,9 +1,9 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Files: .cookiecutter_params.json VERSION .gitreview
+Files: .cookiecutter_params.json VERSION .gitreview README.md
Copyright: 2020 Open Networking Foundation
License: Apache-2.0
-Files: files/bird_signing.key
+Files: files/bird-keyring.gpg
Copyright: GPG Key Data
License: CC0-1.0
diff --git a/Makefile b/Makefile
index e322f50..a7aa3f7 100644
--- a/Makefile
+++ b/Makefile
@@ -23,10 +23,13 @@
-d "{extends: default, rules: {line-length: {max: 99}}}" \
-s $(YAML_FILES)
+# List of molecule files, not including base molecule.yml which isn't ansible format
+MOLECULE_FILES ?= $(shell find molecule -type f -name '*.yml' \! -name 'molecule.yml' -print )
+
ansiblelint: ## lint check with ansible-lint
ansible-lint --version
ansible-lint -v .
- ansible-lint -v molecule/*/*
+ ansible-lint -v $(MOLECULE_FILES)
license: ## Check license with the reuse tool
reuse --version
diff --git a/README.md b/README.md
index 4fa792c..be178b8 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,3 @@
-<!--
-SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
-SPDX-License-Identifier: Apache-2.0
---!>
# bird
BIRD routing daemon
diff --git a/files/bird-keyring.gpg b/files/bird-keyring.gpg
new file mode 100644
index 0000000..666abf9
--- /dev/null
+++ b/files/bird-keyring.gpg
Binary files differ
diff --git a/files/bird_signing.key b/files/bird_signing.key
deleted file mode 100644
index 7f4d96b..0000000
--- a/files/bird_signing.key
+++ /dev/null
@@ -1,12 +0,0 @@
------BEGIN PGP PUBLIC KEY BLOCK-----
-
-xo0ETIeANwEEANdjpXTkGAlA4bu87Cj2B2+ZSanxRD/13yOAassyh0aF3KXbR/39
-aWZSt2WL13TwJ1qG0+83A46vcrbU1KqTaIteF0AAPUMsRJQPccsxyPZfMdW8pIy5
-0G4lwSHxbCizOOh1IGDUnskCfOl8iZ6yajBI2S8Fvh8ERhxbXUoMZ8JnABEBAAHN
-G0xhdW5jaHBhZCBEYXRvdsOpIHNjaHLDoW5recK1BBMBAgAgBQJMh4A3AhsDBgsJ
-CAcDAgQVAggDBBYCAwECHgECF4AACgkQ8jMSOPnFmkWqCgP4nMyuTUSJtRYMR1MF
-vgISz+woBx6n2AFdExtO4ujUpolLW2ghuHqyh9lA6t+8kgoFteWEzRoHfJIQqeXt
-Et6LcDWlE+gGF6Mw7x1RXsbrnBFZxWFqbyHQDKLmDMeVwP6mEdiLXtVPtyikPQRn
-BlEwzV4rReQnVnPimR8rYGnt/g==
-=wJ0A
------END PGP PUBLIC KEY BLOCK-----
diff --git a/meta/main.yml b/meta/main.yml
index 7822d06..1eb961f 100644
--- a/meta/main.yml
+++ b/meta/main.yml
@@ -5,6 +5,9 @@
# SPDX-License-Identifier: Apache-2.0
galaxy_info:
+ role_name: bird
+ namespace: onf
+
author: Open Networking Foundation
description: BIRD routing daemon
company: Open Networking Foundation
@@ -16,12 +19,15 @@
min_ansible_version: 2.9.5
platforms:
- - name: Ubuntu
+ - name: ubuntu
versions:
- - "16.04"
- - "18.04"
+ - bionic
+ - name: Debian
+ versions:
+ - bullseye
galaxy_tags:
- bird
+ - bgp
dependencies: []
diff --git a/tasks/Debian.yml b/tasks/Debian.yml
index 23453a6..7e390dc 100644
--- a/tasks/Debian.yml
+++ b/tasks/Debian.yml
@@ -4,19 +4,6 @@
# 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 }}"
diff --git a/tasks/Ubuntu_18.04.yml b/tasks/Ubuntu_18.04.yml
new file mode 100644
index 0000000..fcc8664
--- /dev/null
+++ b/tasks/Ubuntu_18.04.yml
@@ -0,0 +1,25 @@
+---
+# bird tasks/Ubuntu_18.04.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+- name: Copy BIRD repo GPG key for Ubuntu 18.04
+ ansible.builtin.copy:
+ src: bird-keyring.gpg
+ dest: /usr/share/keyrings/bird-keyring.gpg
+ owner: root
+ group: root
+ mode: 0644
+
+- name: Add BIRD apt repo for Ubuntu 18.04
+ apt_repository:
+ repo: >-
+ deb [arch=amd64 signed-by=/usr/share/keyrings/bird-keyring.gpg]
+ http://ppa.launchpad.net/cz.nic-labs/bird/{{ ansible_lsb['id'] | lower }}
+ {{ ansible_lsb['codename'] }} main
+ mode: 0644
+ update_cache: true
+
+- name: Continue with Debian tasks
+ include_tasks: "Debian.yml"
diff --git a/tasks/main.yml b/tasks/main.yml
index 3e9f150..e46e988 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -8,12 +8,17 @@
include_vars: "{{ ansible_os_family }}.yml"
- name: include OS-specific tasks
- include_tasks: "{{ ansible_os_family }}.yml"
+ include_tasks: "{{ item }}"
+ with_first_found:
+ - "{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml"
+ - "{{ ansible_distribution }}.yml"
+ - "{{ ansible_os_family }}.yml"
- name: Create BIRD configuration from template
template:
src: "bird.conf.j2"
dest: "/etc/bird/bird.conf"
+ backup: true
owner: "{{ bird_username }}"
group: "{{ bird_groupname }}"
mode: 0640