From b50dd8ae86f3d8bb52c5ad32de559395c6f46e21 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 4 Mar 2014 13:50:56 -0300 Subject: Move bootstrap specific manifests to a folder --- manifests/bootstrap/configurator.pp | 241 ++++++++++++++++++++++++++++++++++++ manifests/bootstrap/host.pp | 24 ++++ manifests/bootstrap/master.pp | 12 ++ manifests/bootstrap/vagrant.pp | 49 ++++++++ manifests/classes/configurator.pp | 241 ------------------------------------ manifests/host.pp | 24 ---- manifests/master.pp | 12 -- manifests/vagrant.pp | 49 -------- 8 files changed, 326 insertions(+), 326 deletions(-) create mode 100644 manifests/bootstrap/configurator.pp create mode 100644 manifests/bootstrap/host.pp create mode 100644 manifests/bootstrap/master.pp create mode 100644 manifests/bootstrap/vagrant.pp delete mode 100644 manifests/classes/configurator.pp delete mode 100644 manifests/host.pp delete mode 100644 manifests/master.pp delete mode 100644 manifests/vagrant.pp (limited to 'manifests') diff --git a/manifests/bootstrap/configurator.pp b/manifests/bootstrap/configurator.pp new file mode 100644 index 0000000..cf2d891 --- /dev/null +++ b/manifests/bootstrap/configurator.pp @@ -0,0 +1,241 @@ +# +# Puppet Bootstrap Configuration Manifest. +# +# This file is responsible to set custom configuration in the bootstrap +# repository for values set in the hiera configuration. +# +# This manifest is useful mostly after you cloned the puppet-boostrap module +# and want to configure it to boostrap a whole puppetmaster infrastructure. +# + +# Basic variables +$templates = "$bootstrap_path/templates" +$base_domain = hiera('bootstrap::base_domain', 'example.org') +$db_password = hiera('nodo::role::master::db_password', 'changeme') +$mysql_rootpw = hiera('mysql::server::rootpw', '') +$root_password = hiera('bootstrap::root:password', 'rootpass') +$first_user = hiera('bootstrap::first_user', 'user') +$first_user_password = hiera('bootstrap::first_user::password', 'userpass') +$first_user_sshkey = hiera('bootstrap::first_user::sshkey', 'usersshkey') +$first_user_email = hiera('bootstrap::first_user::email', 'usermail') +$resolvconf_nameservers = hiera('nodo::subsystem::resolver::nameservers', '201.6.2.152:201.6.2.32') +$global_munin_allow = hiera('nodo::munin_node::allow', '192.168.0.[0-9]*') + +# Puppet configuration +file { "$bootstrap_path/puppet.conf": + ensure => present, + mode => 0644, + content => template("$templates/puppet/puppet.conf.erb"), +} + +# Fileserver configuration +file { "$bootstrap_path/fileserver.conf": + ensure => present, + mode => 0644, + content => template("$templates/puppet/fileserver.conf.erb"), +} + +file { "$bootstrap_path/auth.conf": + ensure => present, + mode => 0644, + content => template("$templates/puppet/auth.conf.erb"), +} + +## Basic nodes +#file { "$bootstrap_path/manifests/nodes.pp": +# ensure => present, +# mode => 0644, +# content => template("$templates/puppet/nodes.pp.erb"), +#} +# +## Basic users +#file { "$bootstrap_path/manifests/classes/users.pp": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/manifests/classes"] ], +# content => template("$templates/puppet/users.pp.erb"), +#} +# +## First host +#file { "$bootstrap_path/manifests/nodes/$hostname.pp": +# ensure => present, +# mode => 0644, +# content => template("$templates/puppet/server.pp.erb"), +#} +# +## Master node +#file { "$bootstrap_path/manifests/nodes/$hostname-master.pp": +# ensure => present, +# mode => 0644, +# content => template("$templates/puppet/master.pp.erb"), +#} +# +## Proxy node +#file { "$bootstrap_path/manifests/nodes/$hostname-proxy.pp": +# ensure => present, +# mode => 0644, +# content => template("$templates/puppet/proxy.pp.erb"), +#} +# +## Web node +#file { "$bootstrap_path/manifests/nodes/$hostname-web.pp": +# ensure => present, +# mode => 0644, +# content => template("$templates/puppet/web.pp.erb"), +#} +# +## Storage node +#file { "$bootstrap_path/manifests/nodes/$hostname-storage.pp": +# ensure => present, +# mode => 0644, +# content => template("$templates/puppet/storage.pp.erb"), +#} +# +## Test node +#file { "$bootstrap_path/manifests/nodes/$hostname-test.pp": +# ensure => present, +# mode => 0644, +# content => template("$templates/puppet/test.pp.erb"), +#} +# +## files in $bootstrap_path/files +#file { [ "$bootstrap_path/files", +# "$bootstrap_path/modules/site_nginx", +# "$bootstrap_path/modules/site_nginx/files", +# "$bootstrap_path/modules/site_nagios", +# "$bootstrap_path/modules/site_nagios/files", +# "$bootstrap_path/modules/site_postfix", +# "$bootstrap_path/modules/site_postfix/files", +# "$bootstrap_path/modules/site_mail", +# "$bootstrap_path/modules/site_mail/files", +# "$bootstrap_path/modules/site_apache", +# "$bootstrap_path/modules/site_apache/files", +# "$bootstrap_path/modules/site_apache/files/vhosts", +# "$bootstrap_path/modules/site_apache/files/htdocs", +# "$bootstrap_path/modules/site_apache/files/htdocs/images", +# "$bootstrap_path/modules/site_keys", +# "$bootstrap_path/modules/site_keys/files", +# "$bootstrap_path/modules/site_keys/files/ssl", ]: +# ensure => directory, +# owner => "puppet", +# group => "puppet", +# mode => 0755, +#} +# +#file { "$bootstrap_path/files/empty": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/files"] ], +#} +# +#file { "$bootstrap_path/modules/site-apache/htdocs/images/README.html": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/htdocs/images"] ], +# content => template("$templates/apache/htdocs/images/README.html.erb"), +#} +# +#file { "$bootstrap_path/modules/site-apache/files/htdocs/index.html": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/htdocs"] ], +# content => template("$templates/apache/htdocs/index.html.erb"), +#} +# +#file { "$bootstrap_path/modules/site-apache/files/htdocs/missing.html": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/htdocs"] ], +# content => template("$templates/apache/htdocs/missing.html.erb"), +#} +# +#file { "$bootstrap_path/modules/site-apache/files/vhosts/git": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/vhosts"] ], +# content => template("$templates/apache/vhosts/git.erb"), +#} +# +#file { "$bootstrap_path/modules/site-apache/files/vhosts/lists": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/vhosts"] ], +# content => template("$templates/apache/vhosts/lists.erb"), +#} +# +#file { "$bootstrap_path/modules/site-apache/files/vhosts/mail": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/vhosts"] ], +# content => template("$templates/apache/vhosts/mail.erb"), +#} +# +#file { "$bootstrap_path/modules/site-apache/files/vhosts/nagios": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/vhosts"] ], +# content => template("$templates/apache/vhosts/nagios.erb"), +#} +# +#file { "$bootstrap_path/modules/site-apache/files/vhosts/wiki": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/vhosts"] ], +# content => template("$templates/apache/vhosts/wiki.erb"), +#} +# +#file { "$bootstrap_path/modules/site-mail/files/aliases": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/modules/site-mail/files"] ], +# content => template("$templates/etc/aliases.erb"), +#} +# +#file { "$bootstrap_path/modules/site-nagios/files/htpasswd.users": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/modules/site-nagios/files"] ], +# content => template("$templates/etc/nagios3/htpasswd.users.erb"), +#} +# +#file { "$bootstrap_path/modules/site-nginx/files/$domain": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/modules/site-nginx/files"] ], +# content => template("$templates/etc/nginx/domain.erb"), +#} +# +#file { "$bootstrap_path/modules/site-postfix/files/tls_policy": +# ensure => present, +# owner => "puppet", +# group => "puppet", +# mode => 0644, +# require => [ Package["puppet"], File["$bootstrap_path/modules/site-postfix/files"] ], +# content => template("$templates/postfix/tls_policy.erb"), +#} diff --git a/manifests/bootstrap/host.pp b/manifests/bootstrap/host.pp new file mode 100644 index 0000000..c1aead8 --- /dev/null +++ b/manifests/bootstrap/host.pp @@ -0,0 +1,24 @@ +# +# This manifest is intended to configure the initial +# machine wich will host the first puppetmaster +# virtual machine. +# + +# Import site configuration +import "../site.pp" + +# The server role +include nodo::role::server + +# Creates vserver for administrative node +nodo::vserver::instance { "$hostname-master": + context => '2', + puppetmaster => true, +} + +# Create a host entry for this puppet node +host { "puppet": + ensure => present, + ip => "192.168.0.2", + host_aliases => [ "puppet.$domain", "admin" ], +} diff --git a/manifests/bootstrap/master.pp b/manifests/bootstrap/master.pp new file mode 100644 index 0000000..51167f3 --- /dev/null +++ b/manifests/bootstrap/master.pp @@ -0,0 +1,12 @@ +# +# This manifest is intended to configure the initial +# puppetmaster node. +# +# Once it's running it can setup all the other nodes. +# + +# Import site configuration +import "../site.pp" + +# Include the master node configuration +include nodo::role::master diff --git a/manifests/bootstrap/vagrant.pp b/manifests/bootstrap/vagrant.pp new file mode 100644 index 0000000..9206db6 --- /dev/null +++ b/manifests/bootstrap/vagrant.pp @@ -0,0 +1,49 @@ +# +# This manifest is intended to configure a vagrant +# virtual machine. +# + +# Import site configuration +import "../site.pp" + +# +# Stage definitions +# + +stage { 'first': + before => Stage['main'], +} + +stage { 'last': } +Stage['main'] -> Stage['last'] + +# +# Class definitions +# + +# Vagrant classes +include nodo::role::vagrant + +class vagrant_config { + # Symlink to the mounted module folder + file { '/etc/puppet/modules': + ensure => '/etc/puppet/modules-0', + force => true, + } + + # Ensure a custom hiera configuration + file { '/etc/puppet/hiera.yaml': + owner => root, + group => root, + mode => 0644, + force => true, + ensure => '/etc/puppet/hiera/hiera.yaml', + } +} + +# +# Class instantiations +# +class { 'vagrant_config': + stage => first, +} diff --git a/manifests/classes/configurator.pp b/manifests/classes/configurator.pp deleted file mode 100644 index cf2d891..0000000 --- a/manifests/classes/configurator.pp +++ /dev/null @@ -1,241 +0,0 @@ -# -# Puppet Bootstrap Configuration Manifest. -# -# This file is responsible to set custom configuration in the bootstrap -# repository for values set in the hiera configuration. -# -# This manifest is useful mostly after you cloned the puppet-boostrap module -# and want to configure it to boostrap a whole puppetmaster infrastructure. -# - -# Basic variables -$templates = "$bootstrap_path/templates" -$base_domain = hiera('bootstrap::base_domain', 'example.org') -$db_password = hiera('nodo::role::master::db_password', 'changeme') -$mysql_rootpw = hiera('mysql::server::rootpw', '') -$root_password = hiera('bootstrap::root:password', 'rootpass') -$first_user = hiera('bootstrap::first_user', 'user') -$first_user_password = hiera('bootstrap::first_user::password', 'userpass') -$first_user_sshkey = hiera('bootstrap::first_user::sshkey', 'usersshkey') -$first_user_email = hiera('bootstrap::first_user::email', 'usermail') -$resolvconf_nameservers = hiera('nodo::subsystem::resolver::nameservers', '201.6.2.152:201.6.2.32') -$global_munin_allow = hiera('nodo::munin_node::allow', '192.168.0.[0-9]*') - -# Puppet configuration -file { "$bootstrap_path/puppet.conf": - ensure => present, - mode => 0644, - content => template("$templates/puppet/puppet.conf.erb"), -} - -# Fileserver configuration -file { "$bootstrap_path/fileserver.conf": - ensure => present, - mode => 0644, - content => template("$templates/puppet/fileserver.conf.erb"), -} - -file { "$bootstrap_path/auth.conf": - ensure => present, - mode => 0644, - content => template("$templates/puppet/auth.conf.erb"), -} - -## Basic nodes -#file { "$bootstrap_path/manifests/nodes.pp": -# ensure => present, -# mode => 0644, -# content => template("$templates/puppet/nodes.pp.erb"), -#} -# -## Basic users -#file { "$bootstrap_path/manifests/classes/users.pp": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/manifests/classes"] ], -# content => template("$templates/puppet/users.pp.erb"), -#} -# -## First host -#file { "$bootstrap_path/manifests/nodes/$hostname.pp": -# ensure => present, -# mode => 0644, -# content => template("$templates/puppet/server.pp.erb"), -#} -# -## Master node -#file { "$bootstrap_path/manifests/nodes/$hostname-master.pp": -# ensure => present, -# mode => 0644, -# content => template("$templates/puppet/master.pp.erb"), -#} -# -## Proxy node -#file { "$bootstrap_path/manifests/nodes/$hostname-proxy.pp": -# ensure => present, -# mode => 0644, -# content => template("$templates/puppet/proxy.pp.erb"), -#} -# -## Web node -#file { "$bootstrap_path/manifests/nodes/$hostname-web.pp": -# ensure => present, -# mode => 0644, -# content => template("$templates/puppet/web.pp.erb"), -#} -# -## Storage node -#file { "$bootstrap_path/manifests/nodes/$hostname-storage.pp": -# ensure => present, -# mode => 0644, -# content => template("$templates/puppet/storage.pp.erb"), -#} -# -## Test node -#file { "$bootstrap_path/manifests/nodes/$hostname-test.pp": -# ensure => present, -# mode => 0644, -# content => template("$templates/puppet/test.pp.erb"), -#} -# -## files in $bootstrap_path/files -#file { [ "$bootstrap_path/files", -# "$bootstrap_path/modules/site_nginx", -# "$bootstrap_path/modules/site_nginx/files", -# "$bootstrap_path/modules/site_nagios", -# "$bootstrap_path/modules/site_nagios/files", -# "$bootstrap_path/modules/site_postfix", -# "$bootstrap_path/modules/site_postfix/files", -# "$bootstrap_path/modules/site_mail", -# "$bootstrap_path/modules/site_mail/files", -# "$bootstrap_path/modules/site_apache", -# "$bootstrap_path/modules/site_apache/files", -# "$bootstrap_path/modules/site_apache/files/vhosts", -# "$bootstrap_path/modules/site_apache/files/htdocs", -# "$bootstrap_path/modules/site_apache/files/htdocs/images", -# "$bootstrap_path/modules/site_keys", -# "$bootstrap_path/modules/site_keys/files", -# "$bootstrap_path/modules/site_keys/files/ssl", ]: -# ensure => directory, -# owner => "puppet", -# group => "puppet", -# mode => 0755, -#} -# -#file { "$bootstrap_path/files/empty": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/files"] ], -#} -# -#file { "$bootstrap_path/modules/site-apache/htdocs/images/README.html": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/htdocs/images"] ], -# content => template("$templates/apache/htdocs/images/README.html.erb"), -#} -# -#file { "$bootstrap_path/modules/site-apache/files/htdocs/index.html": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/htdocs"] ], -# content => template("$templates/apache/htdocs/index.html.erb"), -#} -# -#file { "$bootstrap_path/modules/site-apache/files/htdocs/missing.html": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/htdocs"] ], -# content => template("$templates/apache/htdocs/missing.html.erb"), -#} -# -#file { "$bootstrap_path/modules/site-apache/files/vhosts/git": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/vhosts"] ], -# content => template("$templates/apache/vhosts/git.erb"), -#} -# -#file { "$bootstrap_path/modules/site-apache/files/vhosts/lists": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/vhosts"] ], -# content => template("$templates/apache/vhosts/lists.erb"), -#} -# -#file { "$bootstrap_path/modules/site-apache/files/vhosts/mail": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/vhosts"] ], -# content => template("$templates/apache/vhosts/mail.erb"), -#} -# -#file { "$bootstrap_path/modules/site-apache/files/vhosts/nagios": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/vhosts"] ], -# content => template("$templates/apache/vhosts/nagios.erb"), -#} -# -#file { "$bootstrap_path/modules/site-apache/files/vhosts/wiki": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/modules/site-apache/files/vhosts"] ], -# content => template("$templates/apache/vhosts/wiki.erb"), -#} -# -#file { "$bootstrap_path/modules/site-mail/files/aliases": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/modules/site-mail/files"] ], -# content => template("$templates/etc/aliases.erb"), -#} -# -#file { "$bootstrap_path/modules/site-nagios/files/htpasswd.users": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/modules/site-nagios/files"] ], -# content => template("$templates/etc/nagios3/htpasswd.users.erb"), -#} -# -#file { "$bootstrap_path/modules/site-nginx/files/$domain": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/modules/site-nginx/files"] ], -# content => template("$templates/etc/nginx/domain.erb"), -#} -# -#file { "$bootstrap_path/modules/site-postfix/files/tls_policy": -# ensure => present, -# owner => "puppet", -# group => "puppet", -# mode => 0644, -# require => [ Package["puppet"], File["$bootstrap_path/modules/site-postfix/files"] ], -# content => template("$templates/postfix/tls_policy.erb"), -#} diff --git a/manifests/host.pp b/manifests/host.pp deleted file mode 100644 index ea23fb4..0000000 --- a/manifests/host.pp +++ /dev/null @@ -1,24 +0,0 @@ -# -# This manifest is intended to configure the initial -# machine wich will host the first puppetmaster -# virtual machine. -# - -# Import site configuration -import "site.pp" - -# The server role -include nodo::role::server - -# Creates vserver for administrative node -nodo::vserver::instance { "$hostname-master": - context => '2', - puppetmaster => true, -} - -# Create a host entry for this puppet node -host { "puppet": - ensure => present, - ip => "192.168.0.2", - host_aliases => [ "puppet.$domain", "admin" ], -} diff --git a/manifests/master.pp b/manifests/master.pp deleted file mode 100644 index f53f00e..0000000 --- a/manifests/master.pp +++ /dev/null @@ -1,12 +0,0 @@ -# -# This manifest is intended to configure the initial -# puppetmaster node. -# -# Once it's running it can setup all the other nodes. -# - -# Import site configuration -import "site.pp" - -# Include the master node configuration -include nodo::role::master diff --git a/manifests/vagrant.pp b/manifests/vagrant.pp deleted file mode 100644 index 7e6c6c7..0000000 --- a/manifests/vagrant.pp +++ /dev/null @@ -1,49 +0,0 @@ -# -# This manifest is intended to configure a vagrant -# virtual machine. -# - -# Import site configuration -import "site.pp" - -# -# Stage definitions -# - -stage { 'first': - before => Stage['main'], -} - -stage { 'last': } -Stage['main'] -> Stage['last'] - -# -# Class definitions -# - -# Vagrant classes -include nodo::role::vagrant - -class vagrant_config { - # Symlink to the mounted module folder - file { '/etc/puppet/modules': - ensure => '/etc/puppet/modules-0', - force => true, - } - - # Ensure a custom hiera configuration - file { '/etc/puppet/hiera.yaml': - owner => root, - group => root, - mode => 0644, - force => true, - ensure => '/etc/puppet/hiera/hiera.yaml', - } -} - -# -# Class instantiations -# -class { 'vagrant_config': - stage => first, -} -- cgit v1.2.3