FAQ
Hi,

As the only paramater we can pass to the ENC is the hostname, I wonder
if there is a way to access a node's fact in the ENC script?

I know a workaround is to query my Fact database ( I am using Mysql),
but I like to know if I can use a variable directly, for example,
$ipaddress?

Thanks.

Hai T.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Craig White at Jul 23, 2012 at 11:47 pm

    On Jul 23, 2012, at 4:07 PM, Hai Tao wrote:

    Hi,

    As the only paramater we can pass to the ENC is the hostname, I wonder
    if there is a way to access a node's fact in the ENC script?

    I know a workaround is to query my Fact database ( I am using Mysql),
    but I like to know if I can use a variable directly, for example,
    $ipaddress?
    ----
    $hostname should work
    $fqdn is an option but that will likely carry a domain name with it.

    Craig

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Hai Tao at Jul 23, 2012 at 11:56 pm
    I am talking about facts other than hostname, such as ipaddress, custom facts.
    On Mon, Jul 23, 2012 at 4:47 PM, Craig White wrote:
    On Jul 23, 2012, at 4:07 PM, Hai Tao wrote:

    Hi,

    As the only paramater we can pass to the ENC is the hostname, I wonder
    if there is a way to access a node's fact in the ENC script?

    I know a workaround is to query my Fact database ( I am using Mysql),
    but I like to know if I can use a variable directly, for example,
    $ipaddress?
    ----
    $hostname should work
    $fqdn is an option but that will likely carry a domain name with it.

    Craig

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.


    --
    Hai Tao

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Brian Gupta at Jul 24, 2012 at 12:26 am
    Your ENC script can pretty much do whatever you want it to do. I'm not
    exactly following what you want to do with the facts, but you could
    upload them to your ENC like so:
    https://github.com/theforeman/puppet-foreman/blob/master/templates/external_node.rb.erb

    -Brian
    On Mon, Jul 23, 2012 at 7:56 PM, Hai Tao wrote:
    I am talking about facts other than hostname, such as ipaddress, custom facts.
    On Mon, Jul 23, 2012 at 4:47 PM, Craig White wrote:
    On Jul 23, 2012, at 4:07 PM, Hai Tao wrote:

    Hi,

    As the only paramater we can pass to the ENC is the hostname, I wonder
    if there is a way to access a node's fact in the ENC script?

    I know a workaround is to query my Fact database ( I am using Mysql),
    but I like to know if I can use a variable directly, for example,
    $ipaddress?
    ----
    $hostname should work
    $fqdn is an option but that will likely carry a domain name with it.

    Craig

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.


    --
    Hai Tao

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Stefan Schulte at Jul 24, 2012 at 4:30 pm

    On Mon, Jul 23, 2012 at 08:25:49PM -0400, Brian Gupta wrote:
    Your ENC script can pretty much do whatever you want it to do. I'm not
    exactly following what you want to do with the facts, but you could
    upload them to your ENC like so:
    https://github.com/theforeman/puppet-foreman/blob/master/templates/external_node.rb.erb

    -Brian
    This may also be helpful:
    http://docs.puppetlabs.com/guides/external_nodes.html#tricks-notes-and-further-reading

    -Stefan

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJul 23, '12 at 11:07p
activeJul 24, '12 at 4:30p
posts5
users4
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase