Merge "Pick dynamically the first node for stack validation"
[apex-tripleo-heat-templates.git] / docker / services / nova-placement.yaml
1 heat_template_version: ocata
2
3 description: >
4   OpenStack containerized Nova Placement API service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerNovaPlacementImage:
12     description: image
13     default: 'centos-binary-nova-placement-api'
14     type: string
15   EndpointMap:
16     default: {}
17     description: Mapping of service endpoint -> protocol. Typically set
18                  via parameter_defaults in the resource registry.
19     type: json
20   ServiceNetMap:
21     default: {}
22     description: Mapping of service_name -> network name. Typically set
23                  via parameter_defaults in the resource registry.  This
24                  mapping overrides those in ServiceNetMapDefaults.
25     type: json
26   DefaultPasswords:
27     default: {}
28     type: json
29
30 resources:
31
32   NovaPlacementBase:
33     type: ../../puppet/services/nova-placement.yaml
34     properties:
35       EndpointMap: {get_param: EndpointMap}
36       ServiceNetMap: {get_param: ServiceNetMap}
37       DefaultPasswords: {get_param: DefaultPasswords}
38
39 outputs:
40   role_data:
41     description: Role data for the Nova Placement API role.
42     value:
43       service_name: {get_attr: [NovaPlacementBase, role_data, service_name]}
44       config_settings:
45         map_merge:
46           - get_attr: [NovaPlacementBase, role_data, config_settings]
47           - apache::default_vhost: false
48       step_config: &step_config
49         get_attr: [NovaPlacementBase, role_data, step_config]
50       service_config_settings: {get_attr: [NovaPlacementBase, role_data, service_config_settings]}
51       # BEGIN DOCKER SETTINGS
52       puppet_config:
53         config_volume: nova_placement
54         puppet_tags: nova_config
55         step_config: *step_config
56         config_image: &nova_placement_image
57           list_join:
58           - '/'
59           - [ {get_param: DockerNamespace}, {get_param: DockerNovaPlacementImage} ]
60       kolla_config:
61          /var/lib/kolla/config_files/nova_placement.json:
62            command: /usr/sbin/httpd -DFOREGROUND
63            config_files:
64            - dest: /etc/nova/nova.conf
65              owner: nova
66              perm: '0640'
67              source: /var/lib/kolla/config_files/src/etc/nova/nova.conf
68            - dest: /etc/httpd/conf.d/10-placement_wsgi.conf
69              owner: root
70              perm: '0644'
71              source: /var/lib/kolla/config_files/src/etc/httpd/conf.d/10-placement_wsgi.conf
72            # puppet generates a stubbed out version of the stock one so we
73            # copy it in to overwrite the existing one
74            - dest: /etc/httpd/conf.d/00-nova-placement-api.conf
75              owner: root
76              perm: '0644'
77              source: /var/lib/kolla/config_files/src/etc/httpd/conf.d/00-nova-placement-api.conf
78            - dest: /etc/httpd/conf/httpd.conf
79              owner: root
80              perm: '0644'
81              source: /var/lib/kolla/config_files/src/etc/httpd/conf/httpd.conf
82            - dest: /etc/httpd/conf/ports.conf
83              owner: root
84              perm: '0644'
85              source: /var/lib/kolla/config_files/src/etc/httpd/conf/ports.conf
86            - dest: /var/www/cgi-bin/nova/nova-placement-api
87              owner: nova
88              perm: '0644'
89              source: /var/lib/kolla/config_files/src/var/www/cgi-bin/nova/nova-placement-api
90       docker_config:
91         # start this early so it is up before computes start reporting
92         step_3:
93           nova_placement:
94             start_order: 1
95             image: *nova_placement_image
96             net: host
97             user: root
98             restart: always
99             volumes:
100               - /var/lib/kolla/config_files/nova_placement.json:/var/lib/kolla/config_files/config.json:ro
101               - /var/lib/config-data/nova_placement/:/var/lib/kolla/config_files/src:ro
102               - /var/lib/config-data/nova_placement/etc/httpd/conf.modules.d:/etc/httpd/conf.modules.d:ro
103               - /etc/hosts:/etc/hosts:ro
104               - /etc/localtime:/etc/localtime:ro
105             environment:
106               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
107       upgrade_tasks:
108         - name: Stop and disable nova_placement service (running under httpd)
109           tags: step2
110           service: name=httpd state=stopped enabled=no