$ puppet help
$ puppet apply path/file.pp
$ puppet resource mailalias postmaster
$ facter
$ facter | grep version
$ facter | grep mb
$ facter | grep free
$ puppet facts
$ puppet facts find
$ puppet facts --render-as yaml
$ facter --yaml
$ puppet facts --render-as json
$ facter --json
$ puppet module search apache
$myvar $my_var $my3tupes # Valid
$Myvar $my-var $3types # Invalid
$_myvar # Should only used within local scope
# There are only String, Numeric, and Boolean
$ny_name = 'Jo'
$num_phone = 12342143214
$not_tre = false
$not_defined = undef
$test='my-test'
$fact_uptime=$facts['uptime']
notify {'greeting':
message => "heillo ${test} ${kernel} ${fact_uptime}"
}
puppetlabs libs
include stdlib
$nametype = type_of( $my_name )
Numbers
$decimal = 123
$decimal = 123.33
$octal = 0775
$hexadecimal = 0xFAFA
myfunction( *$array_of_arguments ){}
$homes={
'key1'=>'value1',
'key2'=>'value2',
}
debug(message)
info(message)
notice(message)
warning(message)
err(message)
notice('haha') ==== 'haha'.notice()
file { 'testfile':
ensure => present,
mode => '0700',
replace => true,
content => 'hie1111',
path => '/nail/home/pparuni/test.log',
noop => true, # <---- This will not replace the file test.log
}