-
Notifications
You must be signed in to change notification settings - Fork 35
Refactor Pulp repo definitions and add more Pulp documentation #760
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
134b627
WIP: refactor repos definitions
sjpb 86f93ed
add more repos and cope with CRB/PowerTools oddness
sjpb a9e6959
add epel
sjpb 15579c3
use pulp_server as a group
sjpb 5c39a06
add epel default
sjpb 57784b7
wip: get pulp sync working
sjpb 2e3c4fd
Merge branch 'main' into refactor/regularise-pulp
wtripp180901 4aa9fee
fixed sync
wtripp180901 dd52e90
autodetect latest in adhoc script, refactored timestamps to allow gat…
wtripp180901 4854903
fixed distributions + ohpc repos
wtripp180901 c8635bb
updated timestamps script + bumped rocky 9 timestamps
wtripp180901 8f438b1
removed pulp_repo_name fields
wtripp180901 d463fed
updated docs, added gpg checks, simplified filters
wtripp180901 530ecf7
Added pulp systemd file + removed unused vars
wtripp180901 7a0eab3
added READMEs + updated variable names
wtripp180901 305a057
disabled gpg checks for dnf_repos
wtripp180901 1b4c867
typo
wtripp180901 767addd
fixed disable repos task
wtripp180901 8ad6869
bump images
wtripp180901 b5b3b39
remove dnf_repos extra index/key and make epel/openhpc special-cases …
sjpb 244a9ee
clarify pulp distro selection
sjpb 32278e7
fixup sync vars
sjpb a63fa1f
fixup grafana vars
sjpb 4580c2e
revert latest timestamp changes for extra key level
sjpb 4d412ec
Merge pull request #765 from stackhpc/dnf-repos-sjpb
wtripp180901 1405f3d
review suggestions
wtripp180901 dff68b4
updated README
wtripp180901 7253ad0
docs tweaks
wtripp180901 f5f2c0b
regularised group names
wtripp180901 ab2cfdf
updated operations guide for functionality requiring additional installs
wtripp180901 edb4e12
review changes from docs
wtripp180901 412baed
renamed timestamps.yml to dnf_repos_timestamps.yml
wtripp180901 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
dnf_repos | ||
========= | ||
|
||
Modifies repo definitions for repofiles in `/etc/yum.repos.d` to point to snapshots in StackHPC's Ark Pulp server or mirrors of them | ||
on a local Pulp server. | ||
|
||
Requirements | ||
------------ | ||
|
||
Requires Ark credentials if using StackHPC's upstream Ark server. | ||
|
||
Role Variables | ||
-------------- | ||
|
||
Variables in this role are also required by `pulp_site` so set in | ||
`environments/common/inventory/groups_vars/all/dnf_repos.yml`. See that file for detailed default values. | ||
|
||
- `dnf_repos_repos`: Dict of dicts containing information to construct URLs for Ark snapshots from the target Pulp server for each Rocky version. For example: | ||
``` | ||
dnf_repos_repos: | ||
appstream: # ansible.builtin.yum_repository:name | ||
'8.10': # ansible_distribution_version or ansible_distribution_major_version | ||
repo_file: Rocky-AppStream # yum_repository: file | ||
# repo_name: # optional, override yum_repository:name | ||
pulp_path: rocky/8.10/AppStream/x86_64/os # The subpath of the the upstream Ark server's content endpoint URL for the repo's snapshots, see https://ark.stackhpc.com/pulp/content/ | ||
pulp_timestamp: 20250614T013846 | ||
# pulp_content_url: # optional, dnf_repos_pulp_content_url | ||
'9.6': | ||
... | ||
``` | ||
- `dnf_repos_default`: Appliance default repos to use Ark snapshots for. Following same format as `dnf_repos_repos`. | ||
See for appliance default repo list `environments/common/inventory/group_vars/all/dnf_repo_timestamps.yml`. | ||
- `dnf_repos_extra`: Additional repos to use Ark snapshots for. Follows same format as | ||
`dnf_repos_repos`. Defaults to `{}` | ||
- `dnf_repos_pulp_content_url`: Optional str. Content URL of Pulp server to use Ark snapshots from. | ||
Defaults to `{{ appliances_pulp_url }}/pulp/content` | ||
- `dnf_repos_username`: Optional str. Username for Ark. Should be set if using upstream StackHPC Ark | ||
Pulp server, but omitted if using local Pulp server (see `ansible/roles/pulp_site`) | ||
- `dnf_repos_password`: Optional str. Password for Ark. Should be set if using upstream StackHPC Ark | ||
Pulp server, but omitted if using local Pulp server (see `ansible/roles/pulp_site`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,4 @@ | ||
dnf_repos_repos: {} # see environments/common/inventory/group_vars/all/{dnf_repos,timestamps}.yml | ||
dnf_repos_pulp_content_url: "{{ appliances_pulp_url }}/pulp/content" | ||
dnf_repos_username: "{{ omit }}" | ||
dnf_repos_password: "{{ omit }}" | ||
|
||
dnf_repos_filenames: | ||
'8': | ||
baseos: 'Rocky-BaseOS' | ||
appstream: 'Rocky-AppStream' | ||
crb: 'Rocky-PowerTools' | ||
extras: 'Rocky-Extras' | ||
grafana: 'grafana' | ||
'9': | ||
baseos: 'rocky' | ||
appstream: 'rocky' | ||
crb: 'rocky' | ||
extras: 'rocky-extras' | ||
grafana: 'grafana' | ||
|
||
dnf_repos_version_filenames: "{{ dnf_repos_filenames[ansible_distribution_major_version] }}" | ||
|
||
# epel installed separately | ||
dnf_repos_default_repolist: | ||
- file: "{{ dnf_repos_version_filenames.baseos }}" | ||
name: baseos | ||
base_url: "{{ dnf_repos_pulp_content_url }}/{{ appliances_pulp_repos.baseos[ansible_distribution_version] | appliances_repo_to_subpath }}" | ||
- file: "{{ dnf_repos_version_filenames.appstream }}" | ||
name: appstream | ||
base_url: "{{ dnf_repos_pulp_content_url }}/{{ appliances_pulp_repos.appstream[ansible_distribution_version] | appliances_repo_to_subpath }}" | ||
- file: "{{ dnf_repos_version_filenames.crb }}" | ||
name: "{{ 'powertools' if ansible_distribution_major_version == '8' else 'crb' }}" | ||
base_url: "{{ dnf_repos_pulp_content_url }}/{{ appliances_pulp_repos.crb[ansible_distribution_version] | appliances_repo_to_subpath }}" | ||
- file: "{{ dnf_repos_version_filenames.extras }}" | ||
name: extras | ||
base_url: "{{ dnf_repos_pulp_content_url }}/{{ appliances_pulp_repos.extras[ansible_distribution_version] | appliances_repo_to_subpath }}" | ||
- file: ceph | ||
name: Ceph | ||
base_url: "{{ dnf_repos_pulp_content_url }}/{{ appliances_pulp_repos.ceph[ansible_distribution_major_version] | appliances_repo_to_subpath }}" | ||
- file: "{{ dnf_repos_version_filenames.grafana }}" | ||
name: grafana | ||
base_url: "{{ dnf_repos_pulp_content_url }}/{{ appliances_pulp_repos.grafana[ansible_distribution_major_version] | appliances_repo_to_subpath }}" | ||
|
||
dnf_repos_openhpc_repolist: | ||
- name: OpenHPC | ||
file: OpenHPC | ||
base_url: "{{ dnf_repos_pulp_content_url }}/{{ appliances_pulp_repos.openhpc_base[ansible_distribution_major_version] | appliances_repo_to_subpath }}" | ||
- name: OpenHPC-updates | ||
file: OpenHPC | ||
base_url: "{{ dnf_repos_pulp_content_url }}/{{ appliances_pulp_repos.openhpc_updates[ansible_distribution_major_version] | appliances_repo_to_subpath }}" | ||
|
||
dnf_repos_extra_repolist: [] | ||
dnf_repos_repolist: "{{ dnf_repos_default_repolist + (dnf_repos_openhpc_repolist if (openhpc_install_type | default('ohpc')) == 'ohpc' else []) + dnf_repos_extra_repolist }}" | ||
|
||
dnf_repos_epel_baseurl: "{{ dnf_repos_pulp_content_url }}/{{ appliances_pulp_repos.epel[ansible_distribution_major_version] | appliances_repo_to_subpath }}" | ||
dnf_repos_epel_description: "epel" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,44 @@ | ||
--- | ||
|
||
- name: Replace system repos with Pulp repos | ||
- name: Replace non-epel repos with Pulp repos | ||
ansible.builtin.yum_repository: | ||
file: "{{ item.file }}" | ||
name: "{{ item.name }}" | ||
baseurl: "{{ item.base_url }}" | ||
description: "{{ item.name }}" | ||
file: "{{ repo_values.repo_file }}" | ||
name: "{{ repo_name }}" | ||
baseurl: "{{ repo_content_url }}/{{ repo_values.pulp_path }}/{{ repo_values.pulp_timestamp }}" | ||
description: "{{ repo_name }}" | ||
username: "{{ dnf_repos_username }}" | ||
password: "{{ dnf_repos_password }}" | ||
gpgcheck: false | ||
loop: "{{ dnf_repos_repolist }}" | ||
loop: "{{ dnf_repos_repos | dict2items }}" | ||
loop_control: | ||
label: "{{ repo_name }}[{{ repo_os }}]: {{ repo_values }}" | ||
when: repo_name != 'epel' | ||
vars: | ||
repo_os: "{{ ansible_distribution_version if ansible_distribution_version in item.value else ansible_distribution_major_version }}" | ||
repo_values: "{{ item.value[repo_os] }}" | ||
repo_name: "{{ repo_values.repo_name | default(item.key) }}" | ||
repo_content_url: "{{ repo_values.pulp_content_url | default(dnf_repos_pulp_content_url) }}" | ||
|
||
- name: Install epel-release | ||
# done so that roles installing epel via epel-release don't over-write our changes to the epel repo | ||
# So roles installing epel via epel-release don't overwrite changes to the epel repo below | ||
ansible.builtin.dnf: | ||
name: epel-release | ||
|
||
- name: Use Pulp EPEL repo | ||
- name: Replace epel repo with Pulp repo | ||
ansible.builtin.yum_repository: | ||
name: epel | ||
file: epel | ||
description: "{{ dnf_repos_epel_description }}" | ||
gpgcheck: false | ||
baseurl: "{{ dnf_repos_epel_baseurl }}" | ||
file: "{{ repo_values.repo_file }}" | ||
name: "{{ repo_name }}" | ||
baseurl: "{{ repo_content_url }}/{{ repo_values.pulp_path }}/{{ repo_values.pulp_timestamp }}" | ||
description: "{{ repo_name }}" | ||
username: "{{ dnf_repos_username }}" | ||
password: "{{ dnf_repos_password }}" | ||
gpgcheck: false | ||
loop: "{{ dnf_repos_repos | dict2items }}" | ||
loop_control: | ||
label: "{{ repo_name }}[{{ repo_os }}]: {{ repo_values }}" | ||
when: repo_name == 'epel' | ||
vars: | ||
repo_os: "{{ ansible_distribution_version if ansible_distribution_version in item.value else ansible_distribution_major_version }}" | ||
repo_values: "{{ item.value[repo_os] }}" | ||
repo_name: "{{ repo_values.repo_name | default(item.key) }}" | ||
repo_content_url: "{{ repo_values.pulp_content_url | default(dnf_repos_pulp_content_url) }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
pulp_site | ||
========= | ||
|
||
Contains playbooks to deploy a Pulp server and sync its content with repo snapshots in | ||
StackHPC's Ark Pulp server | ||
|
||
Requirements | ||
------------ | ||
|
||
Requires Ark credentials. The VM you are deploying Pulp on must allow ingress on `pulp_site_port` | ||
wtripp180901 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
and not be externally accessible (as the Pulp server's content is unauthenticated). Rocky Linux 9 has been | ||
tested as the target VM for deploying Pulp. | ||
|
||
Role Variables | ||
-------------- | ||
|
||
- `pulp_site_url`: Required str. The base url from which Pulp content will be hosted. Defaults to `{{ appliances_pulp_url }}`. | ||
Value to set for ``appliances_pulp_url` will be generated and output by the deploy.yml playbook. | ||
- `pulp_site_port`: Optional str. Port to serve Pulp server on. Defaults to `8080`. | ||
- `pulp_site_username`: Optional str. Admin username for the Pulp server. Defaults to `admin`. | ||
- `pulp_site_password`: Required str. Admin password for the Pulp server. Defaults to `{{ vault_pulp_admin_password }}`. | ||
- `pulp_site_upstream_username`: Required str. Username for accessing content from the upstream Ark Pulp server. | ||
- `pulp_site_upstream_password`: Required str. Password for upstream Ark Pulp server. | ||
- `pulp_site_upstream_content_url`: Optional str. Content URL of upstream Ark Pulp. Defaults to `https://ark.stackhpc.com/pulp/content`. | ||
- `pulp_site_install_dir`: Optional str. Directory on Pulp host to install config and persistent state to be mounted into Pulp container. Defaults to `/home/rocky/pulp`. | ||
- `pulp_site_target_facts`: Optional str. The `ansible_facts` of a host which will be pulling from your Pulp server, allowing the role to auto-discover the necessary repos to pull. | ||
defaults to `{{ hostvars[groups['pulp'][0]]['ansible_facts'] }}`. | ||
- `pulp_site_target_distribution_version`: Optional str. The Rocky Linux minor release to sync repos from Ark for. Defaults to `{{ pulp_site_target_facts['distribution_version'] }}`. | ||
- `pulp_site_rpm_repo_defaults`: Optional dict. Contains key value pairs for fields which are common to all repo definition in `pulp_site_rpm_repos`. Includes values for `remote_username`, | ||
`remote_password` and `policy` by default. | ||
- `pulp_site_rpm_repos`: Optional list of dicts. List of repo definitions in format required by the `stackhpc.pulp.pulp_repository`. Defaults to modified versions of repos defined in | ||
`dnf_repos_all`. | ||
- `pulp_site_rpm_publications`: Optional list of dicts. List of repo definitions in format required by the `stackhpc.pulp.pulp_publication`. Defaults to list of publications for repos defined in | ||
`dnf_repos_all`. | ||
- `pulp_site_rpm_distributions`: Optional list of dicts. List of repo definitions in format required by the `stackhpc.pulp.pulp_distribution`. Defaults to list of distributions for repos defined in | ||
`dnf_repos_all`. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.