Skip to content

Commit cf7a45f

Browse files
committed
use seperate lists to store default and user defined import/export paths to prevent overwrites
1 parent befa9b2 commit cf7a45f

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

src/roles/pulp/defaults/main.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ pulp_api_service_worker_count: "{{ ([4, ansible_facts['processor_nproc']] | min)
1313
pulp_volumes: >-
1414
{{
1515
['/var/lib/pulp:/var/lib/pulp'] +
16-
(pulp_import_paths | map('regex_replace', '^(.+)$', '\1:\1') | list) +
17-
(pulp_export_paths | map('regex_replace', '^(.+)$', '\1:\1') | list)
16+
((pulp_default_import_paths + pulp_import_paths) | map('regex_replace', '^(.+)$', '\1:\1') | list) +
17+
((pulp_default_export_paths + pulp_export_paths) | map('regex_replace', '^(.+)$', '\1:\1') | list)
1818
}}
1919
2020
pulp_api_container_name: pulp-api
@@ -26,8 +26,10 @@ pulp_pulp_url: "http://{{ ansible_facts['fqdn'] }}:24817"
2626

2727
pulp_enable_analytics: false
2828

29-
pulp_import_paths: ["/var/lib/pulp/sync_imports", "/var/lib/pulp/imports"]
30-
pulp_export_paths: ["/var/lib/pulp/exports"]
29+
pulp_default_import_paths: ["/var/lib/pulp/sync_imports", "/var/lib/pulp/imports"]
30+
pulp_default_export_paths: ["/var/lib/pulp/exports"]
31+
pulp_import_paths: []
32+
pulp_export_paths: []
3133

3234
pulp_default_plugins:
3335
- pulp_certguard
@@ -74,9 +76,9 @@ pulp_settings_other_env:
7476
PULP_TOKEN_AUTH_DISABLED: "true"
7577
PULP_FLATPAK_INDEX: "true"
7678
PULP_ALLOWED_IMPORT_PATHS: >-
77-
{{ pulp_import_paths }}
79+
{{ pulp_default_import_paths + pulp_import_paths }}
7880
PULP_ALLOWED_EXPORT_PATHS: >-
79-
{{ pulp_export_paths }}
81+
{{ pulp_default_export_paths + pulp_export_paths }}
8082
PULP_ALLOWED_CONTENT_CHECKSUMS: >-
8183
['sha1', 'sha224', 'sha256', 'sha384', 'sha512']
8284

src/roles/pulp/tasks/main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
path: "{{ item }}"
4343
state: directory
4444
mode: "0755"
45-
loop: "{{ pulp_import_paths }}"
45+
loop: "{{ pulp_default_import_paths + pulp_import_paths }}"
4646

4747
- name: Create export directories
4848
ansible.builtin.file:
4949
path: "{{ item }}"
5050
state: directory
5151
mode: "0755"
52-
loop: "{{ pulp_export_paths }}"
52+
loop: "{{ pulp_default_export_paths + pulp_export_paths }}"
5353

5454
- name: Create DB password secret
5555
containers.podman.podman_secret:

0 commit comments

Comments
 (0)