Merge "Support for Satellite Capsule in rhel-registration" into stable/pike
[apex-tripleo-heat-templates.git] / docker / services / nova-placement.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Nova Placement API service
5
6 parameters:
7   DockerNovaPlacementImage:
8     description: image
9     type: string
10   DockerNovaPlacementConfigImage:
11     description: The container image to use for the nova_placement config_volume
12     type: string
13   EndpointMap:
14     default: {}
15     description: Mapping of service endpoint -> protocol. Typically set
16                  via parameter_defaults in the resource registry.
17     type: json
18   ServiceData:
19     default: {}
20     description: Dictionary packing service data
21     type: json
22   ServiceNetMap:
23     default: {}
24     description: Mapping of service_name -> network name. Typically set
25                  via parameter_defaults in the resource registry.  This
26                  mapping overrides those in ServiceNetMapDefaults.
27     type: json
28   DefaultPasswords:
29     default: {}
30     type: json
31   RoleName:
32     default: ''
33     description: Role name on which the service is applied
34     type: string
35   RoleParameters:
36     default: {}
37     description: Parameters specific to the role
38     type: json
39   EnableInternalTLS:
40     type: boolean
41     default: false
42   UpgradeRemoveUnusedPackages:
43     default: false
44     description: Remove package if the service is being disabled during upgrade
45     type: boolean
46
47 conditions:
48
49   internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
50
51 resources:
52
53   ContainersCommon:
54     type: ./containers-common.yaml
55
56   MySQLClient:
57     type: ../../puppet/services/database/mysql-client.yaml
58
59   NovaPlacementBase:
60     type: ../../puppet/services/nova-placement.yaml
61     properties:
62       EndpointMap: {get_param: EndpointMap}
63       ServiceData: {get_param: ServiceData}
64       ServiceNetMap: {get_param: ServiceNetMap}
65       DefaultPasswords: {get_param: DefaultPasswords}
66       RoleName: {get_param: RoleName}
67       RoleParameters: {get_param: RoleParameters}
68
69 outputs:
70   role_data:
71     description: Role data for the Nova Placement API role.
72     value:
73       service_name: {get_attr: [NovaPlacementBase, role_data, service_name]}
74       config_settings:
75         map_merge:
76           - get_attr: [NovaPlacementBase, role_data, config_settings]
77           - apache::default_vhost: false
78       logging_source: {get_attr: [NovaPlacementBase, role_data, logging_source]}
79       logging_groups: {get_attr: [NovaPlacementBase, role_data, logging_groups]}
80       step_config: &step_config
81         list_join:
82           - "\n"
83           - - {get_attr: [NovaPlacementBase, role_data, step_config]}
84             - {get_attr: [MySQLClient, role_data, step_config]}
85       service_config_settings: {get_attr: [NovaPlacementBase, role_data, service_config_settings]}
86       # BEGIN DOCKER SETTINGS
87       puppet_config:
88         config_volume: nova_placement
89         puppet_tags: nova_config
90         step_config: *step_config
91         config_image: {get_param: DockerNovaPlacementConfigImage}
92       kolla_config:
93         /var/lib/kolla/config_files/nova_placement.json:
94           command: /usr/sbin/httpd -DFOREGROUND
95           config_files:
96             - source: "/var/lib/kolla/config_files/src/*"
97               dest: "/"
98               merge: true
99               preserve_properties: true
100           permissions:
101             - path: /var/log/nova
102               owner: nova:nova
103               recurse: true
104       docker_config:
105         # start this early so it is up before computes start reporting
106         step_3:
107           nova_placement:
108             start_order: 1
109             image: {get_param: DockerNovaPlacementImage}
110             net: host
111             user: root
112             restart: always
113             volumes:
114               list_concat:
115                 - {get_attr: [ContainersCommon, volumes]}
116                 -
117                   - /var/lib/kolla/config_files/nova_placement.json:/var/lib/kolla/config_files/config.json:ro
118                   - /var/lib/config-data/puppet-generated/nova_placement/:/var/lib/kolla/config_files/src:ro
119                   - /var/log/containers/nova:/var/log/nova
120                   - /var/log/containers/httpd/nova-placement:/var/log/httpd
121                   -
122                     if:
123                       - internal_tls_enabled
124                       - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
125                       - ''
126                   -
127                     if:
128                       - internal_tls_enabled
129                       - /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
130                       - ''
131             environment:
132               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
133       metadata_settings:
134         get_attr: [NovaPlacementBase, role_data, metadata_settings]
135       host_prep_tasks:
136         - name: create persistent logs directory
137           file:
138             path: "{{ item }}"
139             state: directory
140           with_items:
141             - /var/log/containers/nova
142             - /var/log/containers/httpd/nova-placement
143       upgrade_tasks:
144         - name: Stop and disable nova_placement service (running under httpd)
145           tags: step2
146           service: name=httpd state=stopped enabled=no
147         - name: Remove httpd package if operator requests it
148           yum: name=httpd state=removed
149           tags: step2
150           ignore_errors: True
151           when: {get_param: UpgradeRemoveUnusedPackages}
152