<br><br><div class="gmail_quote">On Wed, Feb 22, 2012 at 10:34 PM, JR Aquino <span dir="ltr"><<a href="mailto:JR.Aquino@citrix.com">JR.Aquino@citrix.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 Feb 22, 2012, at 1:24 PM, Marco Pizzoli wrote:<br>
<br>
> Hi guys,<br>
> I see that there's no way to rename a host once created. Same issue with host groups.<br>
> Could you confirm that it is by design and so I never will be able to do that?<br>
><br>
> Thanks<br>
>     Marco (wanting to rename everything :-( )<br>
<br>
</div></div>Hi Marco.  Yes, you do need to fully delete and uninstall a host from FreeIPA before readding it with a new name.<br>
<br>
<a href="http://docs.fedoraproject.org/en-US/Fedora/15/html/FreeIPA_Guide/renaming-machines.html" target="_blank">http://docs.fedoraproject.org/en-US/Fedora/15/html/FreeIPA_Guide/renaming-machines.html</a><br>
<br>
What may make this easier for you is a feature in 389 DS called Automember:<br>
<br>
<a href="http://directory.fedoraproject.org/wiki/Auto_Membership_Design" target="_blank">http://directory.fedoraproject.org/wiki/Auto_Membership_Design</a><br>
<br>
Automember is a way to use regular expression to tie a given fqdn-type to a given hostgroup.  So that when you 'add' a host with a similar name. say: <a href="http://webserver2.example.com" target="_blank">webserver2.example.com</a>, the host automatically ends up in the 'webservers' host group.<br>


<br>
If you wish for a bunch of hosts to be "renamed"/re-provisioned, and automatically assigned to a new hostgroup, you can predefine the regex mapping and make this process a little easier.<br>
<br>
FreeIPA provides a CLI (and in 2.1.90, a WebUI) for managing these entries.<br>
<br>
<br>
<br>
Here is the help doc from the cli tool:<br>
<br>
Auto Membership Rule.<br>
<br>
Bring clarity to the membership of hosts and users by configuring inclusive<br>
or exclusive regex paterns, you can automatically assign a new entries into<br>
a group or hostgroup based upon attribute information.<br>
<br>
A rule is directly associated with a group by name, so you cannot create<br>
a rule without an accompanying group or hostgroup<br>
<br>
A condition is a regular expression used by 389-ds to match a new incoming<br>
entry with an automember rule. If it matches an inclusive rule then the<br>
entry is added to the appropriate group or hostgroup.<br>
<br>
EXAMPLES:<br>
<br>
 Create the initial group or hostgroup:<br>
   ipa hostgroup-add --desc="Web Servers" webservers<br>
   ipa group-add --desc="Developers" devel<br>
<br>
 Create the initial rule:<br>
   ipa automember-add --type=hostgroup webservers<br>
   ipa automember-add --type=group devel<br>
<br>
 Add a condition to the rule:<br>
   ipa automember-add-condition --key=fqdn --type=hostgroup --inclusive-regex=^web[1-9]+\.example\.com webservers<br>
   ipa automember-add-condition --key=manager --type=group --inclusive-regex=^uid=mscott devel<br>
<br>
 Add an exclusive condition to the rule to prevent auto assignment:<br>
   ipa automember-add-condition --key=fqdn --type=hostgroup --exclusive-regex=^web5\.example\.com webservers<br>
<br>
 Add a host:<br>
    ipa host-add <a href="http://web1.example.com" target="_blank">web1.example.com</a><br>
<br>
 Add a user:<br>
    ipa user-add --first=Tim --last=User --password tuser1 --manager=mscott<br>
<br>
 Verify automembership:<br>
    ipa hostgroup-show webservers<br>
      Host-group: webservers<br>
      Description: Web Servers<br>
      Member hosts: <a href="http://web1.example.com" target="_blank">web1.example.com</a><br>
<br>
    ipa group-show devel<br>
      Group name: devel<br>
      Description: Developers<br>
      GID: 1004200000<br>
      Member users: tuser<br>
<br>
 Remove a condition from the rule:<br>
   ipa automember-remove-condition --key=fqdn --type=hostgroup --inclusive-regex=^web[1-9]+\.example\.com webservers<br>
<br>
 Modify the automember rule:<br>
    ipa automember-mod<br>
<br>
 Set the default target group:<br>
    ipa automember-default-group-set --default-group=webservers --type=hostgroup<br>
    ipa automember-default-group-set --default-group=ipausers --type=group<br>
<br>
 Set the default target group:<br>
    ipa automember-default-group-remove --type=hostgroup<br>
    ipa automember-default-group-remove --type=group<br>
<br>
 Show the default target group:<br>
    ipa automember-default-group-show --type=hostgroup<br>
    ipa automember-default-group-show --type=group<br>
<br>
 Find all of the automember rules:<br>
    ipa automember-find<br>
<br>
 Display a automember rule:<br>
    ipa automember-show --type=hostgroup webservers<br>
    ipa automember-show --type=group devel<br>
<br>
 Delete an automember rule:<br>
    ipa automember-del --type=hostgroup webservers<br>
    ipa automember-del --type=group devel<br>
<br>
Topic commands:<br>
  automember-add                   Add an automember rule.<br>
  automember-add-condition         Add conditions to an automember rule.<br>
  automember-default-group-remove  Remove default group for all unmatched entries.<br>
  automember-default-group-set     Set default group for all unmatched entries.<br>
  automember-default-group-show    Display information about the default automember groups.<br>
  automember-del                   Delete an automember rule.<br>
  automember-find                  Search for automember rules.<br>
  automember-mod                   Modify an automember rule.<br>
  automember-remove-condition      Remove conditions from an automember rule.<br>
  automember-show                  Display information about an automember rule.<br>
<br>
</blockquote></div><br><br>Hey, thanks a lot!<br>Now I have something to read before falling asleep.... :-)<br>Marco<br><br>