Create a file (with class)


title: “Create a file (with class)”
date: 2016-01-13T15:53:50
slug: create-a-file-with-class


Creates the files /usr/local/sbin/puppetsimple.sh with owner=root, group=root, mode=0755

file {'/usr/local/sbin/puppetsimple.sh':
 owner => root, group => root, mode => 0755,
 content => "#!/bin/sh
puppet agent --onetime --no-daemonize --verbose $1
",
}

Define a class (container) that do this and execute the class/container

class toolbox{
 file {'/usr/local/sbin/puppetsimple.sh':
 owner => root, group => root, mode => 0755,
 content => "#!/bin/sh
puppet agent --onetime --no-daemonize --verbose $1
",
 }
}

include toolbox
Print Friendly, PDF & Email