Change flat network name for nosdn fdio scenario
[apex-tripleo-heat-templates.git] / puppet / services / panko-api.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Panko API service configured with Puppet.
5   Note, This service is deprecated in Pike release and will
6   be disabled in future releases.
7
8 parameters:
9   ServiceData:
10     default: {}
11     description: Dictionary packing service data
12     type: json
13   ServiceNetMap:
14     default: {}
15     description: Mapping of service_name -> network name. Typically set
16                  via parameter_defaults in the resource registry.  This
17                  mapping overrides those in ServiceNetMapDefaults.
18     type: json
19   DefaultPasswords:
20     default: {}
21     type: json
22   RoleName:
23     default: ''
24     description: Role name on which the service is applied
25     type: string
26   RoleParameters:
27     default: {}
28     description: Parameters specific to the role
29     type: json
30   EndpointMap:
31     default: {}
32     description: Mapping of service endpoint -> protocol. Typically set
33                  via parameter_defaults in the resource registry.
34     type: json
35   MonitoringSubscriptionPankoApi:
36     default: 'overcloud-ceilometer-panko-api'
37     type: string
38   EnableInternalTLS:
39     type: boolean
40     default: false
41   PankoApiPolicies:
42     description: |
43       A hash of policies to configure for Panko API.
44       e.g. { panko-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
45     default: {}
46     type: json
47
48 resources:
49   PankoBase:
50     type: ./panko-base.yaml
51     properties:
52       ServiceData: {get_param: ServiceData}
53       ServiceNetMap: {get_param: ServiceNetMap}
54       DefaultPasswords: {get_param: DefaultPasswords}
55       EndpointMap: {get_param: EndpointMap}
56       RoleName: {get_param: RoleName}
57       RoleParameters: {get_param: RoleParameters}
58
59   ApacheServiceBase:
60     type: ./apache.yaml
61     properties:
62       ServiceData: {get_param: ServiceData}
63       ServiceNetMap: {get_param: ServiceNetMap}
64       DefaultPasswords: {get_param: DefaultPasswords}
65       EndpointMap: {get_param: EndpointMap}
66       RoleName: {get_param: RoleName}
67       RoleParameters: {get_param: RoleParameters}
68       EnableInternalTLS: {get_param: EnableInternalTLS}
69
70 outputs:
71   role_data:
72     description: Role data for the Panko API service.
73     value:
74       service_name: panko_api
75       monitoring_subscription: {get_param: MonitoringSubscriptionPankoApi}
76       config_settings:
77         map_merge:
78           - get_attr: [PankoBase, role_data, config_settings]
79           - get_attr: [ApacheServiceBase, role_data, config_settings]
80           - panko::wsgi::apache::ssl: {get_param: EnableInternalTLS}
81             panko::wsgi::apache::servername:
82               str_replace:
83                 template:
84                   "%{hiera('fqdn_$NETWORK')}"
85                 params:
86                   $NETWORK: {get_param: [ServiceNetMap, PankoApiNetwork]}
87             panko::policy::policies: {get_param: PankoApiPolicies}
88             panko::api::service_name: 'httpd'
89             panko::api::enable_proxy_headers_parsing: true
90             tripleo.panko_api.firewall_rules:
91               '140 panko-api':
92                 dport:
93                   - 8977
94                   - 13977
95             panko::api::host:
96               str_replace:
97                 template:
98                   "%{hiera('fqdn_$NETWORK')}"
99                 params:
100                   $NETWORK: {get_param: [ServiceNetMap, PankoApiNetwork]}
101             # NOTE: bind IP is found in Heat replacing the network name with the
102             # local node IP for the given network; replacement examples
103             # (eg. for internal_api):
104             # internal_api -> IP
105             # internal_api_uri -> [IP]
106             # internal_api_subnet - > IP/CIDR
107             panko::wsgi::apache::bind_host: {get_param: [ServiceNetMap, PankoApiNetwork]}
108       service_config_settings:
109         get_attr: [PankoBase, role_data, service_config_settings]
110       step_config: |
111         include tripleo::profile::base::panko::api
112       metadata_settings:
113         get_attr: [ApacheServiceBase, role_data, metadata_settings]
114       upgrade_tasks:
115         list_concat:
116           - get_attr: [ApacheServiceBase, role_data, upgrade_tasks]
117           -
118             - name: Check if httpd is deployed
119               command: systemctl is-enabled httpd
120               tags: common
121               ignore_errors: True
122               register: httpd_enabled
123             - name: "PreUpgrade step0,validation: Check if httpd is running"
124               shell: >
125                 /usr/bin/systemctl show 'httpd' --property ActiveState |
126                 grep '\bactive\b'
127               when: httpd_enabled.rc == 0
128               tags: step0,validation
129             - name: Stop panko-api service (running under httpd)
130               tags: step1
131               service: name=httpd state=stopped
132               when: httpd_enabled.rc == 0
133             - name: Install openstack-panko-api package if it was not installed
134               tags: step3
135               yum: name=openstack-panko-api state=latest