-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set correct entries for Puppet Master and CA entries during execution #262
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1421,6 +1421,8 @@ def exec_service(service, command, failonerror=True): | |
install_katello_agent() | ||
API_PORT = get_api_port() | ||
smart_proxy_id = return_matching_foreman_key('smart_proxies', 'name="%s"' % options.foreman_fqdn, 'id', False) | ||
puppet_master_smart_proxy_id = return_matching_foreman_key('smart_proxies', 'name="%s"' % options.puppet_server, 'id', True) | ||
puppet_ca_smart_proxy_id = return_matching_foreman_key('smart_proxies', 'name="%s"' % options.puppet_ca_server, 'id', True) | ||
current_host_id = return_matching_foreman_key('hosts', 'name="%s"' % FQDN, 'id', False) | ||
capsule_features = get_capsule_features(smart_proxy_id) | ||
|
||
|
@@ -1434,9 +1436,15 @@ def exec_service(service, command, failonerror=True): | |
|
||
# Configure new proxy_id for Puppet (if not skipped), and OpenSCAP (if available and not skipped) | ||
if 'foreman' not in options.skip and 'puppet' not in options.skip: | ||
print_running("Calling Foreman API to update Puppet master and Puppet CA for %s to %s" % (FQDN, options.foreman_fqdn)) | ||
update_host_capsule_mapping("puppet_proxy_id", smart_proxy_id, current_host_id) | ||
update_host_capsule_mapping("puppet_ca_proxy_id", smart_proxy_id, current_host_id) | ||
if puppet_master_smart_proxy_id is not None and puppet_ca_smart_proxy_id is not None: | ||
print_running("Calling Foreman API to update Puppet Master for %s to %s" % (FQDN, options.puppet_server)) | ||
update_host_capsule_mapping("puppet_proxy_id", puppet_master_smart_proxy_id, current_host_id) | ||
print_running("Calling Foreman API to update Puppet CA for %s to %s" % (FQDN, options.puppet_ca_server)) | ||
update_host_capsule_mapping("puppet_ca_proxy_id", puppet_ca_smart_proxy_id, current_host_id) | ||
else: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we need this branching here. The Now, after writing this, I wonder if we need to set these to the Smart Proxy at all if the user asked for an external (not-found) Puppet setup. Because if the user bootstraps a machine against @sideangleside thoughts? |
||
print_running("Calling Foreman API to update Puppet master and Puppet CA for %s to %s" % (FQDN, options.foreman_fqdn)) | ||
update_host_capsule_mapping("puppet_proxy_id", smart_proxy_id, current_host_id) | ||
update_host_capsule_mapping("puppet_ca_proxy_id", smart_proxy_id, current_host_id) | ||
if 'foreman' not in options.skip and 'Openscap' in capsule_features: | ||
print_running("Calling Foreman API to update OpenSCAP proxy for %s to %s" % (FQDN, options.foreman_fqdn)) | ||
update_host_capsule_mapping("openscap_proxy_id", smart_proxy_id, current_host_id) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can write this without the
is not None
part, which I find better readable