summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2014-04-04 10:27:53 +0200
committervarac <varacanero@zeromail.org>2014-04-04 10:27:53 +0200
commitc8f9eaf3db509d8e678a7de0e363e14b91377e22 (patch)
treeaf4708f460550431720b6455e3405c2b20389b5c
parent50d2aae1a0611d1266303c5a4d2ab168d696afbc (diff)
parent1457c4a85ad3e7f2fbdc6f969b801542b3396581 (diff)
Merge branch '2993_setup_subclass' into 0.6
-rw-r--r--puppet/manifests/setup.pp36
-rw-r--r--puppet/manifests/site.pp3
-rw-r--r--puppet/modules/site_config/manifests/default.pp26
-rw-r--r--puppet/modules/site_config/manifests/setup.pp49
4 files changed, 52 insertions, 62 deletions
diff --git a/puppet/manifests/setup.pp b/puppet/manifests/setup.pp
index f89b7032..4dd03203 100644
--- a/puppet/manifests/setup.pp
+++ b/puppet/manifests/setup.pp
@@ -1,39 +1,5 @@
#
# this is applied before each run of site.pp
#
-$services = ''
-Exec { path => '/usr/bin:/usr/sbin/:/bin:/sbin:/usr/local/bin:/usr/local/sbin' }
-
-include site_config::params
-
-include concat::setup
-
-include site_config::hosts
-
-include site_config::initial_firewall
-
-include site_apt
-
-package { 'facter':
- ensure => latest,
- require => Exec['refresh_apt']
-}
-
-if hiera('squid_deb_proxy_client', false) {
- include site_squid_deb_proxy::client
-}
-
-# shorewall is installed/half-configured during setup.pp (Bug #3871)
-# we need to include shorewall::interface{eth0} in setup.pp so
-# packages can be installed during main puppetrun, even before shorewall
-# is configured completly
-if ( $::site_config::params::environment == 'local' ) {
- include site_config::vagrant
-}
-
-# if class site_custom::setup exists, include it.
-# possibility for users to define custom puppet recipes
-if defined( '::site_custom::setup') {
- include ::site_custom::setup
-}
+include ::site_config::setup
diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp
index ff8f8c6c..f8726fa9 100644
--- a/puppet/manifests/site.pp
+++ b/puppet/manifests/site.pp
@@ -5,6 +5,7 @@ Exec { path => '/usr/bin:/usr/sbin/:/bin:/sbin:/usr/local/bin:/usr/local/sbin' }
$services=join(hiera_array('services', ['']), ' ')
notice("Services for ${fqdn}: ${services}")
+include site_config::setup
include site_config::default
# configure eip
@@ -42,4 +43,4 @@ if $services =~ /\bstatic\b/ {
include site_static
}
-include site_config::packages::uninstall \ No newline at end of file
+include site_config::packages::uninstall
diff --git a/puppet/modules/site_config/manifests/default.pp b/puppet/modules/site_config/manifests/default.pp
index 53cc60f6..7e421a21 100644
--- a/puppet/modules/site_config/manifests/default.pp
+++ b/puppet/modules/site_config/manifests/default.pp
@@ -8,19 +8,12 @@ class site_config::default {
include apt::update
Package { require => Exec['apt_updated'] }
- include stdlib
-
include site_config::slow
- include concat::setup
-
# default class, used by all hosts
include lsb, git
- # configure apt
- include site_apt
-
# configure sysctl parameters
include site_config::sysctl
@@ -35,21 +28,12 @@ class site_config::default {
include site_config::dhclient
}
- if ( $::site_config::params::environment == 'local' ) {
- include site_config::vagrant
- }
-
# configure /etc/resolv.conf
include site_config::resolvconf
# configure caching, local resolver
include site_config::caching_resolver
- # configure /etc/hosts
- class { 'site_config::hosts':
- stage => setup,
- }
-
# install/configure syslog
include site_config::syslog
@@ -67,16 +51,6 @@ class site_config::default {
# set up core leap files and directories
include site_config::files
- # redundant declarations, remove if
- # "Move setup.pp to a subclass (site_config::setup) (Feature #2993)"
- # is solved.
-
- # if squid_deb_proxy_client is set to true, install and configure
- # squid_deb_proxy_client for apt caching
- if hiera('squid_deb_proxy_client', false) {
- include site_squid_deb_proxy::client
- }
-
if $::services !~ /\bmx\b/ {
include site_postfix::satellite
}
diff --git a/puppet/modules/site_config/manifests/setup.pp b/puppet/modules/site_config/manifests/setup.pp
new file mode 100644
index 00000000..ffe01f53
--- /dev/null
+++ b/puppet/modules/site_config/manifests/setup.pp
@@ -0,0 +1,49 @@
+class site_config::setup {
+
+ #
+ # this is applied before each run of site.pp
+ #
+ #$services = ''
+
+ Exec { path => '/usr/bin:/usr/sbin/:/bin:/sbin:/usr/local/bin:/usr/local/sbin' }
+
+ include site_config::params
+
+ include concat::setup
+ include stdlib
+
+ # configure /etc/hosts
+ class { 'site_config::hosts':
+ stage => setup,
+ }
+
+ include site_config::initial_firewall
+
+ include site_apt
+
+ package { 'facter':
+ ensure => latest,
+ require => Exec['refresh_apt']
+ }
+
+ # if squid_deb_proxy_client is set to true, install and configure
+ # squid_deb_proxy_client for apt caching
+ if hiera('squid_deb_proxy_client', false) {
+ include site_squid_deb_proxy::client
+ }
+
+ # shorewall is installed/half-configured during setup.pp (Bug #3871)
+ # we need to include shorewall::interface{eth0} in setup.pp so
+ # packages can be installed during main puppetrun, even before shorewall
+ # is configured completly
+ if ( $::site_config::params::environment == 'local' ) {
+ include site_config::vagrant
+ }
+
+ # if class site_custom::setup exists, include it.
+ # possibility for users to define custom puppet recipes
+ if defined( '::site_custom::setup') {
+ include ::site_custom::setup
+ }
+
+}