<div dir="ltr">On Fri, Nov 8, 2013 at 3:58 PM, Gavin Panella <span dir="ltr"><<a href="mailto:gavin.panella@canonical.com" target="_blank">gavin.panella@canonical.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">> postgresql/0:db-relation-changed % unit-get public-address<br>
> kmkxr.maaslocal<br>
><br>
> postgresql/0:db-relation-changed % unit-get private-address<br>
> kmkxr.maaslocal<br>
<br>
</div>I guess we could change MAAS to return an IP address, or the generated<br>
hostname, for private-address.<br>
</blockquote></div><br></div><div class="gmail_extra">I tried AWS and LXC, postgresql works there just fine. No CNAMEs involved, and no mangling of /etc/hosts like in the MAAS case.</div><div class="gmail_extra"><br></div>
<div class="gmail_extra">I think it boils down to juju somehow ending up using the CNAME instead of the A record or the IP for "private-address". The postgresql charm uses that for access control, and using a CNAME for that doesn't work.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">If the CNAME were not in /etc/hosts, it would work: "hostname -f" (which I assume is what juju is calling, or its equivalent) would return the correct dns record (and not the CNAME). And looks like MAAS explicitly wants the hostname in /etc/hosts (via manage_etc_hosts):</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">./src/maasserver/compose_preseed.py:<br></div><div class="gmail_extra"><div class="gmail_extra"><div class="gmail_extra">def compose_cloud_init_preseed(token, base_url=''):</div>
<div class="gmail_extra"> """Compose the preseed value for a node in any state but Commissioning."""</div><div class="gmail_extra">(...)</div><div class="gmail_extra"> local_config_yaml = yaml.safe_dump({</div>
<div class="gmail_extra"> "manage_etc_hosts": "localhost",</div><div class="gmail_extra"> "apt_preserve_sources_list": True,</div><div class="gmail_extra"> })</div><div><br>
</div>
<div><br></div><div>Oh, look at what I found:</div><div><br></div><div>More recent bug asking to remove manage_etc_hosts:</div><div><a href="https://bugs.launchpad.net/ubuntu/+source/maas/+bug/1087183">https://bugs.launchpad.net/ubuntu/+source/maas/+bug/1087183</a><br>
</div><div><br></div><div>Original bug that asked to introduce it:<br></div></div><div class="gmail_extra"><a href="https://bugs.launchpad.net/maas/+bug/972067">https://bugs.launchpad.net/maas/+bug/972067</a><br></div><div class="gmail_extra">
<br></div><div class="gmail_extra">Tug of war! :)</div><div class="gmail_extra"><br></div></div></div>