Skip to content

Commit

Permalink
add pulp services
Browse files Browse the repository at this point in the history
  • Loading branch information
archanaserver committed Oct 15, 2024
1 parent 2df4338 commit 6f2e282
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
13 changes: 13 additions & 0 deletions roles/pulp/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
---
pulp_image: quay.io/pulp/pulp:stable
pulp_api_image: quay.io/pulp/pulp-minimal:stable
pulp_content_image: quay.io/pulp/pulp-minimal:stable

pulp_ports:
- "8080:80"

pulp_api_ports:
- "24817:80"

pulp_content_ports:
- "24816:80"

pulp_volumes:
- /var/lib/pulp/settings:/etc/pulp:Z
- /var/lib/pulp/pulp_storage:/var/lib/pulp:Z
- /var/lib/pulp/pgsql:/var/lib/pgsql:Z
- /var/lib/pulp/containers:/var/lib/containers:Z

pulp_container_name: pulp
pulp_api_container_name: pulp-api
pulp_content_container_name: pulp-content
38 changes: 38 additions & 0 deletions roles/pulp/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
name: "{{ pulp_image }}"
state: present

- name: Pull the Pulp API container image
containers.podman.podman_image:
name: "{{ pulp_api_image }}"
state: present

- name: Pull the Pulp Content container image
containers.podman.podman_image:
name: "{{ pulp_content_image }}"
state: present

- name: Create Pulp storage
ansible.builtin.file:
path: "{{ item | split(':') | first }}"
Expand All @@ -24,6 +34,22 @@
volumes: "{{ pulp_volumes }}"
secrets:
- 'pulp-settings-py,type=mount,target=/etc/pulp/settings.py'

- name: Deploy Pulp API Container
containers.podman.podman_container:
name: "{{ pulp_api_container_name }}"
image: "{{ pulp_api_image }}"
state: quadlet
ports: "{{ pulp_api_ports }}"
volumes: "{{ pulp_volumes }}"

- name: Deploy Pulp Content Container
containers.podman.podman_container:
name: "{{ pulp_content_container_name }}"
image: "{{ pulp_content_image }}"
state: quadlet
ports: "{{ pulp_content_ports }}"
volumes: "{{ pulp_volumes }}"

- name: Run daemon reload to make Quadlet create the service files
ansible.builtin.systemd:
Expand All @@ -41,6 +67,18 @@
port: 8080
timeout: 300

- name: Wait for Pulp API service to be accessible
wait_for:
host: "{{ ansible_hostname }}"
port: 24817
timeout: 300

- name: Wait for Pulp Content service to be accessible
wait_for:
host: "{{ ansible_hostname }}"
port: 24816
timeout: 300

# Only needed until we have cert auth configured
- name: Set Pulp admin password
containers.podman.podman_container_exec:
Expand Down

0 comments on commit 6f2e282

Please sign in to comment.