Skip to content

Commit 7a0eab3

Browse files
committed
added READMEs + updated variable names
1 parent 530ecf7 commit 7a0eab3

File tree

5 files changed

+90
-10
lines changed

5 files changed

+90
-10
lines changed

ansible/roles/dnf_repos/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
dnf_repos
2+
=========
3+
4+
Modifies repo definitions for repofiles in `/etc/yum.repos.d` to point to snapshots in StackHPC's Ark Pulp server.
5+
6+
Requirements
7+
------------
8+
9+
Requires Ark credentials.
10+
11+
Role Variables
12+
--------------
13+
14+
Variables in this role are also required by `pulp_site` so set in
15+
`environments/common/inventory/groups_vars/all/dnf_repos.yml`. See that file for detailed default values.
16+
17+
- `dnf_repos_all`: Dict of dicts containing information to construct URLs for timestamped repos from Ark for each Rocky version. For example:
18+
```
19+
dnf_repos_all:
20+
appstream: # yum_repository:name
21+
'8.10': # ansible_distribution_version or ansible_distribution_major_version
22+
repo_file: Rocky-AppStream # yum_repository: file
23+
# repo_name: # optional, override yum_repository:name
24+
pulp_path: rocky/8.10/AppStream/x86_64/os
25+
pulp_timestamp: 20250614T013846
26+
# pulp_content_url: # optional, dnf_repos_pulp_content_url
27+
'9.6':
28+
...
29+
```
30+
- `dnf_repos_default`: Appliance default repos to use Ark snapshots for. Follows same format as
31+
`dnf_repos_all`, but includes top level keys to allow repos to be conditionally included in
32+
`dnf_repos_all`. See `environments/common/inventory/group_vars/all/dnf_repos.yml` and
33+
`environments/common/inventory/group_vars/all/timestamps.yml` for full templating logic.
34+
- `dnf_repos_extra`: Additional repos to use Ark snapshots for. Follows same format as
35+
`dnf_repos_all`. Defaults to `{}`
36+
- `dnf_repos_no_epel`: Dict of all repos included in `dnf_repos_all` excluding
37+
`epel`, used to prevent conflicts with repofile installed by `epel-release`
38+
- `dnf_repos_default_epel`: Dict of repos objects following same format as `dnf_repos_all` but only
39+
including `epel` repo.
40+
- `dnf_repos_pulp_content_url`: Optional str. Content URL of Pulp server to use Ark snapshots from.
41+
Should be overriden if using local Pulp server instead of upstream Ark Pulp (See
42+
`ansible/roles/pulp_site`). Defaults to `{{ appliances_pulp_url }}/pulp/content`
43+
- `dnf_repos_username`: Optional str. Username for Ark. Should be set if using upstream StackHPC Ark
44+
Pulp server, but omitted if using local Pulp server (see `ansible/roles/pulp_site`)
45+
- `dnf_repos_password`: Optional str. Password for Ark. Should be set if using upstream StackHPC Ark
46+
Pulp server, but omitted if using local Pulp server (see `ansible/roles/pulp_site`)

