FAQ
Hello,

I run puppet with foreman, and want to do the following:


- Initalize a network interface
- Start a service, bound to that interface.


eg:

#Start an interface for vlan 301 on interface em1
    network::if::dynamic { 'em1.301':
       ensure => up,
    }

#Start an openstack L2 agent

    class { 'neutron::agents::ovs':
     local_ip => $::ipaddress_em1_301,
     enable_tunneling => true,
     after => Network::If::Dynamic['em1.301']
   }



My problem is that the ::ipaddress_em1_301 fact doesn't exist yet the
moment the catalog gets retreived. So it throws an error. Is there a way
around this?

Krist



--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/3377a441-bfd3-4b29-b700-611ebdb57f76%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • José Luis Ledesma at Jan 31, 2014 at 9:27 am
    I don't know which is the best solution, what I do is:

    if $::factX != undef {

    ....
    }

    Regards
    El 31/01/2014 09:57, "Krist van Besien" <[email protected]>
    escribió:
    Hello,

    I run puppet with foreman, and want to do the following:


    - Initalize a network interface
    - Start a service, bound to that interface.


    eg:

    #Start an interface for vlan 301 on interface em1
    network::if::dynamic { 'em1.301':
    ensure => up,
    }

    #Start an openstack L2 agent

    class { 'neutron::agents::ovs':
    local_ip => $::ipaddress_em1_301,
    enable_tunneling => true,
    after => Network::If::Dynamic['em1.301']
    }



    My problem is that the ::ipaddress_em1_301 fact doesn't exist yet the
    moment the catalog gets retreived. So it throws an error. Is there a way
    around this?

    Krist



    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to [email protected].
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/3377a441-bfd3-4b29-b700-611ebdb57f76%40googlegroups.com
    .
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAF_B3dcNvvsfkpDmu-W3nk%3DtL%3DYnNyCru%2BWrxV78FnVCQNjeHQ%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Daniele Sluijters at Jan 31, 2014 at 10:27 am
    Facts get sent at the start to the Puppet master so bringing an interface
    online during a Puppet run won't make it available as a Fact during that
    run, only on the next run as then the Facts are collected again. Your best
    bet is to make it conditional, check for the existence of the Fact and only
    if it is set do something.
    On Friday, 31 January 2014 09:57:02 UTC+1, Krist van Besien wrote:


    Hello,

    I run puppet with foreman, and want to do the following:


    - Initalize a network interface
    - Start a service, bound to that interface.


    eg:

    #Start an interface for vlan 301 on interface em1
    network::if::dynamic { 'em1.301':
    ensure => up,
    }

    #Start an openstack L2 agent

    class { 'neutron::agents::ovs':
    local_ip => $::ipaddress_em1_301,
    enable_tunneling => true,
    after => Network::If::Dynamic['em1.301']
    }



    My problem is that the ::ipaddress_em1_301 fact doesn't exist yet the
    moment the catalog gets retreived. So it throws an error. Is there a way
    around this?

    Krist


    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/752a43c4-dfd8-476d-8dd0-bd49f03df220%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Krist van Besien at Jan 31, 2014 at 10:39 am

    On Friday, January 31, 2014 11:27:49 AM UTC+1, Daniele Sluijters wrote:
    Facts get sent at the start to the Puppet master so bringing an interface
    online during a Puppet run won't make it available as a Fact during that
    run, only on the next run as then the Facts are collected again. Your best
    bet is to make it conditional, check for the existence of the Fact and only
    if it is set do something.
    That's indeed what I've ended up doing...



    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/4440516c-07c6-4812-9e2b-2f281f6d5f51%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJan 31, '14 at 8:57a
activeJan 31, '14 at 10:39a
posts4
users3
websitepuppetlabs.com

People

Translate

site design / logo © 2023 Grokbase