From 8814231a09364cb9f8fdd13d9de7e3b0bfd4eb92 Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Sun, 6 Jan 2019 22:19:11 +0100 Subject: [PATCH] Pass ssl certificate options to anaconda If a repository has `sslcacert`, `sslclientcert`, or `ssclientkey` set, pass them to anaconda through the kickstart file. This is mostly the case when using RHEL repositories that are accessed through a subscription. (cherry picked from commit e194b5926cf620914d677385ed757fb4cb8f4cd7) --- lorax.spec | 2 +- src/pylorax/api/compose.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lorax.spec b/lorax.spec index dbf5ce55..2a151077 100644 --- a/lorax.spec +++ b/lorax.spec @@ -46,7 +46,7 @@ Requires: kpartx # Python modules Requires: libselinux-python3 Requires: python3-mako -Requires: python3-kickstart +Requires: python3-kickstart >= 3.19 Requires: python3-dnf >= 3.2.0 Requires: python3-librepo diff --git a/src/pylorax/api/compose.py b/src/pylorax/api/compose.py index ac032c43..7a204f58 100644 --- a/src/pylorax/api/compose.py +++ b/src/pylorax/api/compose.py @@ -110,6 +110,13 @@ def repo_to_ks(r, url="url"): if not r.sslverify: cmd += '--noverifyssl' + if r.sslcacert: + cmd += ' --sslcacert="%s"' % r.sslcacert + if r.sslclientcert: + cmd += ' --sslclientcert="%s"' % r.sslclientcert + if r.sslclientkey: + cmd += ' --sslclientkey="%s"' % r.sslclientkey + return cmd