Puppet Class: profile::openstack::base::horizon::docker_deploy

Defined in:
modules/profile/manifests/openstack/base/horizon/docker_deploy.pp

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • horizon_version (String) (defaults to: lookup('profile::openstack::base::horizon_version'))
  • openstack_version (String) (defaults to: lookup('profile::openstack::base::version'))
  • keystone_api_fqdn (Stdlib::Fqdn) (defaults to: lookup('profile::openstack::base::keystone_api_fqdn'))
  • dhcp_domain (String) (defaults to: lookup('profile::openstack::base::nova::dhcp_domain'))
  • instance_network_id (String) (defaults to: lookup('profile::openstack::base::horizon::instance_network_id'))
  • ldap_config (Hash) (defaults to: lookup('ldap'))
  • ldap_user_pass (String) (defaults to: lookup('profile::openstack::base::ldap_user_pass'))
  • webserver_hostname (Stdlib::Fqdn) (defaults to: lookup('profile::openstack::base::horizon::webserver_hostname'))
  • all_regions (Array[String]) (defaults to: lookup('profile::openstack::base::all_regions'))
  • puppet_git_repo_name (String) (defaults to: lookup('profile::openstack::base::horizon::puppet_git_repo_name'))
  • secret_key (String) (defaults to: lookup('profile::openstack::base::horizon::secret_key'))
  • docker_version (String) (defaults to: lookup('profile::openstack::base::horizon::docker_version'))
  • port (Stdlib::Port::User) (defaults to: lookup('profile::openstack::base::horizon::docker_port', { 'default_value' => 8084 }))
  • env (Hash) (defaults to: lookup('profile::openstack::base::horizon::env', { 'default_value' => {} }))
  • secret_env (Hash) (defaults to: lookup('profile::openstack::base::horizon::secret_env', { 'default_value' => {} } ))


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'modules/profile/manifests/openstack/base/horizon/docker_deploy.pp', line 2

class profile::openstack::base::horizon::docker_deploy(
    String          $horizon_version = lookup('profile::openstack::base::horizon_version'),
    String          $openstack_version = lookup('profile::openstack::base::version'),
    Stdlib::Fqdn    $keystone_api_fqdn = lookup('profile::openstack::base::keystone_api_fqdn'),
    String          $dhcp_domain = lookup('profile::openstack::base::nova::dhcp_domain'),
    String          $instance_network_id = lookup('profile::openstack::base::horizon::instance_network_id'),
    Hash            $ldap_config = lookup('ldap'),
    String          $ldap_user_pass = lookup('profile::openstack::base::ldap_user_pass'),
    Stdlib::Fqdn    $webserver_hostname = lookup('profile::openstack::base::horizon::webserver_hostname'),
    Array[String]   $all_regions = lookup('profile::openstack::base::all_regions'),
    String          $puppet_git_repo_name = lookup('profile::openstack::base::horizon::puppet_git_repo_name'),
    String          $secret_key = lookup('profile::openstack::base::horizon::secret_key'),
    String          $docker_version = lookup('profile::openstack::base::horizon::docker_version'),
    Stdlib::Port::User $port = lookup('profile::openstack::base::horizon::docker_port', { 'default_value' => 8084 }),
    Hash $env                = lookup('profile::openstack::base::horizon::env', { 'default_value' => {} }),
    Hash $secret_env         = lookup('profile::openstack::base::horizon::secret_env', { 'default_value' => {} } ),
) {

    # This is still here because of wikitech
    class { '::httpd':
        modules => [
          'alias',
          'expires',
          'headers',
          'proxy_fcgi',  # Needed by ::openstack::wikitech::web
          'rewrite',
          'ssl',
        ],
    }

    $ldap_rw_host = $ldap_config['rw-server']

    class { '::openstack::horizon::config':
        horizon_version      => $horizon_version,
        openstack_version    => $openstack_version,
        dhcp_domain          => $dhcp_domain,
        keystone_api_fqdn    => $keystone_api_fqdn,
        instance_network_id  => $instance_network_id,
        ldap_rw_host         => $ldap_rw_host,
        ldap_user_pass       => $ldap_user_pass,
        webserver_hostname   => $webserver_hostname,
        all_regions          => $all_regions,
        puppet_git_repo_name => $puppet_git_repo_name,
        secret_key           => $secret_key,
    }

    require ::profile::docker::engine
    require ::profile::docker::ferm
    service::docker { 'openstack-dashboard':
        namespace    => 'repos/cloud/cloud-vps/horizon',
        image_name   => 'deploy',
        version      => $docker_version,
        port         => $port,
        environment  => deep_merge($env, $secret_env),
        host_network => true,
        bind_mounts  => {'/etc/openstack-dashboard/local_settings.py' => '/opt/lib/python/site-packages/openstack_dashboard/local/local_settings.py'},
    }

    # Horizon error logs to ELK.  The Apache log is called horizon_error
    #  but it contains anything that the Horizon python code logs.
    #
    # The arcane startmsg_regex is meant to detect continued lines
    #  in python stack-traces. It declares a new message to begine
    #  with a timestamp followed by a single space; two spaces
    #  is taken to be the indented continuation of a message.
    rsyslog::input::file { 'horizon_error':
        path           => '/var/log/apache2/horizon_error.log',
        syslog_tag     => 'horizon',
        startmsg_regex => '^[[:digit:]-]{10} [[:digit:]:]{8}.[[:digit:]]* [^ ]',
    }
}