ansible-role-frrouting/tasks/frr_install_apt.yml
Dmitriy Rabotyagov b04bf138e4 Add ebgp policy definition for tests
According to RFC-8212 policies must be described in order to allow
announce/accept routes. Without policies being described, no routes
will be announced/recieved by default.

This patch fixes current CI failures.

Change-Id: Ia033cc7c3ed3146860ab96452bec988f3c3069bf
2024-02-23 16:05:20 +00:00

61 lines
1.7 KiB
YAML

---
# Copyright 2020, VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Install gpg tooling for key management
apt:
name: gnupg
state: present
register: _install_gpg
until: _install_gpg is success
retries: 5
delay: 2
- name: Add/Remove repositories gpg keys
apt_key:
id: "{{ key.id | default(omit) }}"
data: "{{ key.data | default(omit) }}"
keyserver: "{{ key.keyserver | default(omit) }}"
url: "{{ key.url | default(omit) }}"
state: "{{ key.state | default('present') }}"
with_items: "{{ frr_repos_keys }}"
loop_control:
loop_var: key
register: _add_apt_keys
until: _add_apt_keys is success
retries: 5
delay: 2
- name: Add/remove defined APT repositories
apt_repository:
repo: "{{ repo.repo }}"
state: "{{ repo.state | default('present') }}"
filename: "{{ repo.filename | default(omit) }}"
update_cache: false
with_items: "{{ frr_repos }}"
loop_control:
loop_var: repo
register: _adding_apt_repo
- name: Update Apt cache # noqa: no-handler
apt:
update_cache: true
when:
- _adding_apt_repo is changed
register: _update_apt_cache
until: _update_apt_cache is success
changed_when: false
retries: 5
delay: 2