<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Follow-up: I guess I can leave off the <span style="font-family: courier new,courier,monospace;">--hostname</span> part of it and it doesn't change the hostname.</p>
<p>On 2017-04-19 17:25, greg@greg-gilbert.com wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<p>Rob, here's what I see in that log:</p>
<p><span style="font-family: courier new,courier,monospace;">2017-04-19T21:18:23Z DEBUG Using servers from command line, disabling DNS discovery</span><br /><span style="font-family: courier new,courier,monospace;">2017-04-19T21:18:23Z DEBUG will use provided server: ipa.services.foo</span><br /><span style="font-family: courier new,courier,monospace;">2017-04-19T21:18:23Z DEBUG will use discovered realm: IPA.SERVICES.FOO</span><br /><span style="font-family: courier new,courier,monospace;">2017-04-19T21:18:23Z DEBUG will use discovered basedn: dc=ipa,dc=services,dc=foo</span><br /><span style="font-family: courier new,courier,monospace;">2017-04-19T21:18:23Z INFO Client hostname: 10.100.15.209</span><br /><span style="font-family: courier new,courier,monospace;">2017-04-19T21:18:23Z DEBUG Hostname source: Provided as option</span><br /><span style="font-family: courier new,courier,monospace;">2017-04-19T21:18:23Z INFO Realm: IPA.SERVICES.FOO</span><br /><span style="font-family: courier new,courier,monospace;">...</span><br /><span style="font-family: courier new,courier,monospace;">2017-04-19T21:18:23Z DEBUG Starting external process</span><br /><span style="font-family: courier new,courier,monospace;">2017-04-19T21:18:23Z DEBUG args=/bin/hostname 10.100.15.209</span><br /><span style="font-family: courier new,courier,monospace;">2017-04-19T21:18:23Z DEBUG Process finished, return code=0</span><br /><span style="font-family: courier new,courier,monospace;">2017-04-19T21:18:23Z DEBUG stdout=</span><br /><span style="font-family: courier new,courier,monospace;">2017-04-19T21:18:23Z DEBUG stderr=</span><br /><span style="font-family: courier new,courier,monospace;">2017-04-19T21:18:23Z DEBUG Backing up system configuration file '/etc/hostname'</span></p>
<p>So whatever that external process is, I guess that's what's resetting the hostname.</p>
<p>For reference, here's the line that runs (on cloud-init) to set up FreeIPA:</p>
<p><span style="font-family: courier new,courier,monospace;">      /usr/sbin/ipa-client-install \</span><br /><span style="font-family: courier new,courier,monospace;">      --domain=ipa.services.FOO \</span><br /><span style="font-family: courier new,courier,monospace;">      --server=ipa.services.FOO \</span><br /><span style="font-family: courier new,courier,monospace;">      -U \</span><br /><span style="font-family: courier new,courier,monospace;">      --permit \</span><br /><span style="font-family: courier new,courier,monospace;">      --ssh-trust-dns \</span><br /><span style="font-family: courier new,courier,monospace;">      --principal=enrollment \</span><br /><span style="font-family: courier new,courier,monospace;">      --password="PASS" \</span><br /><span style="font-family: courier new,courier,monospace;">      --hostname="{{ ansible_eth0.ipv4.address }}"</span></p>
<p><br /></p>
<p>On 2017-04-19 16:27, Rob Crittenden wrote:</p>
<blockquote style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0;">
<div class="pre" style="margin: 0; padding: 0; font-family: monospace;"><a href="mailto:greg@greg-gilbert.com">greg@greg-gilbert.com</a> wrote:
<blockquote style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0;">When the instances register themselves with FreeIPA, their hostnames get<br /> changed to match their IP; that's a FreeIPA rule, I believe. So in this<br /> case, the hostname is 10.100.*.<br /><br /> ubuntu@10:~$ hostname<br /> 10.100.15.130</blockquote>
<br /> There is something very wrong. ipa-client should be setting a FQDN, not<br /> an IP address. /var/log/ipaclient-install.log may hold some clues.<br /><br /> rob<br /><br />
<blockquote style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0;"><br /> On 2017-04-19 14:53, Jason B. Nance wrote:<br /><br />
<blockquote style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0;">Hi Greg,<br /><br />     I'm trying to set up a rule based on server hostname. So for<br />     example, 10.100.* would be put into the 'developers' hostgroup. I<br />     can't figure out the proper format of the inclusive regex. I've tried:<br /><br /> I believe that your regex needs to match the host name, not the IP<br /> address.  Unless your host name is 10.100.<something> I don't think<br /> that will match.  The regex for "anything" is ".*".  I think that the<br /> pcre syntax is what is used.<br /> Regards,<br />  <br /> j<br />  </blockquote>
<br /><br /><br /><br /></blockquote>
</div>
</blockquote>
<p><br /></p>
</blockquote>
<p><br /></p>

</body></html>