2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-13 17:19:29 +00:00

Have EL8 family add repositories manually

This commit is contained in:
Jarrod Johnson 2020-08-06 16:37:18 -04:00
parent 972dc9780c
commit 3812fc93ff
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,32 @@
import configparser
import imp
import sys
apiclient = imp.load_source('apiclient', '/etc/confluent/apiclient')
repo = None
server = None
profile = None
with open('/etc/confluent/confluent.deploycfg') as dplcfgfile:
lines = dplcfgfile.read().split('\n')
for line in lines:
print(repr(line))
if line.startswith('deploy_server:'):
_, server = line.split(' ', 1)
if line.startswith('profile: '):
_, profile = line.split(' ', 1)
path = '/confluent-public/os/{0}/distribution/'.format(profile)
clnt = apiclient.HTTPSClient()
cfgdata = clnt.grab_url(path + '.treeinfo').decode()
c = configparser.ConfigParser()
c.read_string(cfgdata)
for sec in c.sections():
if sec.startswith('variant-'):
if 'repository' not in c[sec]:
continue
_, varname = sec.split('-', 1)
reponame = '/etc/yum.repos.d/local-{0}.repo'.format(varname.lower())
with open(reponame, 'w') as repout:
repout.write('[local-{0}]\n'.format(varname.lower()))
repout.write('name=Local install repository for {0}\n'.format(varname))
repout.write('baseurl=https://{}/confluent-public/os/{}/distribution/{}\n'.format(server, profile, c[sec]['repository']))
repout.write('enabled=1\n')

View File

@ -14,6 +14,12 @@ curl -X POST -d 'status: staged' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUEN
if [ -f /tmp/cryptboot ]; then
run_remote tpm_luks.sh
fi
# By default, the install repository is ignored, change
# this by manually adding local repositories
rpm --import /etc/pki/rpm-gpg/RPM_GPG_KEY-*
run_remote_python add_local_repositories
# This script will execute in the installed system, but using the installer kernel prior to reboot.
# This is an appropriate place to run post install activities that do not require the actual installed
# kernel to run. For example adding drivers that would be needed for first boot to run cleanly.