-
Notifications
You must be signed in to change notification settings - Fork 22
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
The role is not idempotent with Debian 12 #216
Comments
After some more testing, it appears that the certificate is actually re-issued every time the role runs. The configuration I'm using looks like this: certificate_requests:
- name: '{{ ipa_certificate_name }}' # something like "HTTP"
ca: ipa
dns: '{{ inventory_hostname }}'
ip: '{{ ansible_host }}'
principal: '{{ ipa_certificate_principal }}/{{ inventory_hostname }}@{{ ipaserver_realm }}' # something like HTTP/[email protected]
owner: '{{ ipa_certificate_owner }}'
group: '{{ ipa_certificate_group }}'
mode: '{{ ipa_certificate_mode }}' - name: ensure an IPA-issued certificate is present
include_role:
name: fedora.linux_system_roles.certificate
apply:
become: true It's part of another role that wraps it up with outer configurable options, but that's the gist of the invocation. |
Okay, I've had another crack at it and managed to narrow down the issue. Essentially:
The following workarounds can be applied to resolve the idempotency problems.
The issue with key_size can probably be resolved by accepting any value in the issued certificate if no specific key_size is requested in the CSR. The other are likely better suited as documentation in this repository under https://github.com/linux-system-roles/certificate?tab=readme-ov-file#using-freeipa-to-issue-a-certificate or someplace similar. |
Thank you for your research on this issue. Requesting a certificate with the same settings, twice, should no re-issue the certificate, at least, against the same version of IPA. It may be that recent versions of IPA have changed something that is affecting this role. I've been in a medical leave, but will look at it in a couple of weeks (I'd say next week, but it will be hard, as I don't even have a Debian setup around). |
Right - the issue is that IPA doesn't respect some settings and overrides them in the issued certificate (the organization and key usages, for example). As long as you know what you're going to get, you can set those options so they become part of the CSR and the comparison succeeds. The only real bug here is the handling of key_size, which appears to be broken for the CSR, resulting in a falsy value being set in the cert_info structure. The other issues just need some documentation regarding IPAs overrides when issuing the actual certificate. |
The certificate role is not idempotent using Debian 12 on both the controller and managed node.
For details, see discussion after #45 (comment)
The text was updated successfully, but these errors were encountered: