Skip to content

Commit

Permalink
Make certs dir configurable
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
fao89 committed Mar 8, 2022
1 parent e49d063 commit 6fc8430
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by Django 3.2.11 on 2022-02-25 20:39

from django.conf import settings
from django.db import migrations, models


Expand All @@ -13,6 +14,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='ansiblerepository',
name='keyring',
field=models.FilePathField(blank=True, path='/etc/pulp/certs/', recursive=True),
field=models.FilePathField(blank=True, path=settings.ANSIBLE_CERTS_DIR, recursive=True),
),
]
3 changes: 2 additions & 1 deletion pulp_ansible/app/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from logging import getLogger

from django.db import models
from django.conf import settings
from django.contrib.postgres import fields as psql_fields
from django.contrib.postgres import search as psql_search
from django.db.models import UniqueConstraint, Q
Expand Down Expand Up @@ -308,7 +309,7 @@ class AnsibleRepository(Repository):
REMOTE_TYPES = [RoleRemote, CollectionRemote]

last_synced_metadata_time = models.DateTimeField(null=True)
keyring = models.FilePathField(path="/etc/pulp/certs/", recursive=True, blank=True)
keyring = models.FilePathField(path=settings.ANSIBLE_CERTS_DIR, recursive=True, blank=True)

class Meta:
default_related_name = "%(app_label)s_%(model_name)s"
Expand Down
2 changes: 1 addition & 1 deletion pulp_ansible/app/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class AnsibleRepositorySerializer(RepositorySerializer):
help_text=_("Last synced metadata time."), allow_null=True, required=False
)
keyring = serializers.FilePathField(
path="/etc/pulp/certs/",
path=settings.ANSIBLE_CERTS_DIR,
help_text=_("Location of keyring used to verify signatures uploaded to this repository"),
allow_blank=True,
default="",
Expand Down
1 change: 1 addition & 0 deletions pulp_ansible/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
ANSIBLE_API_HOSTNAME = "https://" + socket.getfqdn()
ANSIBLE_CONTENT_HOSTNAME = settings.CONTENT_ORIGIN + "/pulp/content"
ANSIBLE_SIGNING_TASK_LIMITER = 10
ANSIBLE_CERTS_DIR = "/etc/pulp/certs/"

0 comments on commit 6fc8430

Please sign in to comment.