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