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/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