Merge "Enable Neutron LBaaS Integration"
[apex-tripleo-heat-templates.git] / puppet / services / horizon.yaml
1 heat_template_version: pike
2
3 description: >
4   Horizon service configured with Puppet
5
6 parameters:
7   ServiceData:
8     default: {}
9     description: Dictionary packing service data
10     type: json
11   ServiceNetMap:
12     default: {}
13     description: Mapping of service_name -> network name. Typically set
14                  via parameter_defaults in the resource registry.  This
15                  mapping overrides those in ServiceNetMapDefaults.
16     type: json
17   Debug:
18     default: ''
19     description: Set to True to enable debugging on all services.
20     type: string
21   HorizonDebug:
22     default: false
23     description: Set to True to enable debugging Horizon service.
24     type: string
25   DefaultPasswords:
26     default: {}
27     type: json
28   RoleName:
29     default: ''
30     description: Role name on which the service is applied
31     type: string
32   RoleParameters:
33     default: {}
34     description: Parameters specific to the role
35     type: json
36   EndpointMap:
37     default: {}
38     description: Mapping of service endpoint -> protocol. Typically set
39                  via parameter_defaults in the resource registry.
40     type: json
41   HorizonAllowedHosts:
42     default: '*'
43     description: A list of IP/Hostname for the server Horizon is running on.
44                  Used for header checks.
45     type: comma_delimited_list
46   HorizonPasswordValidator:
47     description: Regex for password validation
48     type: string
49     default: ''
50   HorizonPasswordValidatorHelp:
51     description: Help text for password validation
52     type: string
53     default: ''
54   HorizonSecret:
55     description: Secret key for Django
56     type: string
57     hidden: true
58     default: ''
59   HorizonSecureCookies:
60     description: Set CSRF_COOKIE_SECURE / SESSION_COOKIE_SECURE in Horizon
61     type: boolean
62     default: false
63   MemcachedIPv6:
64     default: false
65     description: Enable IPv6 features in Memcached.
66     type: boolean
67   MonitoringSubscriptionHorizon:
68     default: 'overcloud-horizon'
69     type: string
70
71 conditions:
72
73   debug_unset: {equals : [{get_param: Debug}, '']}
74
75 outputs:
76   role_data:
77     description: Role data for the Horizon role.
78     value:
79       service_name: horizon
80       monitoring_subscription: {get_param: MonitoringSubscriptionHorizon}
81       config_settings:
82         map_merge:
83         - horizon::allowed_hosts: {get_param: HorizonAllowedHosts}
84           tripleo.horizon.firewall_rules:
85             '126 horizon':
86               dport:
87                 - 80
88                 - 443
89           horizon::enable_secure_proxy_ssl_header: true
90           horizon::disable_password_reveal: true
91           horizon::enforce_password_check: true
92           horizon::disallow_iframe_embed: true
93           horizon::cache_backend: django.core.cache.backends.memcached.MemcachedCache
94           horizon::django_session_engine: 'django.contrib.sessions.backends.cache'
95           horizon::vhost_extra_params:
96             priority: 10
97             access_log_format: '%a %l %u %t \"%r\" %>s %b \"%%{}{Referer}i\" \"%%{}{User-Agent}i\"'
98             options: ['FollowSymLinks','MultiViews']
99           horizon::bind_address: {get_param: [ServiceNetMap, HorizonNetwork]}
100           horizon::keystone_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
101           horizon::password_validator: {get_param: [HorizonPasswordValidator]}
102           horizon::password_validator_help: {get_param: [HorizonPasswordValidatorHelp]}
103           horizon::secret_key:
104             yaql:
105               expression: $.data.passwords.where($ != '').first()
106               data:
107                 passwords:
108                   - {get_param: HorizonSecret}
109                   - {get_param: [DefaultPasswords, horizon_secret]}
110           horizon::secure_cookies: {get_param: [HorizonSecureCookies]}
111           memcached_ipv6: {get_param: MemcachedIPv6}
112         -
113           if:
114           - debug_unset
115           - horizon::django_debug: { get_param: HorizonDebug }
116           - horizon::django_debug: { get_param: Debug }
117       step_config: |
118         include ::tripleo::profile::base::horizon
119       # Ansible tasks to handle upgrade
120       upgrade_tasks:
121         - name: Check if httpd is deployed
122           command: systemctl is-enabled httpd
123           tags: common
124           ignore_errors: True
125           register: httpd_enabled
126         - name: "PreUpgrade step0,validation: Check if httpd is running"
127           shell: >
128             /usr/bin/systemctl show 'httpd' --property ActiveState |
129             grep '\bactive\b'
130           when: httpd_enabled.rc == 0
131           tags: step0,validation
132         - name: Stop Horizon (under httpd)
133           tags: step1
134           when: httpd_enabled.rc == 0
135           service: name=httpd state=stopped
136       service_config_settings:
137         haproxy:
138           tripleo.horizon.firewall_rules:
139             '127 horizon':
140               dport:
141                 - 80
142                 - 443