Skip to content

Commit 530ecf7

Browse files
committed
Added pulp systemd file + removed unused vars
1 parent d463fed commit 530ecf7

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

ansible/roles/pulp_site/defaults/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ pulp_site_password: "{{ vault_pulp_admin_password }}"
66
# pulp_site_upstream_username:
77
# pulp_site_upstream_password:
88
pulp_site_upstream_content_url: https://ark.stackhpc.com/pulp/content
9-
pulp_site_default_upstream_suffix: "{{ pulp_site_target_arch }}/os"
10-
pulp_site_validate_certs: false
119
pulp_site_install_dir: '/home/rocky/pulp'
1210
pulp_site_selinux_suffix: "{{ ':Z' if ansible_selinux.status == 'enabled' else '' }}"
1311
pulp_site_target_facts: "{{ hostvars[groups['pulp'][0]]['ansible_facts'] }}"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Adapted from https://grimoire.carcano.ch/blog/installing-pulp3-as-a-container/
2+
[Unit]
3+
Description=Pulp
4+
Wants=syslog.service
5+
6+
[Service]
7+
Restart=always
8+
ExecStart=/usr/bin/podman start -a pulp
9+
ExecStop=/usr/bin/podman stop -t 15 pulp
10+
11+
[Install]
12+
WantedBy=multi-user.target

ansible/roles/pulp_site/tasks/install.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,21 @@
3232
- "{{ 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
35+
state: present
3536

37+
- name: Create systemd file
38+
copy:
39+
src: pulp.service
40+
dest: /etc/systemd/system/pulp.service
41+
register: _pulp_service
42+
43+
- name: Start Pulp service
44+
systemd:
45+
name: pulp
46+
state: "{{ 'started' if _pulp_service.changed else 'restarted' }}"
47+
daemon_reload: "{{ _pulp_service.changed }}"
48+
enabled: true
49+
3650
- name: Reset admin password once container has initialised
3751
no_log: true
3852
ansible.builtin.shell:

docs/experimental/pulp.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Note access to this server's content isn't authenticated so this assumes the `pu
1919

2020
**TODO: You can actually do this using additional_nodes now, how would we make the pulp store persistant?**
2121
**TODO: don't advise that, we want single server for all environments**
22-
**TODO: Add a systemd unit to run pulp!**
2322

2423
### Using an existing Pulp server
2524
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.

0 commit comments

Comments
 (0)