Adds network/cidr mapping into a new service property
[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   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerNovaPlacementImage:
12     description: image
13     default: 'centos-binary-nova-placement-api:latest'
14     type: string
15   DockerNovaPlacementConfigImage:
16     description: The container image to use for the nova_placement config_volume
17     default: 'centos-binary-nova-placement-api:latest'
18     type: string
19   EndpointMap:
20     default: {}
21     description: Mapping of service endpoint -> protocol. Typically set
22                  via parameter_defaults in the resource registry.
23     type: json
24   ServiceData:
25     default: {}
26     description: Dictionary packing service data
27     type: json
28   ServiceNetMap:
29     default: {}
30     description: Mapping of service_name -> network name. Typically set
31                  via parameter_defaults in the resource registry.  This
32                  mapping overrides those in ServiceNetMapDefaults.
33     type: json
34   DefaultPasswords:
35     default: {}
36     type: json
37   RoleName:
38     default: ''
39     description: Role name on which the service is applied
40     type: string
41   RoleParameters:
42     default: {}
43     description: Parameters specific to the role
44     type: json
45
46 resources:
47
48   ContainersCommon:
49     type: ./containers-common.yaml
50
51   NovaPlacementBase:
52     type: ../../puppet/services/nova-placement.yaml
53     properties:
54       EndpointMap: {get_param: EndpointMap}
55       ServiceData: {get_param: ServiceData}
56       ServiceNetMap: {get_param: ServiceNetMap}
57       DefaultPasswords: {get_param: DefaultPasswords}
58       RoleName: {get_param: RoleName}
59       RoleParameters: {get_param: RoleParameters}
60
61 outputs:
62   role_data:
63     description: Role data for the Nova Placement API role.
64     value:
65       service_name: {get_attr: [NovaPlacementBase, role_data, service_name]}
66       config_settings:
67         map_merge:
68           - get_attr: [NovaPlacementBase, role_data, config_settings]
69           - apache::default_vhost: false
70       step_config: &step_config
71         get_attr: [NovaPlacementBase, role_data, step_config]
72       service_config_settings: {get_attr: [NovaPlacementBase, role_data, service_config_settings]}
73       # BEGIN DOCKER SETTINGS
74       puppet_config:
75         config_volume: nova_placement
76         puppet_tags: nova_config
77         step_config: *step_config
78         config_image:
79           list_join:
80           - '/'
81           - [ {get_param: DockerNamespace}, {get_param: DockerNovaPlacementConfigImage} ]
82       kolla_config:
83         /var/lib/kolla/config_files/nova_placement.json:
84           command: /usr/sbin/httpd -DFOREGROUND
85           config_files:
86             - source: "/var/lib/kolla/config_files/src/*"
87               dest: "/"
88               merge: true
89               preserve_properties: true
90           permissions:
91             - path: /var/log/nova
92               owner: nova:nova
93               recurse: true
94       docker_config:
95         # start this early so it is up before computes start reporting
96         step_3:
97           nova_placement:
98             start_order: 1
99             image:
100               list_join:
101               - '/'
102               - [ {get_param: DockerNamespace}, {get_param: DockerNovaPlacementImage} ]
103             net: host
104             user: root
105             restart: always
106             volumes:
107               list_concat:
108                 - {get_attr: [ContainersCommon, volumes]}
109                 -
110                   - /var/lib/kolla/config_files/nova_placement.json:/var/lib/kolla/config_files/config.json:ro
111                   - /var/lib/config-data/puppet-generated/nova_placement/:/var/lib/kolla/config_files/src:ro
112                   - /var/log/containers/nova:/var/log/nova
113             environment:
114               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
115       host_prep_tasks:
116         - name: create persistent logs directory
117           file:
118             path: /var/log/containers/nova
119             state: directory
120       upgrade_tasks:
121         - name: Stop and disable nova_placement service (running under httpd)
122           tags: step2
123           service: name=httpd state=stopped enabled=no