FAQ
Good day

I wrote my own fact for facter. And as you can see from my copy and
paste it appears to be working.

disk => ["/dev/sda", "/dev/sdb"]
disk_count => 2

The problem I appear to have is. This is the code for my template.

<%- @disk.each do |dev| %>
    disk <%= dev %>
<%- end %>

And the result I get back is/

+
+disk /dev/sda/dev/sdb
+

as opposed to

disk /dev/sda
disk /dev/sdb

Would anyone know why I am getting a string as opposed to an array.

Another question, if you dont mind. Is there a reason why the interfaces
fact is a string and not an array?
interfaces => eth0,eth1,lo

Kind Regards
Brent Clark

--
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

  • Jcbollinger at May 15, 2013 at 2:28 pm

    On Wednesday, May 15, 2013 2:15:14 AM UTC-5, Brent wrote:

    Would anyone know why I am getting a string as opposed to an array.
    Because all facts are strings. That's the way it has always been, though I
    understand there's some work underway to provide for more data types in the
    future.


    Another question, if you dont mind. Is there a reason why the interfaces
    fact is a string and not an array?
    interfaces => eth0,eth1,lo
    Yes, because all facts are strings. If you want an array then you can
    process the fact value through the split() function.


    John

    --
    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
postedMay 15, '13 at 7:13a
activeMay 15, '13 at 2:28p
posts2
users2
websitepuppetlabs.com

2 users in discussion

Jcbollinger: 1 post Brent Clark: 1 post

People

Translate

site design / logo © 2022 Grokbase