Skip to content

Commit 15579c3

Browse files
committed
use pulp_server as a group
1 parent a9e6959 commit 15579c3

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

ansible/adhoc/deploy-pulp.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
# Usage: ansible-playbook ansible/adhoc/deploy-pulp.yml -e "pulp_server=<pulp server hostname>"
22

3-
- name: Add temporary pulp server host
4-
hosts: localhost
5-
tasks:
6-
- ansible.builtin.add_host:
7-
name: "{{ pulp_server }}"
8-
group: "_pulp_host"
9-
10-
- name: Install pulp on server and add to config
3+
- name: Install pulp on server
114
become: yes
12-
hosts: _pulp_host
5+
hosts: pulp_server # TODO: add this to common/groups
136
tasks:
147
- name: Install pulp
158
ansible.builtin.include_role:
@@ -22,5 +15,5 @@
2215
debug:
2316
msg: |
2417
Server configured, override 'appliances_pulp_url' with
25-
appliances_pulp_url: "http://{{ pulp_server }}:{{ pulp_site_port }}"
26-
in your environments
18+
appliances_pulp_url: "http://{{ hostvars[groups['pulp_server'] | first].ansible_host }}:{{ pulp_site_port }}"
19+
(or the correct IP if multi-homed) in your environments

ansible/roles/pulp_site/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pulp_site_rpm_info:
2828
subpath: "{{ appliances_pulp_repos.openhpc_updates[pulp_site_target_distribution_version_major] | appliances_repo_to_subpath }}"
2929
- name: "ceph-{{ pulp_site_target_distribution_version_major }}-{{ appliances_pulp_repos.ceph[pulp_site_target_distribution_version_major].timestamp }}"
3030
subpath: "{{ appliances_pulp_repos.ceph[pulp_site_target_distribution_version_major] | appliances_repo_to_subpath }}"
31-
- name: "grafana-{{ pulp_site_target_distribution_version_major }}-{{ appliances_pulp_repos.grafana.timestamp[pulp_site_target_distribution_version_major].timestamp }}
31+
- name: "grafana-{{ pulp_site_target_distribution_version_major }}-{{ appliances_pulp_repos.grafana[pulp_site_target_distribution_version_major].timestamp }}"
3232
subpath: "{{ appliances_pulp_repos.grafana[pulp_site_target_distribution_version_major] | appliances_repo_to_subpath }}"
3333

3434
pulp_site_rpm_repo_defaults:

docs/experimental/pulp.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,24 @@ In order to ensure reproducible builds, the appliance can build images using rep
55
## Deploying/configuring Pulp Server
66

77
### Deploying a Pulp server
8-
A playbook is provided to install and configure a Pulp server on a given host. Admin credentials for this server are automatically generated through the `ansible/adhoc/generate-passwords.yml` playbook. This can be run with
9-
`ansible-playbook ansible/adhoc/deploy-pulp.yml -e "pulp_server=<target_host>"`
10-
where `target_host` is any resolvable host. This will print a Pulp URL which can be copied to your environments as appropriate. Ensure that the server is accessible on the specified port. Note access to this server's content isn't authenticated so assumes the server is deployed behind a secure network.
8+
A playbook is provided to install and configure a Pulp server on a given host. Admin credentials for this server are automatically generated through the `ansible/adhoc/generate-passwords.yml` playbook. To use this, create an inventory file defining a group `pulp_server` containing a single host. The hostvar `ansible_host` should be defined, giving the IP address Ansible should use for ssh.
9+
10+
**TODO: example inventory file**
11+
12+
Once complete, it will print a message giving a value to set for `appliances_pulp_url`, assuming the `ansible_host` address is also the address the cluster
13+
should use to reach the Pulp server.
14+
15+
**TODO: example config**
16+
17+
Note access to this server's content isn't authenticated so this assumes the `pulp_server` host is not externall reachable.
18+
19+
**TODO: You can actually do this using additional_nodes now, how would we make the pulp store persistant?**
1120

1221
### Using an existing Pulp server
1322
An existing Pulp server can be used to host Ark repos by overriding `pulp_site_password` and `appliances_pulp_url` in the target environment. Note that this assumes the same configuration as the appliance deployed Pulp i.e no content authentication.
1423

1524
## Syncing Pulp content with Ark
1625

17-
If the `pulp` group is added to the Packer build groups, the local Pulp server will be synced with Ark on build. You must authenticate with Ark by overriding `pulp_site_upstream_username` and `pulp_site_upstream_password` with your vault encrypted Ark dev credentials. `dnf_repos_username` and `dnf_repos_password` must remain unset to access content from the local Pulp. Content can also be synced by running `ansible/adhoc/sync-pulp.yml`. By default this syncs repositories for Rocky 9.5 with x86_64 architecture, but can be overridden by setting extra variables for `pulp_site_target_arch`, `pulp_site_target_distribution`, `pulp_site_target_distribution_version` and `pulp_site_target_distribution_version_major`.
26+
If the `pulp` group is added to the Packer build groups, the local Pulp server will be synced with Ark on build. You must authenticate with Ark by overriding `pulp_site_upstream_username` and `pulp_site_upstream_password` with your vault encrypted Ark dev credentials. `dnf_repos_username` and `dnf_repos_password` must remain unset to access content from the local Pulp.
27+
28+
Content can also be synced by running `ansible/adhoc/sync-pulp.yml`. By default this syncs repositories for Rocky 9.5 <TODO: is this correct?> but this can be overridden by setting extra variables for `pulp_site_target_arch`, `pulp_site_target_distribution`, `pulp_site_target_distribution_version` and `pulp_site_target_distribution_version_major`.

0 commit comments

Comments
 (0)