Change flat network name for nosdn fdio scenario
[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   EnableInternalTLS:
71     type: boolean
72     default: false
73   InternalTLSCAFile:
74     default: '/etc/ipa/ca.crt'
75     type: string
76     description: Specifies the default CA cert to use if TLS is used for
77                  services in the internal network.
78
79 conditions:
80
81   debug_unset: {equals : [{get_param: Debug}, '']}
82
83 outputs:
84   role_data:
85     description: Role data for the Horizon role.
86     value:
87       service_name: horizon
88       monitoring_subscription: {get_param: MonitoringSubscriptionHorizon}
89       config_settings:
90         map_merge:
91         - horizon::allowed_hosts: {get_param: HorizonAllowedHosts}
92           tripleo.horizon.firewall_rules:
93             '126 horizon':
94               dport:
95                 - 80
96                 - 443
97           horizon::enable_secure_proxy_ssl_header: true
98           horizon::disable_password_reveal: true
99           horizon::enforce_password_check: true
100           horizon::disallow_iframe_embed: true
101           horizon::cache_backend: django.core.cache.backends.memcached.MemcachedCache
102           horizon::django_session_engine: 'django.contrib.sessions.backends.cache'
103           horizon::vhost_extra_params:
104             priority: 10
105             access_log_format: '%a %l %u %t \"%r\" %>s %b \"%%{}{Referer}i\" \"%%{}{User-Agent}i\"'
106             options: ['FollowSymLinks','MultiViews']
107           horizon::bind_address: {get_param: [ServiceNetMap, HorizonNetwork]}
108           horizon::keystone_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
109           horizon::password_validator: {get_param: [HorizonPasswordValidator]}
110           horizon::password_validator_help: {get_param: [HorizonPasswordValidatorHelp]}
111           horizon::secret_key:
112             yaql:
113               expression: $.data.passwords.where($ != '').first()
114               data:
115                 passwords:
116                   - {get_param: HorizonSecret}
117                   - {get_param: [DefaultPasswords, horizon_secret]}
118           horizon::secure_cookies: {get_param: [HorizonSecureCookies]}
119           memcached_ipv6: {get_param: MemcachedIPv6}
120           horizon::servername:
121             str_replace:
122               template:
123                 "%{hiera('fqdn_$NETWORK')}"
124               params:
125                 $NETWORK: {get_param: [ServiceNetMap, HorizonNetwork]}
126           horizon::listen_ssl: {get_param: EnableInternalTLS}
127           horizon::horizon_ca: {get_param: InternalTLSCAFile}
128         -
129           if:
130           - debug_unset
131           - horizon::django_debug: { get_param: HorizonDebug }
132           - horizon::django_debug: { get_param: Debug }
133       step_config: |
134         include ::tripleo::profile::base::horizon
135       # Ansible tasks to handle upgrade
136       upgrade_tasks:
137         - name: Check if httpd is deployed
138           command: systemctl is-enabled httpd
139           tags: common
140           ignore_errors: True
141           register: httpd_enabled
142         - name: "PreUpgrade step0,validation: Check if httpd is running"
143           shell: >
144             /usr/bin/systemctl show 'httpd' --property ActiveState |
145             grep '\bactive\b'
146           when: httpd_enabled.rc == 0
147           tags: step0,validation
148         - name: Stop Horizon (under httpd)
149           tags: step1
150           when: httpd_enabled.rc == 0
151           service: name=httpd state=stopped
152       service_config_settings:
153         haproxy:
154           tripleo.horizon.firewall_rules:
155             '127 horizon':
156               dport:
157                 - 80
158                 - 443