ansible/roles/pulp_site/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
pulp_site
2+
=========
3+
4+
Contains playbooks to deploy a Pulp server and sync its content with repo snapshots in
5+
StackHPC's Ark Pulp server
6+
7+
Requirements
8+
------------
9+
10+
Requires Ark credentials. The VM you are deploying Pulp on must allow ingress on `pulp_site_port`
11+
and not be externally accessible (as the Pulp server's content is unauthenticated).
12+
13+
Role Variables
14+
--------------
15+
16+
- `pulp_site_url`: Required str. The base url from which Pulp content will be hosted. Defaults to `{{ appliances_pulp_url }}`.
17+
Value to set for ``appliances_pulp_url` will be generated and output by the deploy.yml playbook.
18+
- `pulp_site_port`: Optional str. Port to serve Pulp server on. Defaults to `8080`.
19+
- `pulp_site_username`: Optional str. Admin username for the Pulp server. Defaults to `admin`.
20+
- `pulp_site_password`: Required str. Admin password for the Pulp server. Defaults to `{{ vault_pulp_admin_password }}`.
21+
- `pulp_site_upstream_username`: Required str. Username for accessing content from the upstream Ark Pulp server.
22+
- `pulp_site_upstream_password`: Required str. Password for upstream Ark Pulp server.
23+
- `pulp_site_upstream_content_url`: Optional str. Content URL of upstream Ark Pulp. Defaults to `https://ark.stackhpc.com/pulp/content`.
24+
- `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`.
25+
- `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.
26+
defaults to `{{ hostvars[groups['pulp'][0]]['ansible_facts'] }}`.
27+
- `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'] }}`.
28+
- `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`,
29+
`remote_password` and `policy` by default.
30+
- `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
31+
`dnf_repos_all`.
32+
- `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
33+
`dnf_repos_all`.
34+
- `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
35+
`dnf_repos_all`.

ansible/roles/pulp_site/defaults/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pulp_site_password: "{{ vault_pulp_admin_password }}"
77
# pulp_site_upstream_password:
88
pulp_site_upstream_content_url: https://ark.stackhpc.com/pulp/content
99
pulp_site_install_dir: '/home/rocky/pulp'
10-
pulp_site_selinux_suffix: "{{ ':Z' if ansible_selinux.status == 'enabled' else '' }}"
10+
_pulp_site_selinux_suffix: "{{ ':Z' if ansible_selinux.status == 'enabled' else '' }}"
1111
pulp_site_target_facts: "{{ hostvars[groups['pulp'][0]]['ansible_facts'] }}"
1212
pulp_site_target_distribution_version: "{{ pulp_site_target_facts['distribution_version'] }}" # TODO: how to set automatically?
1313

@@ -16,16 +16,16 @@ pulp_site_rpm_repo_defaults:
1616
remote_password: "{{ pulp_site_upstream_password }}"
1717
policy: on_demand
1818

19-
pulp_site_rpm_info: |
19+
_pulp_site_rpm_info: |
2020
{{
2121
dnf_repos_all |
2222
select_repos(pulp_site_target_distribution_version)
2323
}}
2424
pulp_site_rpm_repos: |
2525
{{
26-
pulp_site_rpm_info |
26+
_pulp_site_rpm_info |
2727
to_rpm_repos(pulp_site_upstream_content_url, pulp_site_rpm_repo_defaults)
2828
}}
2929
30-
pulp_site_rpm_publications: "{{ pulp_site_rpm_info | to_rpm_pubs }}"
31-
pulp_site_rpm_distributions: "{{ pulp_site_rpm_info | to_rpm_distros }}"
30+
pulp_site_rpm_publications: "{{ _pulp_site_rpm_info | to_rpm_pubs }}"
31+
pulp_site_rpm_distributions: "{{ _pulp_site_rpm_info | to_rpm_distros }}"

ansible/roles/pulp_site/tasks/install.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
publish:
2727
- "{{ pulp_site_port }}:80"
2828
volume:
29-
- "{{ pulp_site_install_dir }}/settings:/etc/pulp{{ pulp_site_selinux_suffix }}"
30-
- "{{ pulp_site_install_dir }}/pulp_storage:/var/lib/pulp{{ pulp_site_selinux_suffix }}"
31-
- "{{ pulp_site_install_dir }}/pgsql:/var/lib/pgsql{{ pulp_site_selinux_suffix }}"
32-
- "{{ pulp_site_install_dir }}/containers:/var/lib/containers{{ pulp_site_selinux_suffix }}"
29+
- "{{ pulp_site_install_dir }}/settings:/etc/pulp{{ _pulp_site_selinux_suffix }}"
30+
- "{{ pulp_site_install_dir }}/pulp_storage:/var/lib/pulp{{ _pulp_site_selinux_suffix }}"
31+
- "{{ pulp_site_install_dir }}/pgsql:/var/lib/pgsql{{ _pulp_site_selinux_suffix }}"
32+
- "{{ pulp_site_install_dir }}/containers:/var/lib/containers{{ _pulp_site_selinux_suffix }}"
3333
device: /dev/fuse
3434
image: docker.io/pulp/pulp:3.68.1
3535
state: present

environments/common/inventory/group_vars/all/dnf_repos.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ dnf_repos_default_epel: "{{ dnf_repos_default['epel'] }}"
1515
# pulp_path: rocky/8.10/AppStream/x86_64/os
1616
# pulp_timestamp: 20250614T013846
1717
# # pulp_content_url: # optional, dnf_repos_pulp_content_url
18-
# pulp_repo_name: appstream # pulp repository name
1918

2019
# Should be in same format as dnf_repos_default, except without the top level indexing keys e.g
2120
# dnf_repos_extra:

0 commit comments

Comments
 (0)