Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions etc/kayobe/containers/pulp/pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,24 @@
dest: /opt/kayobe/containers/pulp/settings.py
mode: 0644
become: true

- name: Configure TLS for local Pulp
when: pulp_enable_tls | bool
become: true
block:
- name: Ensure /opt/kayobe/containers/pulp/certs exists
file:
path: "/opt/kayobe/containers/pulp/certs"
state: directory

- name: Copy TLS cert and key into container directory
template:
src: "{{ item.src }}"
dest: "/opt/kayobe/containers/pulp/certs/{{ item.dest }}"
mode: 0644
become: true
loop:
- src: "{{ pulp_cert_path }}"
dest: 'pulp_webserver.crt'
- src: "{{ pulp_key_path }}"
dest: 'pulp_webserver.key'
20 changes: 18 additions & 2 deletions etc/kayobe/pulp.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
---
###############################################################################
# Local Pulp access credentials
# Local Pulp server configuration

# Base URL of the local Pulp service.
# Default uses the seed node's IP on the admin network.
pulp_url: "http://{{ admin_oc_net_name | net_ip(groups['seed'][0]) }}:80"
pulp_url: "{{ 'https' if pulp_enable_tls | bool else 'http' }}://{{ admin_oc_net_name | net_ip(groups['seed'][0]) }}:{{ pulp_port }}"

# Port on the seed node's interface on the admin network that the Pulp service
# listens on.
pulp_port: "{{ '443' if pulp_enable_tls | bool else '80' }}"

# Whether to enable TLS for Pulp.
pulp_enable_tls: false

# Path to a TLS certificate to use when TLS is enabled.
#pulp_cert_path:

# Path to a TLS key to use when TLS is enabled.
#pulp_key_path:

###############################################################################
# Local Pulp access credentials

# Credentials used to access the local Pulp REST API.
pulp_username: admin
Expand Down
2 changes: 1 addition & 1 deletion etc/kayobe/seed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ seed_pulp_container:
image: pulp/pulp
pre: "{{ kayobe_config_path }}/containers/pulp/pre.yml"
post: "{{ kayobe_config_path }}/containers/pulp/post.yml"
tag: "3.21"
tag: "{{ '3.21-https' if pulp_enable_tls | bool else '3.21' }}"
network_mode: host
# Override deploy_containers_defaults.init == true to ensure
# s6-overlay-suexec starts as pid 1
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/local-pulp-tls-a8e7464d8cb0d114.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
features:
- |
Enable TLS for the Seed Pulp service. Set ``pulp_enable_tls: true`` and
provide paths to a TLS certificate and key using ``pulp_cert_path`` and
``pulp_key_path`` respectively.