import "config.pp" $templates_dir = "$puppet_bootstrap_tmpdir/templates" # puppet config package { [ "puppet", "puppetmaster" ]: ensure => installed, } service { "puppetmaster": ensure => stopped, require => Package["puppetmaster"] } # reference to admin vserver host { "$hostname": ensure => present, ip => "127.0.0.1", host_aliases => [ "$hostname.$domain", "puppet.$domain", "puppet", "admin" ], } # puppet submodules script file { "/usr/local/sbin/puppet-bootstrap": owner => "root", group => "root", mode => 0755, ensure => present, require => Package["puppet"], content => template("$templates_dir/bin/puppet-bootstrap"), } # execute the bootstrap script to download puppet modules exec { "/usr/local/sbin/puppet-bootstrap add-submodules": user => root, require => [ File["/usr/local/sbin/puppet-bootstrap"], File["$default_puppet_conf_dir/modules"] ], timeout => 600, } # directories file { ["$puppet_dir", "$default_puppet_conf_dir"]: ensure => directory, owner => "puppet", group => "puppet", mode => 0755, require => Package["puppet"], } file { [ "$default_puppet_conf_dir/files", "$default_puppet_conf_dir/manifests", "$default_puppet_conf_dir/modules", "$default_puppet_conf_dir/manifests/classes", "$default_puppet_conf_dir/manifests/nodes" ]: ensure => directory, owner => "puppet", group => "puppet", mode => 0755, require => File["$default_puppet_conf_dir"], } # files in $default_puppet_conf_dir file { "$default_puppet_conf_dir/puppet.conf": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => Package["puppet"], content => template("$templates_dir/puppet/puppet.conf.erb"), } file { "$default_puppet_conf_dir/fileserver.conf": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => Package["puppet"], content => template("$templates_dir/puppet/fileserver.conf.erb"), } file { "$default_puppet_conf_dir/auth.conf": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => Package["puppet"], content => template("$templates_dir/puppet/auth.conf.erb"), } # files in $default_puppet_conf_dir/manifests file { "$default_puppet_conf_dir/manifests/site.pp": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/manifests"] ], content => template("$templates_dir/puppet/site.pp.erb"), } file { "$default_puppet_conf_dir/manifests/modules.pp": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/manifests"] ], content => template("$templates_dir/puppet/modules.pp.erb"), } file { "$default_puppet_conf_dir/manifests/nodes.pp": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/manifests"] ], content => template("$templates_dir/puppet/nodes.pp.erb"), } # files in $default_puppet_conf_dir/manifests/classes file { "$default_puppet_conf_dir/manifests/classes/websites.pp": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/manifests/classes"] ], content => template("$templates_dir/puppet/websites.pp.erb"), } file { "$default_puppet_conf_dir/manifests/classes/users.pp": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/manifests/classes"] ], content => template("$templates_dir/puppet/users.pp.erb"), } # files in $default_puppet_conf_dir/manifests/nodes file { "$default_puppet_conf_dir/manifests/nodes/$hostname-server.pp": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/manifests/nodes"] ], content => template("$templates_dir/puppet/server.pp.erb"), } file { "$default_puppet_conf_dir/manifests/nodes/$hostname-master.pp": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/manifests/nodes"] ], content => template("$templates_dir/puppet/master.pp.erb"), } file { "$default_puppet_conf_dir/manifests/nodes/$hostname-proxy.pp": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/manifests/nodes"] ], content => template("$templates_dir/puppet/proxy.pp.erb"), } file { "$default_puppet_conf_dir/manifests/nodes/$hostname-web.pp": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/manifests/nodes"] ], content => template("$templates_dir/puppet/web.pp.erb"), } file { "$default_puppet_conf_dir/manifests/nodes/$hostname-storage.pp": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/manifests/nodes"] ], content => template("$templates_dir/puppet/storage.pp.erb"), } file { "$default_puppet_conf_dir/manifests/nodes/$hostname-test.pp": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/manifests/nodes"] ], content => template("$templates_dir/puppet/test.pp.erb"), } # files in $default_puppet_conf_dir/files file { [ "$default_puppet_conf_dir/files/etc", "$default_puppet_conf_dir/files/etc/nginx", "$default_puppet_conf_dir/files/etc/nagios3", "$default_puppet_conf_dir/files/postfix", "$default_puppet_conf_dir/files/apache", "$default_puppet_conf_dir/files/apache/vhosts", "$default_puppet_conf_dir/files/apache/htdocs", "$default_puppet_conf_dir/files/apache/htdocs/images", "$default_puppet_conf_dir/files/keys", "$default_puppet_conf_dir/files/keys/ssl", "$default_puppet_conf_dir/files/shorewall" ]: ensure => directory, owner => "puppet", group => "puppet", mode => 0755, } file { "$default_puppet_conf_dir/files/apache/htdocs/images/README.html": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/files/apache/htdocs/images"] ], content => template("$templates_dir/apache/htdocs/images/README.html.erb"), } file { "$default_puppet_conf_dir/files/apache/htdocs/index.html": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/files/apache/htdocs"] ], content => template("$templates_dir/apache/htdocs/index.html.erb"), } file { "$default_puppet_conf_dir/files/apache/htdocs/missing.html": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/files/apache/htdocs"] ], content => template("$templates_dir/apache/htdocs/missing.html.erb"), } file { "$default_puppet_conf_dir/files/apache/vhosts/git": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/files/apache/vhosts"] ], content => template("$templates_dir/apache/vhosts/git.erb"), } file { "$default_puppet_conf_dir/files/apache/vhosts/lists": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/files/apache/vhosts"] ], content => template("$templates_dir/apache/vhosts/lists.erb"), } file { "$default_puppet_conf_dir/files/apache/vhosts/mail": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/files/apache/vhosts"] ], content => template("$templates_dir/apache/vhosts/mail.erb"), } file { "$default_puppet_conf_dir/files/apache/vhosts/nagios": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/files/apache/vhosts"] ], content => template("$templates_dir/apache/vhosts/nagios.erb"), } file { "$default_puppet_conf_dir/files/apache/vhosts/wiki": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/files/apache/vhosts"] ], content => template("$templates_dir/apache/vhosts/wiki.erb"), } file { "$default_puppet_conf_dir/files/etc/aliases": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/files/etc"] ], content => template("$templates_dir/etc/aliases.erb"), } file { "$default_puppet_conf_dir/files/etc/nagios3/htpasswd.users": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/files/etc/nagios3"] ], content => template("$templates_dir/etc/nagios3/htpasswd.users.erb"), } file { "$default_puppet_conf_dir/files/etc/nginx/$domain": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/files/etc/nginx"] ], content => template("$templates_dir/etc/nginx/domain.erb"), } file { "$default_puppet_conf_dir/files/postfix/tls_policy": ensure => present, owner => "puppet", group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/files/postfix"] ], content => template("$templates_dir/postfix/tls_policy.erb"), }