Add a deps file to handle dependencies
Adds the deps.pp file to handle all the the dependency chains and anchors. Change-Id: I6e2778512787b0b7a3011dc39dd5921dfde065f2
This commit is contained in:
parent
b0f6bde9a6
commit
8857bfe66f
39
manifests/deps.pp
Normal file
39
manifests/deps.pp
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2018 Binero
|
||||||
|
#
|
||||||
|
# Author: Tobias Urdin <tobias.urdin@binero.se>
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
#
|
||||||
|
# == Class: horizon::deps
|
||||||
|
#
|
||||||
|
# Horizon anchors and dependency management
|
||||||
|
#
|
||||||
|
class horizon::deps {
|
||||||
|
|
||||||
|
anchor { 'horizon::install::begin': }
|
||||||
|
-> Package<| tag == 'horizon-package' |>
|
||||||
|
~> anchor { 'horizon::install::end': }
|
||||||
|
-> anchor { 'horizon::config::begin': }
|
||||||
|
~> anchor { 'horizon::config::end': }
|
||||||
|
-> anchor { 'horizon::compress::begin': }
|
||||||
|
-> Exec<| tag == 'horizon-compress' |>
|
||||||
|
~> anchor { 'horizon::compress::end': }
|
||||||
|
-> anchor { 'horizon::service::begin': }
|
||||||
|
-> Service<| title == 'httpd' |>
|
||||||
|
~> anchor { 'horizon::service::end': }
|
||||||
|
|
||||||
|
# Installation or config changes will always restart services.
|
||||||
|
Anchor['horizon::install::end'] ~> Anchor['horizon::service::begin']
|
||||||
|
Anchor['horizon::config::end'] ~> Anchor['horizon::service::begin']
|
||||||
|
}
|
@ -526,6 +526,8 @@ class horizon(
|
|||||||
$tuskar_ui_deployment_mode = undef,
|
$tuskar_ui_deployment_mode = undef,
|
||||||
) inherits ::horizon::params {
|
) inherits ::horizon::params {
|
||||||
|
|
||||||
|
include ::horizon::deps
|
||||||
|
|
||||||
$hypervisor_defaults = {
|
$hypervisor_defaults = {
|
||||||
'can_set_mount_point' => true,
|
'can_set_mount_point' => true,
|
||||||
'can_set_password' => false,
|
'can_set_password' => false,
|
||||||
@ -612,7 +614,7 @@ settings_local.py and parameter server_aliases for setting ServerAlias directive
|
|||||||
if $cache_backend =~ /MemcachedCache/ {
|
if $cache_backend =~ /MemcachedCache/ {
|
||||||
ensure_resources('package', { 'python-memcache' =>
|
ensure_resources('package', { 'python-memcache' =>
|
||||||
{ name => $::horizon::params::memcache_package,
|
{ name => $::horizon::params::memcache_package,
|
||||||
tag => ['openstack']}})
|
tag => ['openstack', 'horizon-package']}})
|
||||||
}
|
}
|
||||||
|
|
||||||
package { 'horizon':
|
package { 'horizon':
|
||||||
@ -625,7 +627,7 @@ settings_local.py and parameter server_aliases for setting ServerAlias directive
|
|||||||
mode => '0640',
|
mode => '0640',
|
||||||
owner => $::horizon::params::wsgi_user,
|
owner => $::horizon::params::wsgi_user,
|
||||||
group => $::horizon::params::wsgi_group,
|
group => $::horizon::params::wsgi_group,
|
||||||
require => Package['horizon'],
|
require => Anchor['horizon::config::begin'],
|
||||||
}
|
}
|
||||||
|
|
||||||
concat::fragment { 'local_settings.py':
|
concat::fragment { 'local_settings.py':
|
||||||
@ -637,13 +639,13 @@ settings_local.py and parameter server_aliases for setting ServerAlias directive
|
|||||||
exec { 'refresh_horizon_django_cache':
|
exec { 'refresh_horizon_django_cache':
|
||||||
command => "${::horizon::params::manage_py} collectstatic --noinput --clear",
|
command => "${::horizon::params::manage_py} collectstatic --noinput --clear",
|
||||||
refreshonly => true,
|
refreshonly => true,
|
||||||
require => Package['horizon'],
|
tag => ['horizon-compress'],
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'refresh_horizon_django_compress':
|
exec { 'refresh_horizon_django_compress':
|
||||||
command => "${::horizon::params::manage_py} compress --force",
|
command => "${::horizon::params::manage_py} compress --force",
|
||||||
refreshonly => true,
|
refreshonly => true,
|
||||||
require => Package['horizon'],
|
tag => ['horizon-compress'],
|
||||||
}
|
}
|
||||||
|
|
||||||
if $compress_offline {
|
if $compress_offline {
|
||||||
|
@ -115,6 +115,7 @@ class horizon::wsgi::apache (
|
|||||||
$root_path = "${::horizon::params::static_path}/openstack-dashboard",
|
$root_path = "${::horizon::params::static_path}/openstack-dashboard",
|
||||||
) inherits horizon::params {
|
) inherits horizon::params {
|
||||||
|
|
||||||
|
include ::horizon::deps
|
||||||
include ::apache
|
include ::apache
|
||||||
|
|
||||||
if $fqdn {
|
if $fqdn {
|
||||||
@ -138,7 +139,7 @@ class horizon::wsgi::apache (
|
|||||||
# - ${priority}-${vhost_conf_name}.conf
|
# - ${priority}-${vhost_conf_name}.conf
|
||||||
# - ${priority}-${vhost_ssl_conf_name}.conf
|
# - ${priority}-${vhost_ssl_conf_name}.conf
|
||||||
#",
|
#",
|
||||||
require => Package['horizon'],
|
require => Anchor['horizon::config::begin'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -190,7 +191,7 @@ class horizon::wsgi::apache (
|
|||||||
group => $unix_group,
|
group => $unix_group,
|
||||||
before => Service['httpd'],
|
before => Service['httpd'],
|
||||||
mode => '0751',
|
mode => '0751',
|
||||||
require => Package['horizon'],
|
require => Anchor['horizon::config::begin'],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${::horizon::params::logdir}/horizon.log":
|
file { "${::horizon::params::logdir}/horizon.log":
|
||||||
@ -199,7 +200,7 @@ class horizon::wsgi::apache (
|
|||||||
group => $unix_group,
|
group => $unix_group,
|
||||||
before => Service['httpd'],
|
before => Service['httpd'],
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
require => [ File[$::horizon::params::logdir], Package['horizon'] ],
|
require => File[$::horizon::params::logdir],
|
||||||
}
|
}
|
||||||
|
|
||||||
$script_url = $root_url ? {
|
$script_url = $root_url ? {
|
||||||
|
@ -252,7 +252,7 @@ describe 'horizon' do
|
|||||||
|
|
||||||
it {
|
it {
|
||||||
is_expected.to contain_package('python-memcache').with(
|
is_expected.to contain_package('python-memcache').with(
|
||||||
:tag => ['openstack']
|
:tag => ['openstack', 'horizon-package']
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user