FAQ
Here's the function:

module Puppet::Parser::Functions
newfunction(:fact_to_array, :type => :rvalue) do |args|
args[0].split(',')
end
end

Here's the class I'm trying to use it in:

class oms::all_config {
file { '/var/lib/oms/config':
source => 'puppet:///deployment/deployment',
recurse => true,
purge => true,
force => true,
ignore => fact_to_array('DIR_1,DIR_2,DIR_3'),
require => Class['oms::oms_directory'],
}
}

Getting the following error when trying to run puppet agent --test on a
remote agent:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
Function 'fact_to_array' does not return a value at
/etc/puppet/modules/oms/manifests/init.pp:13 on node oms-2787

I'm out of ideas as to why is it not working. Will appreciate any help on
this.
Thanks ahead

--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Andriy Yurchuk at Feb 3, 2013 at 8:29 pm
    For some unknown reason it works after enabling PuppetDB.
    On Sunday, February 3, 2013 8:26:18 PM UTC+2, Andriy Yurchuk wrote:

    Here's the function:

    module Puppet::Parser::Functions
    newfunction(:fact_to_array, :type => :rvalue) do |args|
    args[0].split(',')
    end
    end

    Here's the class I'm trying to use it in:

    class oms::all_config {
    file { '/var/lib/oms/config':
    source => 'puppet:///deployment/deployment',
    recurse => true,
    purge => true,
    force => true,
    ignore => fact_to_array('DIR_1,DIR_2,DIR_3'),
    require => Class['oms::oms_directory'],
    }
    }

    Getting the following error when trying to run puppet agent --test on a
    remote agent:

    Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
    Function 'fact_to_array' does not return a value at
    /etc/puppet/modules/oms/manifests/init.pp:13 on node oms-2787

    I'm out of ideas as to why is it not working. Will appreciate any help on
    this.
    Thanks ahead
    --
    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 post to this group, send email to [email protected].
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • R.I.Pienaar at Feb 3, 2013 at 8:32 pm

    ----- Original Message -----
    From: "Andriy Yurchuk" <[email protected]>
    To: [email protected]
    Sent: Sunday, February 3, 2013 9:28:58 PM
    Subject: [Puppet Users] Re: Another "function does not return a value" problem

    For some unknown reason it works after enabling PuppetDB.
    I guess you restarted the master while doing this?

    you have to restart it each time you change a function

    --
    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 post to this group, send email to [email protected].
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Andriy Yurchuk at Feb 4, 2013 at 11:54 am
    Yes, that was the reason perhaps.
    Thanks.
    On Sunday, February 3, 2013 10:32:32 PM UTC+2, R.I. Pienaar wrote:


    ----- Original Message -----
    From: "Andriy Yurchuk" <[email protected] <javascript:>>
    To: [email protected] <javascript:>
    Sent: Sunday, February 3, 2013 9:28:58 PM
    Subject: [Puppet Users] Re: Another "function does not return a value" problem
    For some unknown reason it works after enabling PuppetDB.
    I guess you restarted the master while doing this?

    you have to restart it each time you change a function
    --
    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 post to this group, send email to [email protected].
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedFeb 3, '13 at 6:28p
activeFeb 4, '13 at 11:54a
posts4
users2
websitepuppetlabs.com

2 users in discussion

Andriy Yurchuk: 3 posts R.I.Pienaar: 1 post

People

Translate

site design / logo © 2023 Grokbase