FAQ
Hi,
I'm trying to find a way to configure the firewall on centos systems using
puppet by copying the /etc/sysconfig/iptables file and restarting the
iptables service.
That part is simple to accomplish. The twist I need to add though is that I
only want to do this if a copy of that file for the node exists on the
server. If this file doesn't
exists then I want puppet to not replace the file on the client and not
restart the service.

Is there a way to accomplish this sort of conditional execution?

Regards,
Dennis

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/oAUk_tpcqooJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Krzysztof Wilczynski at Apr 22, 2012 at 6:50 pm
    Hi,

    On Sunday, 22 April 2012 02:15:19 UTC+1, Dennis Jacobfeuerborn wrote:

    [...]
    The twist I need to add though is that I only want to do this if a copy of
    that file for the node exists on the server. If this file doesn't
    exists then I want puppet to not replace the file on the client and not
    restart the service.

    Is there a way to accomplish this sort of conditional execution?
    Have a look on:
    https://github.com/kwilczynski/puppet-functions/blob/master/lib/puppet/parser/functions/exists.rb


    Maybe it will be of any use to you in this case.

    KW

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/7QWPj4QhYvkJ.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Dennis Jacobfeuerborn at Apr 23, 2012 at 12:59 pm
    Thanks, this looks like it will do the trick. The lack of puppet:// support
    probably means I will have to hard-code a path to a directory somewhere but
    that shouldn't be to big of a deal.
    On Sunday, April 22, 2012 8:49:50 PM UTC+2, matti wrote:

    Hi,

    On Sunday, 22 April 2012 02:15:19 UTC+1, Dennis Jacobfeuerborn wrote:

    [...]
    The twist I need to add though is that I only want to do this if a copy
    of that file for the node exists on the server. If this file doesn't
    exists then I want puppet to not replace the file on the client and not
    restart the service.

    Is there a way to accomplish this sort of conditional execution?
    Have a look on:
    https://github.com/kwilczynski/puppet-functions/blob/master/lib/puppet/parser/functions/exists.rb

    Maybe it will be of any use to you in this case.

    KW
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/5HEbo-N91H8J.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Krzysztof Wilczynski at Apr 23, 2012 at 1:57 pm
    Hi,
    On Monday, 23 April 2012 13:59:00 UTC+1, Dennis Jacobfeuerborn wrote:

    Thanks, this looks like it will do the trick. The lack of puppet://
    support probably means I will have to hard-code a path to a directory
    somewhere but that shouldn't be to big of a deal.
    [...]

    Apologies for that :-(

    Adding support for "puppet://" is quite tricky (there is a lot going on
    under-the-hood with this one), and I never have the time to do it (unless
    somebody is willing to help out and/or sponsor).

    For the time being, please bare with fully-qualified paths ...

    KW

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/EkfQJ_W21WUJ.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Dennis Jacobfeuerborn at Apr 23, 2012 at 3:15 pm
    I didn't mean to imply that this was your fault and I already knew that the
    puppet support probably was missing because it's quite tricky to implement.
    Since I've started looking into writing my own functions and modules and
    get a bit deeper into puppet I might actually look into this myself if I
    find the time. If I make any progress there you can expect a pull request
    for the changes :)
    On Monday, April 23, 2012 3:57:08 PM UTC+2, matti wrote:

    Hi,
    On Monday, 23 April 2012 13:59:00 UTC+1, Dennis Jacobfeuerborn wrote:

    Thanks, this looks like it will do the trick. The lack of puppet://
    support probably means I will have to hard-code a path to a directory
    somewhere but that shouldn't be to big of a deal.
    [...]

    Apologies for that :-(

    Adding support for "puppet://" is quite tricky (there is a lot going on
    under-the-hood with this one), and I never have the time to do it (unless
    somebody is willing to help out and/or sponsor).

    For the time being, please bare with fully-qualified paths ...

    KW
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/NAMjjrnooXwJ.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Krzysztof Wilczynski at Apr 23, 2012 at 4:28 pm
    Hi,

    On Monday, 23 April 2012 16:14:59 UTC+1, Dennis Jacobfeuerborn wrote:
    [...]
    If I make any progress there you can expect a pull request for the changes
    :)
    [...]

    Thank you! That's very kind :) Let me know if I can help and/or we can join
    efforts.

    KW

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/FSqkMxG3cyEJ.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    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
postedApr 22, '12 at 1:15a
activeApr 23, '12 at 4:28p
posts6
users2
websitepuppetlabs.com

People

Translate

site design / logo © 2023 Grokbase