Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add satellite_repositories role #16

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions roles/satellite_repositories/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
redhat.satellite_operations.satellite_repositories
==================================================

Configure repositories required for deploying Satellite

Role Variables
--------------

Required:

- `satellite_repositories_version`: The version of Satellite to enable repositories for

Optional:

- `satellite_repositories_type`: Enable repositories for `satellite` (default) or `capsule`

Example Playbooks
-----------------

Configure repositories for Satellite 6.10:

```yaml
- hosts: target-host
roles:
- role: redhat.satellite_operations.satellite_repositories
vars:
satellite_repositories_version: '6.13'
```
3 changes: 3 additions & 0 deletions roles/satellite_repositories/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
satellite_repositories_type: satellite
satellite_repositories_version: '{{ undef(hint="You must specify the Satellite version") }}'
13 changes: 13 additions & 0 deletions roles/satellite_repositories/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- name: Check that necessary variables are defined
assert:
that:
- satellite_repositories_version is defined

- name: Set OS version dependent variables
include_vars: "el{{ ansible_distribution_major_version }}.yml"

- name: Configure repositories

Check failure on line 10 in roles/satellite_repositories/tasks/main.yml

View workflow job for this annotation

GitHub Actions / lint

syntax-check[specific]

couldn't resolve module/action 'community.general.rhsm_repository'. This often indicates a misspelling, missing collection, or incorrect module path.

Check failure on line 10 in roles/satellite_repositories/tasks/main.yml

View workflow job for this annotation

GitHub Actions / lint

syntax-check[specific]

couldn't resolve module/action 'community.general.rhsm_repository'. This often indicates a misspelling, missing collection, or incorrect module path.
community.general.rhsm_repository:
name: "{{ satellite_base_repositories + satellite_server_repositories }}"
purge: true
9 changes: 9 additions & 0 deletions roles/satellite_repositories/vars/el8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
satellite_base_repositories:
- rhel-8-for-x86_64-baseos-rpms
- rhel-8-for-x86_64-appstream-rpms
- satellite-maintenance-{{ satellite_repositories_version }}-for-rhel-8-x86_64-rpms
satellite_server_repositories:
- satellite-{{ satellite_repositories_version }}-for-rhel-8-x86_64-rpms
satellite_capsule_repositories:
- satellite-capsule-{{ satellite_repositories_version }}-for-rhel-8-x86_64-rpms
Loading