Skip to content

Instantly share code, notes, and snippets.

@tels7ar
Created January 12, 2012 20:49
Show Gist options
  • Save tels7ar/1603019 to your computer and use it in GitHub Desktop.
Save tels7ar/1603019 to your computer and use it in GitHub Desktop.
#
# Automatically generated by blueprint(7). Edit at your own risk.
#
class second {
Exec {
path => '/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/var/lib/gems/1.8/bin/',
}
Class['files'] -> Class['packages']
class files {
file {
'/etc':
ensure => directory;
'/etc/aliases.db':
content => template('second/etc/aliases.db'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/apache2':
ensure => directory;
'/etc/apache2/httpd.conf':
content => template('second/etc/apache2/httpd.conf'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/apache2/sites-enabled':
ensure => directory;
'/etc/apache2/sites-enabled/000-default':
ensure => '../sites-available/default',
group => root,
owner => root;
'/etc/apt':
ensure => directory;
'/etc/apt/sources.list':
content => template('second/etc/apt/sources.list'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/apt/sources.list.20120103':
content => template('second/etc/apt/sources.list.20120103'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/apt/sources.list.d':
ensure => directory;
'/etc/apt/sources.list.d/devstructure.list':
content => template('second/etc/apt/sources.list.d/devstructure.list'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/apt/trusted.gpg.d':
ensure => directory;
'/etc/apt/trusted.gpg.d/devstructure.gpg':
content => template('second/etc/apt/trusted.gpg.d/devstructure.gpg'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/default':
ensure => directory;
'/etc/default/bind9':
content => template('second/etc/default/bind9'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/exim4':
ensure => directory;
'/etc/exim4/update-exim4.conf.conf':
content => template('second/etc/exim4/update-exim4.conf.conf'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/initramfs-tools':
ensure => directory;
'/etc/initramfs-tools/conf.d':
ensure => directory;
'/etc/initramfs-tools/conf.d/driver-policy':
content => template('second/etc/initramfs-tools/conf.d/driver-policy'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/locale.gen':
content => template('second/etc/locale.gen'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/mailname':
content => template('second/etc/mailname'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/network':
ensure => directory;
'/etc/network/run':
ensure => directory;
'/etc/network/run/ifstate':
content => template('second/etc/network/run/ifstate'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/postfix':
ensure => directory;
'/etc/postfix/main.cf':
content => template('second/etc/postfix/main.cf'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/shells':
content => template('second/etc/shells'),
ensure => file,
group => root,
mode => 0644,
owner => root;
'/etc/ufw':
ensure => directory;
'/etc/ufw/ufw.conf':
content => template('second/etc/ufw/ufw.conf'),
ensure => file,
group => root,
mode => 0644,
owner => root;
}
}
include files
class packages {
exec { 'apt-get -q update':
before => Class['apt'],
}
class apt {
package {
'apache2':
ensure => '2.2.16-6+squeeze4';
'apache2-mpm-worker':
ensure => '2.2.16-6+squeeze4';
'apache2-utils':
ensure => '2.2.16-6+squeeze4';
'apache2.2-bin':
ensure => '2.2.16-6+squeeze4';
'apache2.2-common':
ensure => '2.2.16-6+squeeze4';
'bind9':
ensure => '1:9.7.3.dfsg-1~squeeze4';
'bind9utils':
ensure => '1:9.7.3.dfsg-1~squeeze4';
'blueprint':
ensure => '3.4.0-1py2.6';
'busybox':
ensure => '1:1.17.1-8';
'ccze':
ensure => '0.2.1-2';
'discover':
ensure => '2.1.2-5';
'discover-data':
ensure => '2.2010.10.18';
'git':
ensure => '1:1.7.2.5-3';
'git-core':
ensure => '1:1.7.2.5-3';
'grub-common':
ensure => '1.98+20100804-14+squeeze1';
'grub-legacy':
ensure => '0.97-64';
'initramfs-tools':
ensure => '0.98.8';
'klibc-utils':
ensure => '1.5.20-1+squeeze1';
'libapr1':
ensure => '1.4.2-6+squeeze3';
'libaprutil1':
ensure => '1.3.9+dfsg-5';
'libaprutil1-dbd-sqlite3':
ensure => '1.3.9+dfsg-5';
'libaprutil1-ldap':
ensure => '1.3.9+dfsg-5';
'libc6-i386':
ensure => '2.11.3-2';
'libcurl3-gnutls':
ensure => '7.21.0-2';
'libdiscover2':
ensure => '2.1.2-5';
'liberror-perl':
ensure => '0.17-1';
'libfreetype6':
ensure => '2.4.2-2.1+squeeze3';
'libklibc':
ensure => '1.5.20-1+squeeze1';
'liblua5.1-0':
ensure => '5.1.4-5';
'libpcap0.8':
ensure => '1.1.1-2+squeeze1';
'libuuid-perl':
ensure => '0.02-4';
'linux-base':
ensure => '2.6.32-40';
'linux-image-2.6-amd64':
ensure => '2.6.32+29';
'linux-image-2.6.32-5-amd64':
ensure => '2.6.32-40';
'nmap':
ensure => '5.00-3';
'openssh-server':
ensure => '1:5.5p1-6+squeeze1';
'resolvconf':
ensure => '1.46';
'rsync':
ensure => '3.0.7-2';
'screen':
ensure => '4.0.3-14';
'ssl-cert':
ensure => '1.0.28';
'strace':
ensure => '4.5.20-2';
'sudo':
ensure => '1.7.4p4-2.squeeze.2';
'ufw':
ensure => '0.29.3-1';
}
}
include apt
}
include packages
class services {
class sysvinit {
service {
'apache2':
enable => true,
ensure => running,
subscribe => [File['/etc/apache2/sites-enabled/000-default'], File['/etc/default/bind9'], File['/etc/apache2/httpd.conf'], Package['apache2.2-common']];
'bind9':
enable => true,
ensure => running,
subscribe => [File['/etc/default/bind9'], File['/etc/ufw/ufw.conf'], Package['bind9']];
'rsync':
enable => true,
ensure => running,
subscribe => [File['/etc/default/bind9'], Package['rsync']];
'ssh':
enable => true,
ensure => running,
subscribe => [File['/etc/default/bind9'], File['/etc/ufw/ufw.conf'], Package['openssh-server']];
'sudo':
enable => true,
ensure => running,
subscribe => Package['sudo'];
}
}
include sysvinit
}
include services
}
@tels7ar
Copy link
Author

tels7ar commented Jan 12, 2012

$ puppet apply -v --evaltrace manifests/init.pp
info: Applying configuration version '1326399368'
info: /Filebucket[puppet]: Evaluated in 0.00 seconds
info: /Schedule[never]: Evaluated in 0.00 seconds
info: /Schedule[monthly]: Evaluated in 0.00 seconds
info: /Schedule[daily]: Evaluated in 0.00 seconds
info: /Schedule[puppet]: Evaluated in 0.00 seconds
info: /Schedule[hourly]: Evaluated in 0.00 seconds
info: /Schedule[weekly]: Evaluated in 0.00 seconds

@tels7ar
Copy link
Author

tels7ar commented Jan 12, 2012

Fixed my problem! Had to declare class 'second' in the manifest:

class{'second': }

Did I mention I know nothing about ruby?

@JoshAnderson
Copy link

This manifest is just a class declaration. (A really fugly one...)

In order for puppet to actually apply this definition, you'll have to tell it to include this class in the config to be evaluated.

Add this to the end of the manifest:

include second

Then run puppet apply --modulesdir ../.. second.pp (assuming that you are in the "manifests" dir.)

Keep in mind that this generated manifest assumes that your module is going to live somewhere that puppet will automatically look for modules, like /etc/puppet/modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment