summaryrefslogtreecommitdiff
path: root/puppet
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2014-03-25 23:42:19 +0100
committervarac <varacanero@zeromail.org>2014-03-25 23:42:19 +0100
commit1457c4a85ad3e7f2fbdc6f969b801542b3396581 (patch)
tree397058a29510fdd3cdf57cf282eefe358ae222d7 /puppet
parenta8c9d80317240d86cb7de652c23efbd7bc81bde2 (diff)
Move setup.pp to a subclass (site_config::setup) (Feature #2993)
Diffstat (limited to 'puppet')
-rw-r--r--puppet/manifests/setup.pp36
-rw-r--r--puppet/manifests/site.pp1
-rw-r--r--puppet/modules/site_config/manifests/default.pp26
-rw-r--r--puppet/modules/site_config/manifests/setup.pp49
4 files changed, 51 insertions, 61 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 def0a642..d83a189d 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
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
+ }
+
+}