stdlib module not working

411 views
Skip to first unread message

Stefan Wiederoder

unread,
Mar 29, 2012, 11:08:09 AM3/29/12
to puppet...@googlegroups.com
I´m trying to utilize the new stdlib module, but got stuck after installation on my puppet server.

I´ve tried to use the included test file file_line.pp on the server, but it´s only creating the file - but not managing the content.

the same problem on my clients (the new provider file_line has been synced), it´s just not working:

        file_line { 'puppet master host entry':
                line => '172.16.240.200  master.dev.puppetlabs.com       master',
                path => '/etc/hosts',
        }

do you have any Ideas what´s wrong?

thanks
,
Stefan

Dan White

unread,
Mar 29, 2012, 9:17:02 PM3/29/12
to puppet...@googlegroups.com
Why not use host instead of file_line ?

http://docs.puppetlabs.com/references/latest/type.html#host

host { 'puppet master host entry':
ip => '172.16.240.200',
name => 'master.dev.puppetlabs.com',
host_aliases => ['master'],

Eric Shamow

unread,
Mar 29, 2012, 9:17:50 PM3/29/12
to puppet...@googlegroups.com
Stefan,

Looks related to https://projects.puppetlabs.com/issues/13530, which I just opened.

Make sure you ensure => present in the file_line resource.

-Eric

-- 

Eric Shamow
Professional Services

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Stefan Wiederoder

unread,
Mar 30, 2012, 5:18:32 AM3/30/12
to puppet...@googlegroups.com
thanks Eric,

ensure did the trick, now I´m stuck while trying to use a facter variable within the line statement:
 
    file_line { "tmpfs entry":
        line => "tmpfs  /dev/shm    tmpfs   size=${kis_tmpfs_size}  0 0",
        path => "/etc/fstab.d/system.fstab",
        ensure => present
    }

maybe it´s better to try validate_string.

bye
,
Stefan




John Warburton

unread,
Apr 2, 2012, 1:43:33 AM4/2/12
to puppet...@googlegroups.com

Per Dan White - you should be using puppet built in resources for the job: the "host" resource for modifying /etc/hosts and the "mount" resource for modifying /etc/fstab - http://docs.puppetlabs.com/references/latest/type.html

I define $tmpfs_size elsewhere

    mount{ "/tmp":
        ensure  => mounted,
        device  => "tmpfs",
        fstype  => "tmpfs",
        pass    => "0",
        dump    => "0",
        options => "size=${tmpfs_size}m,mode=1777",
    }

John

Reply all
Reply to author
Forward
0 new messages