From 2a424ce1d3b858db8a19753b9a6a161aa349d427 Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Wed, 18 Apr 2012 09:58:39 +0100 Subject: [PATCH] Adding name of the httpd service as a param --- deployment/puppet/horizon/manifests/init.pp | 3 ++- deployment/puppet/horizon/manifests/params.pp | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 deployment/puppet/horizon/manifests/params.pp diff --git a/deployment/puppet/horizon/manifests/init.pp b/deployment/puppet/horizon/manifests/init.pp index 52476894de..0145938b7d 100644 --- a/deployment/puppet/horizon/manifests/init.pp +++ b/deployment/puppet/horizon/manifests/init.pp @@ -20,7 +20,8 @@ class horizon( } service { 'httpd': - name => 'apache2', + name => $::horizon::params::http_service, + ensure => 'running', subscribe => File['/etc/openstack-dashboard/local_settings.py'] } } diff --git a/deployment/puppet/horizon/manifests/params.pp b/deployment/puppet/horizon/manifests/params.pp new file mode 100644 index 0000000000..5858985542 --- /dev/null +++ b/deployment/puppet/horizon/manifests/params.pp @@ -0,0 +1,17 @@ +# these parameters need to be accessed from several locations and +# should be considered to be constant +class horizon::params { + + case $::osfamily { + 'RedHat': { + $http_service = 'httpd' + } + 'Debian': { + $http_service = 'apache2' + } + default: { + fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and Debian") + } + } + +}