zuul-jobs/roles/ensure-package-repositories
Sorin Sbarnea 0eaa5cf59a Upgrade ansible-lint to 5.0
- bumps ansible-lint to 5.0
- updates our custom rules to make them compatible with 5.0
- replace custom module mocking with native ansible-lint ones
- remove custom call of ansible-playbook --syntax-check as now this
  is done by ansible-lint
- assured molecule vars are hosted under a vars/ folder in order to
  avoid confusing linter detection.
- replaced custom rule for loop var names in role as now this this an
  optional core feature of the linter (see config)
- replaced custom rule no-same-owner with opt-in one (see config)

Change-Id: I233fae8c9036d295968a97ee80e07fde8846c633
2021-03-17 15:44:43 +00:00
..
defaults ensure-package-repositories: Add role 2020-05-01 15:49:21 +02:00
tasks Upgrade ansible-lint to 5.0 2021-03-17 15:44:43 +00:00
README.rst ensure-package-repositories: Add role 2020-05-01 15:49:21 +02:00

Ensure that package manager repositories are installed. This role works with the pattern of including variables for different operating systems.

Note

This role currently only supports RPM and DEB based distributions.

Example use for Debian and Ubuntu:

- name: Add all repositories
  include_role:
    name: ensure-package-repositories
  vars:
    repositories_keys:
      - url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
    repositories_list:
      - repo: deb-src https://deb.nodesource.com/node_6.x {{ ansible_distribution_release }} main
      - repo: deb https://deb.nodesource.com/node_6.x {{ ansible_distribution_release }} main

Example use for Fedora and Red Hat:

_docker_keys:
  - data: |
      -----BEGIN PGP PUBLIC KEY BLOCK-----
      ...
      -----END PGP PUBLIC KEY BLOCK-----

_docker_repos:
  - name: docker-ce-stable
    description: Docker CE Stable - $basearch
    baseurl: "{{ docker_mirror_base_url }}/$releasever/$basearch/stable"
    gpgcheck: yes

- name: Add all repositories
      include_role:
        name: ensure-package-repositories
      vars:
        repositories_keys: "{{ _docker_keys }}"
        repositories_list: "{{ _docker_repos }}"

Example use for openSUSE and SUSE Linux:

_docker_keys:
  - data: |
      -----BEGIN PGP PUBLIC KEY BLOCK-----
      ...
      -----END PGP PUBLIC KEY BLOCK-----

_docker_repos:
  - name: docker-ce-stable
    description: Docker CE Stable - $basearch
    uri: "{{ docker_mirror_base_url }}/$releasever/$basearch/stable.repo"

- name: Add all repositories
      include_role:
        name: ensure-package-repositories
      vars:
        repositories_keys: "{{ _docker_keys }}"
        repositories_list: "{{ _docker_repos }}"

Role Variables