Skip to content

Commit f1299b9

Browse files
committed
set correct entries for Puppet Master and CA entries during execution
1 parent 344b49c commit f1299b9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bootstrap.py

100755100644
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,8 @@ def exec_service(service, command, failonerror=True):
12631263
install_katello_agent()
12641264
API_PORT = get_api_port()
12651265
smart_proxy_id = return_matching_foreman_key('smart_proxies', 'name="%s"' % options.foreman_fqdn, 'id', False)
1266+
puppet_master_smart_proxy_id = return_matching_foreman_key('smart_proxies', 'name="%s"' % options.puppet_server, 'id', True)
1267+
puppet_ca_smart_proxy_id = return_matching_foreman_key('smart_proxies', 'name="%s"' % options.puppet_ca_server, 'id', True)
12661268
current_host_id = return_matching_foreman_key('hosts', 'name="%s"' % FQDN, 'id', False)
12671269
capsule_features = get_capsule_features(smart_proxy_id)
12681270

@@ -1276,9 +1278,10 @@ def exec_service(service, command, failonerror=True):
12761278

12771279
# Configure new proxy_id for Puppet (if not skipped), and OpenSCAP (if available and not skipped)
12781280
if 'foreman' not in options.skip and 'puppet' not in options.skip:
1279-
print_running("Calling Foreman API to update Puppet master and Puppet CA for %s to %s" % (FQDN, options.foreman_fqdn))
1280-
update_host_capsule_mapping("puppet_proxy_id", smart_proxy_id, current_host_id)
1281-
update_host_capsule_mapping("puppet_ca_proxy_id", smart_proxy_id, current_host_id)
1281+
print_running("Calling Foreman API to update Puppet Master for %s to %s" % (FQDN, options.puppet_server))
1282+
update_host_capsule_mapping("puppet_proxy_id", puppet_master_smart_proxy_id, current_host_id)
1283+
print_running("Calling Foreman API to update Puppet CA for %s to %s" % (FQDN, options.puppet_ca_server))
1284+
update_host_capsule_mapping("puppet_ca_proxy_id", puppet_ca_smart_proxy_id, current_host_id)
12821285
if 'foreman' not in options.skip and 'Openscap' in capsule_features:
12831286
print_running("Calling Foreman API to update OpenSCAP proxy for %s to %s" % (FQDN, options.foreman_fqdn))
12841287
update_host_capsule_mapping("openscap_proxy_id", smart_proxy_id, current_host_id)

0 commit comments

Comments
 (0)