Merge "mysql: Only set certificate specs if TLS everywhere is enabled" into stable...
[apex-tripleo-heat-templates.git] / docker / services / opendaylight-api.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized OpenDaylight API service
5
6 parameters:
7   DockerOpendaylightApiImage:
8     description: image
9     type: string
10   DockerOpendaylightConfigImage:
11     description: image
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
40 resources:
41
42   ContainersCommon:
43     type: ./containers-common.yaml
44
45   OpenDaylightBase:
46     type: ../../puppet/services/opendaylight-api.yaml
47     properties:
48       EndpointMap: {get_param: EndpointMap}
49       ServiceData: {get_param: ServiceData}
50       ServiceNetMap: {get_param: ServiceNetMap}
51       DefaultPasswords: {get_param: DefaultPasswords}
52       RoleName: {get_param: RoleName}
53       RoleParameters: {get_param: RoleParameters}
54
55 outputs:
56   role_data:
57     description: Role data for the OpenDaylight API role.
58     value:
59       service_name: {get_attr: [OpenDaylightBase, role_data, service_name]}
60       config_settings:
61         map_merge:
62           - get_attr: [OpenDaylightBase, role_data, config_settings]
63       logging_source: {get_attr: [OpenDaylightBase, role_data, logging_source]}
64       logging_groups: {get_attr: [OpenDaylightBase, role_data, logging_groups]}
65       step_config: &step_config
66         get_attr: [OpenDaylightBase, role_data, step_config]
67       # BEGIN DOCKER SETTINGS
68       puppet_config:
69         config_volume: opendaylight
70         # 'file,concat,file_line,augeas' are included by default
71         puppet_tags: odl_user
72         step_config: *step_config
73         config_image: {get_param: DockerOpendaylightConfigImage}
74       kolla_config:
75         /var/lib/kolla/config_files/opendaylight_api.json:
76           command: /opt/opendaylight/bin/karaf
77           config_files:
78             - source: "/var/lib/kolla/config_files/src/*"
79               dest: "/"
80               merge: true
81               preserve_properties: true
82           permissions:
83             - path: /opt/opendaylight
84               owner: odl:odl
85               recurse: true
86       docker_config:
87         step_1:
88           opendaylight_api:
89             start_order: 0
90             image: &odl_api_image {get_param: DockerOpendaylightApiImage}
91             privileged: false
92             net: host
93             detach: true
94             user: odl
95             restart: always
96             volumes:
97               list_concat:
98                 - {get_attr: [ContainersCommon, volumes]}
99                 -
100                   - /var/lib/kolla/config_files/opendaylight_api.json:/var/lib/kolla/config_files/config.json:ro
101                   - /var/lib/config-data/puppet-generated/opendaylight/:/var/lib/kolla/config_files/src:ro
102                   - /var/log/containers/opendaylight:/opt/opendaylight/data/log
103                   - /var/lib/opendaylight/journal:/opt/opendaylight/journal
104                   - /var/lib/opendaylight/snapshots:/opt/opendaylight/snapshots
105             environment:
106               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
107       host_prep_tasks:
108         - name: create persistent directories
109           file:
110             path: "{{ item }}"
111             state: directory
112           with_items:
113             - /var/log/containers/opendaylight
114             - /var/lib/opendaylight/snapshots
115             - /var/lib/opendaylight/journal
116       upgrade_tasks:
117         - name: Stop and disable opendaylight_api service
118           tags: step2
119           service: name=opendaylight state=stopped enabled=no