Skip to content

Commit

Permalink
add satellite_repositories role
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Mar 22, 2022
1 parent 9051852 commit ba6ab3e
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 0 deletions.
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.10'
```
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") }}'
16 changes: 16 additions & 0 deletions roles/satellite_repositories/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- 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: Set Satellite version dependent variables
include_vars: "satellite_{{ satellite_repositories_version }}.yml"

- name: Configure repositories
community.general.rhsm_repository:
name: "{{ satellite_base_repositories + satellite_server_repositories }}"
purge: true
10 changes: 10 additions & 0 deletions roles/satellite_repositories/vars/el7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
satellite_base_repositories:
- rhel-7-server-rpms
- rhel-server-rhscl-7-rpms
- rhel-7-server-satellite-maintenance-{{ satellite_repositories_maintenance_version }}-rpms
- rhel-7-server-ansible-{{ satellite_repositories_ansible_version }}-rpms
satellite_server_repositories:
- rhel-7-server-satellite-{{ satellite_repositories_version }}-rpms
satellite_capsule_repositories:
- rhel-7-server-satellite-capsule-{{ satellite_repositories_version }}-rpms
10 changes: 10 additions & 0 deletions roles/satellite_repositories/vars/el8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
satellite_base_repositories:
- rhel-8-for-x86_64-baseos-rpms
- rhel-8-for-x86_64-appstream-rpms
- satellite-maintenance-{{ satellite_repositories_maintenance_version }}-for-rhel-8-x86_64-rpms
- ansible-{{ satellite_repositories_ansible_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
3 changes: 3 additions & 0 deletions roles/satellite_repositories/vars/satellite_6.10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
satellite_repositories_ansible_version: '2.9'
satellite_repositories_maintenance_version: '6'
3 changes: 3 additions & 0 deletions roles/satellite_repositories/vars/satellite_6.11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
satellite_repositories_ansible_version: '2.9'
satellite_repositories_maintenance_version: '6.11'

0 comments on commit ba6ab3e

Please sign in to comment.