salt-formulas / salt-formula-freeipa

Other
20 stars 35 forks source link

Enrolling client fails due to missing records #17

Closed p3lim closed 3 years ago

p3lim commented 3 years ago

As per output from the freeipa_host_add I get the following in stdout (prettified):

{
    "result": null,
    "error": {
        "code": 4019,
        "message": "Host 'test.example.com' does not have corresponding DNS A/AAAA record",
        "data": {
            "hostname": "test.example.com"
        },
        "name": "DNSNotARecordError"
    },
    "id": 0,
    "principal": "enroller@EXAMPLE.COM",
    "version": "4.9.2"
}

Issue 1: The record doesn't exist, this could be solved by adding a freeipa_dnsrecord_add just before freipa_host_add that creates the A/AAAA record for the host.

Issue 2: The states continue to run, since curl doesn't return non-null it never fails. Could probably be solved by using the http module instead of cmd.run and curl.

I wanted your input on this before I create more PRs.

p3lim commented 3 years ago

@fpytloun Any comment on this?

fpytloun commented 3 years ago

I am no longer using FreeIPA in my deployments so I am not sure. Anyway I will be happy to merge your MRs :+1: