From 3730114dbb3dffa0d496ff5aaf42c8d54bee8f80 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 29 Jun 2015 16:49:15 -0300 Subject: More changes for puppet 3.x --- manifests/bootstrap/configurator.pp | 2 +- manifests/bootstrap/host.pp | 3 --- manifests/bootstrap/master.pp | 3 --- manifests/classes/websites.pp | 42 -------------------------------- modules/site_users/manifests/admin.pp | 16 ++++++++++++ modules/site_users/manifests/backups.pp | 3 +++ modules/site_users/manifests/init.pp | 2 ++ modules/site_users/manifests/virtual.pp | 3 +++ modules/site_websites/manifests/admin.pp | 25 +++++++++++++++++++ modules/site_websites/manifests/init.pp | 16 ++++++++++++ templates/puppet/users.pp.erb | 8 ------ 11 files changed, 66 insertions(+), 57 deletions(-) delete mode 100644 manifests/classes/websites.pp create mode 100644 modules/site_users/manifests/admin.pp create mode 100644 modules/site_users/manifests/backups.pp create mode 100644 modules/site_users/manifests/init.pp create mode 100644 modules/site_users/manifests/virtual.pp create mode 100644 modules/site_websites/manifests/admin.pp create mode 100644 modules/site_websites/manifests/init.pp diff --git a/manifests/bootstrap/configurator.pp b/manifests/bootstrap/configurator.pp index d93a0ce..edcbe92 100644 --- a/manifests/bootstrap/configurator.pp +++ b/manifests/bootstrap/configurator.pp @@ -74,7 +74,7 @@ file { "$bootstrap_path/auth.conf": # # Basic users # -file { "$bootstrap_path/manifests/classes/users.pp": +file { "$bootstrap_path/modules/site_users/manifests/init.pp": ensure => present, mode => 0644, content => template("$templates/puppet/users.pp.erb"), diff --git a/manifests/bootstrap/host.pp b/manifests/bootstrap/host.pp index c1aead8..c403eea 100644 --- a/manifests/bootstrap/host.pp +++ b/manifests/bootstrap/host.pp @@ -4,9 +4,6 @@ # virtual machine. # -# Import site configuration -import "../site.pp" - # The server role include nodo::role::server diff --git a/manifests/bootstrap/master.pp b/manifests/bootstrap/master.pp index 51167f3..73c075c 100644 --- a/manifests/bootstrap/master.pp +++ b/manifests/bootstrap/master.pp @@ -5,8 +5,5 @@ # 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/classes/websites.pp b/manifests/classes/websites.pp deleted file mode 100644 index a53d507..0000000 --- a/manifests/classes/websites.pp +++ /dev/null @@ -1,42 +0,0 @@ -class websites::admin inherits websites::hosting::admin { - # An administrative Trac instance - #apache::site { "admin": - # docroot => "${apache::sites_folder}/admin/trac/htdocs", - # use => [ "Trac admin" ], - # redirect_match => "trac", - # mpm => false, - # tag => 'all', - #} - - apache::site { "munin": - docroot => '/var/www/munin', - owner => "munin", - group => "munin", - mpm => false, - tag => 'all', - } - - apache::site { "nagios": - source => true, - docroot => '/usr/share/nagios3/htdocs', - mpm => false, - tag => 'all', - } -} - -class websites inherits websites::hosting { - # Website definitions: always use tagged resources - - #apache::site { "site": - # source => true, - # ticket => '001', - # docroot => '/var/www/site', - # tag => 'all', - #} - - #database::instance { "site": - # password => 'xxx', - # tag => 'all', - #} - -} diff --git a/modules/site_users/manifests/admin.pp b/modules/site_users/manifests/admin.pp new file mode 100644 index 0000000..14ad9da --- /dev/null +++ b/modules/site_users/manifests/admin.pp @@ -0,0 +1,16 @@ +class site_users::admin inherits user { + # root user and password + #user::manage { "root": + # tag => "admin", + # homedir => '/root', + # password => '$5$zpdXgIaLKMDckKx9$qTS9WbmS/zylFwPu1orq.779CNnAiA9VoGdFNU94jz/', + #} + + # first user config + #user::manage { "user": + # tag => "admin", + # groups => [ "sudo", ], + # password => '$5$D8kCEIo5/MNCA7Tz$VhGg2MNDs21JzX9HgxSWMupA5GD5MXnKwDuveMSdPH7', + # sshkey => [ "WRONG" ], + #} +} diff --git a/modules/site_users/manifests/backups.pp b/modules/site_users/manifests/backups.pp new file mode 100644 index 0000000..aab00f9 --- /dev/null +++ b/modules/site_users/manifests/backups.pp @@ -0,0 +1,3 @@ +class site_users::backup inherits user { + # define third-party hosted backup users here +} diff --git a/modules/site_users/manifests/init.pp b/modules/site_users/manifests/init.pp new file mode 100644 index 0000000..b3c656a --- /dev/null +++ b/modules/site_users/manifests/init.pp @@ -0,0 +1,2 @@ +class site_users { +} diff --git a/modules/site_users/manifests/virtual.pp b/modules/site_users/manifests/virtual.pp new file mode 100644 index 0000000..20aba01 --- /dev/null +++ b/modules/site_users/manifests/virtual.pp @@ -0,0 +1,3 @@ +class site_users::virtual inherits user { + # define custom users here +} diff --git a/modules/site_websites/manifests/admin.pp b/modules/site_websites/manifests/admin.pp new file mode 100644 index 0000000..0be3a94 --- /dev/null +++ b/modules/site_websites/manifests/admin.pp @@ -0,0 +1,25 @@ +class site_websites::admin inherits websites::hosting::admin { + # An administrative Trac instance + #apache::site { "admin": + # docroot => "${apache::sites_folder}/admin/trac/htdocs", + # use => [ "Trac admin" ], + # redirect_match => "trac", + # mpm => false, + # tag => 'all', + #} + + apache::site { "munin": + docroot => '/var/www/munin', + owner => "munin", + group => "munin", + mpm => false, + tag => 'all', + } + + apache::site { "nagios": + source => true, + docroot => '/usr/share/nagios3/htdocs', + mpm => false, + tag => 'all', + } +} diff --git a/modules/site_websites/manifests/init.pp b/modules/site_websites/manifests/init.pp new file mode 100644 index 0000000..f9d900a --- /dev/null +++ b/modules/site_websites/manifests/init.pp @@ -0,0 +1,16 @@ +class site_websites inherits websites::hosting { + # Website definitions: always use tagged resources + + #apache::site { "site": + # source => true, + # ticket => '001', + # docroot => '/var/www/site', + # tag => 'all', + #} + + #database::instance { "site": + # password => 'xxx', + # tag => 'all', + #} + +} diff --git a/templates/puppet/users.pp.erb b/templates/puppet/users.pp.erb index 55a2706..3b7c857 100644 --- a/templates/puppet/users.pp.erb +++ b/templates/puppet/users.pp.erb @@ -7,14 +7,6 @@ class users::backup inherits user { } class users::admin inherits user { - - # Reprepro group needed for web nodes - #if !defined(Group["reprepro"]) { - # group { "reprepro": - # ensure => present, - # } - #} - # root user and password user::manage { "root": tag => "admin", -- cgit v1.2.3