Skip to content

Instantly share code, notes, and snippets.

View WhatsARanjit's full-sized avatar

Ranjit Viswakumar WhatsARanjit

View GitHub Profile
class myclass::test {
file { '/tmp/test':
ensure => dir,
}
}
# puppet apply -e 'include myclass::test'
# ll /tmp
lrwxrwxrwx 1 root root 3 Jun 4 13:56 test -> dir
$ puppet resource package httpd ensure= che
purged apache
Notice: /Package[httpd]/ensure: created ├── files
│   └── index.html
package { 'httpd': ├── manifests
ensure => 'absent', │   └── init.pp
}
$ puppet resource package httpd ensure=purged
Notice: /Package[httpd]/ensure: created
package { 'httpd':
ensure => 'absent',
}
@WhatsARanjit
WhatsARanjit / chadpaste
Created June 5, 2014 14:41
Chad can eat my shorts
This
is
multiline
clean
pasting
# Define
class my_mysql (
$param1 = 'default1',
$param2 = 'default2'
) {
$myhash = {
'param1' => $param1,
'param2' => $param2,
}
}
[main]
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl
environmentpath = $confdir/environments
[agent]
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig
root@ubuntu:~# puppet apply -e 'package { "TeamViewer": provider => "dpkg", source => "http://download.teamviewer.com/download/teamviewer_linux_x64.deb", ensure => installed, }'
Error: Execution of '/usr/bin/dpkg --force-confold -i http://download.teamviewer.com/download/teamviewer_linux_x64.deb' returned 1: dpkg: error processing http://download.teamviewer.com/download/teamviewer_linux_x64.deb (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:
http://download.teamviewer.com/download/teamviewer_linux_x64.deb
Error: /Stage[main]//Package[TeamViewer]/ensure: change from purged to present failed: Execution of '/usr/bin/dpkg --force-confold -i http://download.teamviewer.com/download/teamviewer_linux_x64.deb' returned 1: dpkg: error processing http://download.teamviewer.com/download/teamviewer_linux_x64.deb (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:
http://download.teamviewer.com/download/teamview
exec { '/usr/loca/bin/somescript.sh':
unless => 'yum list mypackage'
}
package { 'mypackage':
ensure => installed,
require => Exec['/usr/loca/bin/somescript.sh'],
}
MASTER
class ssh::install {
package { $ssh::params::ssh_packages :
ensure => installed,
}
}
class ssh::config {
Debug: Executing '/sbin/service iptables status'
Debug: Executing '/sbin/chkconfig iptables'
Debug: Executing '/sbin/service iptables start'
Error: Could not start Service[iptables]: Execution of '/sbin/service iptables start' returned 6:
Error: /Stage[main]/Firewall::Linux::Redhat/Service[iptables]/ensure: change from stopped to running failed: Could not start Service[iptables]: Execution of '/sbin/service iptables start' returned 6:
Debug: Failed to load library 'msgpack' for feature 'msgpack'
Debug: file_metadata supports formats: pson b64_zlib_yaml yaml raw
Debug: /Stage[main]/Fundamentals::Agent::Hiera/File[/etc/puppetlabs/puppet/hieradata]/mode: Not managing symlink mode
Debug: Failed to load library 'msgpack' for feature 'msgpack'
Debug: file_metadata supports formats: pson b64_zlib_yaml yaml raw