Skip to content

Commit ebc3643

Browse files
authored
Merge pull request #343 from stackhpc/local-pulp-tls
Configure TLS for local Pulp
2 parents 1a9e9f3 + 6415693 commit ebc3643

File tree

4 files changed

+46
-3
lines changed

4 files changed

+46
-3
lines changed

etc/kayobe/containers/pulp/pre.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,24 @@
1919
dest: /opt/kayobe/containers/pulp/settings.py
2020
mode: 0644
2121
become: true
22+
23+
- name: Configure TLS for local Pulp
24+
when: pulp_enable_tls | bool
25+
become: true
26+
block:
27+
- name: Ensure /opt/kayobe/containers/pulp/certs exists
28+
file:
29+
path: "/opt/kayobe/containers/pulp/certs"
30+
state: directory
31+
32+
- name: Copy TLS cert and key into container directory
33+
template:
34+
src: "{{ item.src }}"
35+
dest: "/opt/kayobe/containers/pulp/certs/{{ item.dest }}"
36+
mode: 0644
37+
become: true
38+
loop:
39+
- src: "{{ pulp_cert_path }}"
40+
dest: 'pulp_webserver.crt'
41+
- src: "{{ pulp_key_path }}"
42+
dest: 'pulp_webserver.key'

etc/kayobe/pulp.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
11
---
22
###############################################################################
3-
# Local Pulp access credentials
3+
# Local Pulp server configuration
44

55
# Base URL of the local Pulp service.
66
# Default uses the seed node's IP on the admin network.
7-
pulp_url: "http://{{ admin_oc_net_name | net_ip(groups['seed'][0]) }}:80"
7+
pulp_url: "{{ 'https' if pulp_enable_tls | bool else 'http' }}://{{ admin_oc_net_name | net_ip(groups['seed'][0]) }}:{{ pulp_port }}"
8+
9+
# Port on the seed node's interface on the admin network that the Pulp service
10+
# listens on.
11+
pulp_port: "{{ '443' if pulp_enable_tls | bool else '80' }}"
12+
13+
# Whether to enable TLS for Pulp.
14+
pulp_enable_tls: false
15+
16+
# Path to a TLS certificate to use when TLS is enabled.
17+
#pulp_cert_path:
18+
19+
# Path to a TLS key to use when TLS is enabled.
20+
#pulp_key_path:
21+
22+
###############################################################################
23+
# Local Pulp access credentials
824

925
# Credentials used to access the local Pulp REST API.
1026
pulp_username: admin

etc/kayobe/seed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ seed_pulp_container:
106106
image: pulp/pulp
107107
pre: "{{ kayobe_config_path }}/containers/pulp/pre.yml"
108108
post: "{{ kayobe_config_path }}/containers/pulp/post.yml"
109-
tag: "3.21"
109+
tag: "{{ '3.21-https' if pulp_enable_tls | bool else '3.21' }}"
110110
network_mode: host
111111
# Override deploy_containers_defaults.init == true to ensure
112112
# s6-overlay-suexec starts as pid 1
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
features:
3+
- |
4+
Enable TLS for the Seed Pulp service. Set ``pulp_enable_tls: true`` and
5+
provide paths to a TLS certificate and key using ``pulp_cert_path`` and
6+
``pulp_key_path`` respectively.

0 commit comments

Comments
 (0)