Issue #8940 has been updated by Ryan DeShone.

Has there been any further progress on this? I am in a setup where we have 
servers connected to multiple private networks. I'd like them to be able to 
export a host entry for each network they are connected to, then have it 
collected by the other machines on that network. Right now, this is preventing 
me from being able to do so.

----------------------------------------
Feature #8940: host type should have an optional canonical_hostname parameter
https://projects.puppetlabs.com/issues/8940#change-97669

* Author: Rob Terhaar
* Status: Accepted
* Priority: Normal
* Assignee: Franz Pletz
* Category: host
* Target version: 
* Affected Puppet version: 2.6.8
* Keywords: 
* Branch: 
----------------------------------------
If you compare the behavior of the Exec type to the Host type, Exec is more 
flexible because it has a command => parameter. This is useful if you would 
like to create multiple Execs with different namevars, but similar commands. 

When working with the Host type, I've found that the namevar becomes the 
"canonical_hostname", and there is no way to override this. Here's a specific 
example of when having multiple Host resources with the same namevar would be 
useful:

<pre>
  @@host  { "$fqdn":
    host_aliases  => $hostname,
    ip            => $private_ip_interface,
    tag           => "normal_server_private-${region}",
  }

  @@host  { "${fqdn}":
    host_aliases  => $hostname,
    ip            => $public_ip_interface,
    tag           => "normal_server_public-${region}",
  }
</pre>

Since both exported resources have the same namevar, I receive a parse error:
<pre>Error 400 on SERVER: Duplicate definition: Host[puppet.dev.server.com] is 
already defined in file /etc/puppet/modules/hosts/manifests/collect.pp at line 
33; cannot redefine at /etc/puppet/modules/hosts/manifests/collect.pp:43 on 
node puppet.dev.server.com</pre>

However, If the Host type had the ability to pass a canonical hostname (fqdn) 
argument, I could do:
<pre>
  @@host  { "${fqdn}-private":
    canonical_hostname => $fqdn
    host_aliases  => $hostname,
    ip            => $private_ip_interface,
    tag           => "normal_server_private-${region}",
  }

  @@host  { "${fqdn}-public":
    canonical_hostname => $fqdn
    host_aliases  => $hostname,
    ip            => $public_ip_interface,
    tag           => "normal_server_public-${region}",
  }
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to