Replacing host resources

39 views
Skip to first unread message

Marcin Owsiany

unread,
Jun 10, 2008, 5:34:11 PM6/10/08
to Puppet Users
Hi,

Here is an interesting problem. Right after a host called "foo" is built, just
before the first puppet run, the /etc/hosts file contains the following entry:

1.2.3.4 foo

However, in order to match the information that is in DNS, I want the line to
look like this:

1.2.3.4 somedomain.com foo.colo.domain foo

Let's try to keep aside the discussion of whether that is actually a sane thing
to do, I'm still just experimenting. Let's focus on what may be necessary to
make puppet replace the existing line with what I want there to be. I added
something like this to the manifest:


host { foo: ensure => absent }
host { "somedomain.com":
ip => "1.2.3.4",
alias => [ "foo.colo.domain", "foo" ]
}

However, surprisingly (or maybe not), what I get is just an early failure:

Host[somedomain.com] is already being managed

I guess this is because of the dual purpose of "alias" param/metaparam.

Is this a bug? Is it possible to make puppet do what I want it to do, without
just doing file { "/etc/hosts": ... }?

--
Marcin Owsiany <mar...@owsiany.pl> http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216 FE67 DA2D 0ACA FC5E 3F75 D6F6 3A0D 8AA0 60F4 1216

"Every program in development at MIT expands until it can read mail."
-- Unknown

Luke Kanies

unread,
Jun 10, 2008, 10:36:22 PM6/10/08
to puppet...@googlegroups.com


You are correct that the problem you're experiencing is because of the
dual roles of the alias parameter.

I don't think there's really a solution to this right now if you
require that the longer name be the first name in /etc/hosts.

--
Everything that is really great and inspiring is created by the
individual who can labor in freedom. -- Albert Einstein
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com

Marcin Owsiany

unread,
Jun 11, 2008, 2:57:30 PM6/11/08
to puppet...@googlegroups.com
On Tue, Jun 10, 2008 at 09:36:22PM -0500, Luke Kanies wrote:
> You are correct that the problem you're experiencing is because of the
> dual roles of the alias parameter.
>
> I don't think there's really a solution to this right now if you
> require that the longer name be the first name in /etc/hosts.

OK, filed as #1358

Reply all
Reply to author
Forward
0 new messages