Bug 1347242 - host certificate is not deleted from puppet CA when host is deleted if the host is unmanaged.
Summary: host certificate is not deleted from puppet CA when host is deleted if the ho...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Puppet
Version: 6.1.8
Hardware: Unspecified
OS: Unspecified
unspecified
high with 1 vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact:
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-16 11:25 UTC by Johan Bergström
Modified: 2020-05-14 15:12 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-04 18:02:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 13911 0 None None None 2016-06-17 16:05:24 UTC

Description Johan Bergström 2016-06-16 11:25:52 UTC
Description of problem:

When an unmanaged client in satellite6 is deleted the Puppet CA client certificate is not removed.


Version-Release number of selected component (if applicable):
6.1.9

How reproducible:
Always.

Steps to Reproduce:
1. Register a host, make sure it's unmanaged
2. Delete host
3. Check Infrastructure -> capsules -> certificates, cert is still there.

Actual results:

Host is deleted but old certificate is still there, which means re-registering host will fail on puppet.

Expected results:

Deleted host == deleted certificate etc.

Additional info:
Nothing happens in foreman-proxy/proxy.log when deleting unmanaged client. API call to remove cert is never executed.

Comment 2 Bryan Kearney 2016-06-17 15:05:04 UTC
Connecting redmine issue http://projects.theforeman.org/issues/8271 from this bug

Comment 3 Bryan Kearney 2016-06-17 15:05:20 UTC
Connecting redmine issue http://projects.theforeman.org/issues/13911 from this bug

Comment 5 Bryan Kearney 2016-06-17 18:16:34 UTC
Upstream bug component is Provisioning

Comment 6 Bryan Kearney 2016-08-10 19:18:12 UTC
Upstream bug component is Configuration Management

Comment 7 Bryan Kearney 2016-08-10 20:19:15 UTC
Upstream bug component is Provisioning

Comment 8 Bryan Kearney 2016-08-10 22:18:50 UTC
Upstream bug component is Puppet

Comment 9 Billy Ray 2018-07-03 15:23:22 UTC
Can confirm this is still present in 1.17.  We use --foreman-unattended=false so we can use foreman as a puppet GUI without the provisioning features.  It's highly annoying that when this is used, deleting a host via the API/gui does not delete the puppet cert.  This issue needs some love!

Comment 10 Mihir Lele 2018-07-09 09:07:58 UTC
Do we have any local reproducer for this issue to get this bug moving?

Comment 11 Bryan Kearney 2018-09-04 18:02:03 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.

Comment 12 Ondrej Gajdusek 2018-09-06 14:59:32 UTC
This happens if the host is unmanaged.

Reproducer:
1. register the host via subscription-manager register --org --activationkey
2. unregister the host via sm
3. delete the host entry 

Satellite will create host and content host but the host has set "host": { "managed": "false" }. 

To fix this:
via WebUI:
1. Navigate to Hosts -> All hosts
2. Select the desired host
3. Click on "Edit" and then click on "Manage host" and confirm by hitting the Submit button
4. Then unregister the host by hitting the "Delete" button
Puppet agent (host's) certificate should be deleted at this moment.

via API:
HOST_ID=$(curl -s -m 30 -k -f -u ${SAT_USER}:${SAT_PASSWORD} https://${SATELLITE_SERVER}/api/hosts/?search=name="$(hostname)" | jq '.results[0].id')
curl -m 30 -k -X 'PUT' -H 'content-type: application/json' -d '{"host": {"managed": 1 }}' -u ${SAT_USER}:${SAT_PASSWORD} https://${SATELLITE_SERVER}/api/v2/hosts/${HOST_ID}
curl -m 30 -k -X 'DELETE' -u ${SAT_USER}:${SAT_PASSWORD} https://${SATELLITE_SERVER}/api/v2/hosts/${HOST_ID}


Is this behaviour expected or is it a bug?


Note You need to log in before you can comment on or make changes to this bug.