You'll want to add "ensure => present" to the file_line resource and then
run it again.  That should help you out!


On Thu, May 10, 2012 at 3:52 PM, Philip Brown <p...@bolthole.com> wrote:

>
>
> On Wednesday, May 9, 2012 11:55:01 AM UTC-7, Gary Larizza wrote:
>
>>
>> Philip,
>>
>> You can use Augeas to do this, or look at a custom file_line type in the
>> Puppetlabs-stdlib module --> https://github.com/**
>> puppetlabs/puppetlabs-stdlib/**blob/master/lib/puppet/type/**file_line.rb<https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/lib/puppet/type/file_line.rb>
>>
>>
>>
> A followup to this hint:
> I managed to get a test box, to install newer puppet, and get this module,
> and try it out.
> Tests look not so good.
>
> $ more tests/file_line.pp
> # This is a simple smoke test
> # of the file_line resource type.
> file { '/tmp/dansfile':
>   ensure => present
> }->
> file_line { 'dans_line':
>   line => 'dan is awesome',
>   path => '/tmp/dansfile',
> }
>
> ## Okay, looks good, lets try it out...
>
> $  puppet apply tests/file_line.pp
> notice: /Stage[main]//File[/tmp/dansfile]/ensure: created
> notice: Finished catalog run in 0.04 seconds
>
> ##okay, this test file created, but..
>
> $ cat /tmp/dansfile
> $
>
> It does not have any content!!
>
>
> (it would seem that the provided test, needs some testing :-/ Adding
> ensure=>present seems to make it happen. but shouldnt that already be in
> the "test/file_line.pp" file? )
>
>
>  --
> 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/-/o-L4mfgshu0J.
>
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>



-- 

Gary Larizza
Professional Services Engineer
Puppet Labs

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

Reply via email to