Page MenuHomePhabricator
Paste P6415

Puppet...
ActivePublic

Authored by Joe on Dec 1 2017, 2:55 PM.
Tags
None
Referenced Files
F11123698: Puppet...
Dec 1 2017, 2:55 PM
Subscribers
None
# Puppet 4.8.2
$ cat test.pp
node 'gizmo.local' {
create_resources('@@file', {'/tmp/test' => { ensure => 'present', content => 'test!'}})
}
$ rbenv exec bundle exec puppet apply test.pp
Notice: Compiled catalog for gizmo.local in environment production in 0.08 seconds
Notice: /Stage[main]/Main/Node[gizmo.local]/File[/tmp/test]/ensure: defined content as '{md5}c4d354440cb41ee38e162bc1f431e99b'
Notice: Applied catalog in 0.04 seconds
$ rm /tmp/test
$ PUPPET_GEM_VERSION=3.8.5 rbenv exec bundle exec puppet apply test.pp
Notice: Compiled catalog for gizmo.local in environment production in 0.19 seconds

Event Timeline

define die_puppet_die ($content){                                                                                                                                            
    @@file { $title:                                                                                                                                                         
        ensure => present,                                                                                                                                                   
        content => $content                                                                                                                                                  
    }                                                                                                                                                                        
}                                                                                                                                                                            
                                                                                                                                                                             
                                                                                                                                                                             
node 'gizmo.local' {                                                                                                                                                         
    create_resources('die_puppet_die', {'/tmp/test' => { content => 'test!'}})                                                                                               
}                                                                                                                                                                            



$ rbenv exec bundle exec puppet apply test.pp 
Warning: You cannot collect exported resources without storeconfigs being set; the export is ignored at /home/joe/Code/WMF/puppet/test.pp:2:5
Notice: Compiled catalog for gizmo.local in environment production in 0.08 seconds
Notice: Applied catalog in 0.03 seconds