<div dir="ltr"><div><div><div><div>I wanted to use the python ipalib directly, but like you mentioned, I found very little documentation and what I found indicated I was going to just pass cli arguments to it, it seemed to be not much better than calling the wrapper directly :-(<br>
<br></div>I will clean up my salt reactor of things specific to my install (mostly just validating host against AWS and pulling AWS info to be added to the host description fields) and try to add it to the salt-forumulas - then we can link to it from the how-tos, etc. If someone is interested sooner, I can post it here for time being.<br>
<br></div>As far as Host-Enrollment vs Host-Administrators privileges - it may be that I am mixing up 2 ways to enroll hosts. My original attempt was to try to have an "enroller" account that would add client directly from the client - but I have relented and switched to a more proper method of adding a host entrue with a generated OTP for the client followed by joining of that client from the client itself with the OTP password. This works, but when I try to add host entry with OTP password using account with only "Host Enrollment" privilege I get: <br>
<br>ipa: ERROR: Insufficient access: Insufficient 'add' privilege to the 'userPassword' attribute<br><br></div>I really would like to have minimal privileges for my "adder" account, but at least this account is only available on a much more restricted server (salt-master) where only limited admins have access to it. For now I am granting it the "Host Administrators" privilege, as it is what works.<br>
<br></div>-M<br><div><div> 
</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 15, 2014 at 9:26 AM, Petr Viktorin <span dir="ltr"><<a href="mailto:pviktori@redhat.com" target="_blank">pviktori@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 08/15/2014 06:02 PM, James wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, Aug 15, 2014 at 5:25 AM, Michael Lasevich<br>
<<a href="mailto:mlasevich@lasevich.net" target="_blank">mlasevich@lasevich.net</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sorry, I did not intend to belittle your efforts - just misread the code<br>
</blockquote>
Didn't take it that way, no worries :)<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
(saw you pass in $admin and $password and made wrong assumption that $admin<br>
was admin username) as well as trying to avoid puppet as I find Salt much<br>
quicker and much simpler (and already established in my setup)<br>
<br>
I sat down tonight and threw together a quick salt reactor that does same<br>
thing as your module - creates the host account in IPA with a generated OTP<br>
password and joins the host to the domain using that generated OTP (and<br>
while at it, validates the host against AWS and populates the metadata into<br>
IPA) Ended up having to join the salt master to the domain, which I was<br>
avoiding doing for security reasons, but I can just disable IPA logins in<br>
PAM and call it a day. The nice bit is that it is using the host's keytab<br>
for authentication, so I do not need any extra credentials sitting around.<br>
Seems to be working just fine. :-). I ended up granting the salt-master host<br>
the "Host Administrators" privilege. It seems that "Host Enrollment"<br>
privilege is not sufficient to enroll hosts -  go figure.<br>
</blockquote>
Great!<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The only thing that bugs me is that I am calling IPA python code from my<br>
salt reactor python code via subprocess - there has got to be a better, more<br>
direct way -  but I found documentation too confusing to follow at 1 am -<br>
will be a project for another day.<br>
</blockquote>
There is the python ipa API, not sure how stable or official it is,<br>
but if you look in my code I use it occasionally.<br>
</blockquote>
<br></div></div>
The RPC API is not official (i.e. documented), but since IPA needs to keep backwards compatibility with its own client, it's very stable.<br>
<br>
Just be sure to send the API version with each call. (The server will send a warning if you don't.)<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
-- <br>
Petr³</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
-- <br>
Manage your subscription for the Freeipa-users mailing list:<br>
<a href="https://www.redhat.com/mailman/listinfo/freeipa-users" target="_blank">https://www.redhat.com/<u></u>mailman/listinfo/freeipa-users</a><br>
Go To <a href="http://freeipa.org" target="_blank">http://freeipa.org</a> for more info on the project<br>
</div></div></blockquote></div><br></div>