FAQ
I have searched wide and far for a solution to this issue, but didn't find
any real solution that I could use.

I am running puppet ver. 3.0.2, and my problem is when I try to parse an
array to a define in a manifest.

My code looks as the following:

$testaccess = hiera('testaccess')

define testdefine () {
notify{"Parsed following to define: ${name} : }
}

which gives the following output:
Parsed following to define: test1test2

It seems that the array is concatenated into one string, instead of parsing
each entry in the array to the define.

Can anyone shed some light into this issue, would be much appreciated :)

/Marc

--
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 puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
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

  • Marc at Feb 1, 2013 at 10:26 am
    Sorry - forgot to supply the call to the define:

    testdefine { "$testaccess": }

    Again - any feedback on the usage here would be much appreciated.

    /Marc

    Den fredag den 1. februar 2013 11.19.51 UTC+1 skrev ma...@ml4.dk:
    I have searched wide and far for a solution to this issue, but didn't find
    any real solution that I could use.

    I am running puppet ver. 3.0.2, and my problem is when I try to parse an
    array to a define in a manifest.

    My code looks as the following:

    $testaccess = hiera('testaccess')

    define testdefine () {
    notify{"Parsed following to define: ${name} : }
    }

    which gives the following output:
    Parsed following to define: test1test2

    It seems that the array is concatenated into one string, instead of
    parsing each entry in the array to the define.

    Can anyone shed some light into this issue, would be much appreciated :)

    /Marc
    --
    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    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 1, 2013 at 10:28 am

    ----- Original Message -----
    From: marc@ml4.dk
    To: puppet-users@googlegroups.com
    Sent: Friday, February 1, 2013 11:19:51 AM
    Subject: [Puppet Users] Problems parsing array to a define in puppet manifest

    I have searched wide and far for a solution to this issue, but didn't find
    any real solution that I could use.

    I am running puppet ver. 3.0.2, and my problem is when I try to parse an
    array to a define in a manifest.

    My code looks as the following:

    $testaccess = hiera('testaccess')

    define testdefine () {
    notify{"Parsed following to define: ${name} : }
    }

    which gives the following output:
    Parsed following to define: test1test2

    It seems that the array is concatenated into one string, instead of parsing
    each entry in the array to the define.

    Can anyone shed some light into this issue, would be much appreciated :)
    You're not showing how you pass the array to the define but I would guess
    you're doing:

    testdefine{"$testaccess": } this turns the array into a string, you probably
    should just remove the "s and make it testdefine{$testaccess: }
    /Marc

    --
    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Marc at Feb 1, 2013 at 10:35 am
    Of course - why did I miss that?

    Thanks for the resolution Pienaar, now I can move on with the manifest :)

    /Marc

    Den fredag den 1. februar 2013 11.28.33 UTC+1 skrev R.I. Pienaar:

    ----- Original Message -----
    From: ma...@ml4.dk <javascript:>
    To: puppet...@googlegroups.com <javascript:>
    Sent: Friday, February 1, 2013 11:19:51 AM
    Subject: [Puppet Users] Problems parsing array to a define in puppet manifest
    I have searched wide and far for a solution to this issue, but didn't find
    any real solution that I could use.

    I am running puppet ver. 3.0.2, and my problem is when I try to parse an
    array to a define in a manifest.

    My code looks as the following:

    $testaccess = hiera('testaccess')

    define testdefine () {
    notify{"Parsed following to define: ${name} : }
    }

    which gives the following output:
    Parsed following to define: test1test2

    It seems that the array is concatenated into one string, instead of parsing
    each entry in the array to the define.

    Can anyone shed some light into this issue, would be much appreciated :)
    You're not showing how you pass the array to the define but I would guess
    you're doing:

    testdefine{"$testaccess": } this turns the array into a string, you
    probably
    should just remove the "s and make it testdefine{$testaccess: }
    /Marc

    --
    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 puppet-users...@googlegroups.com <javascript:>.
    To post to this group, send email to puppet...@googlegroups.com<javascript:>.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    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 1, '13 at 10:26a
activeFeb 1, '13 at 10:35a
posts4
users2
websitepuppetlabs.com

2 users in discussion

Marc: 3 posts R.I.Pienaar: 1 post

People

Translate

site design / logo © 2022 Grokbase