Merge "Enable Neutron LBaaS Integration"
[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   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerOpendaylightApiImage:
12     description: image
13     default: 'centos-binary-opendaylight:latest'
14     type: string
15   DockerOpendaylightConfigImage:
16     description: image
17     default: 'centos-binary-opendaylight: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   OpenDaylightBase:
52     type: ../../puppet/services/opendaylight-api.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 OpenDaylight API role.
64     value:
65       service_name: {get_attr: [OpenDaylightBase, role_data, service_name]}
66       config_settings:
67         map_merge:
68           - get_attr: [OpenDaylightBase, role_data, config_settings]
69       step_config: &step_config
70         list_join:
71           - "\n"
72           - - get_attr: [OpenDaylightBase, role_data, step_config]
73             - "include tripleo::profile::base::neutron::opendaylight::create_cluster"
74       # BEGIN DOCKER SETTINGS
75       puppet_config:
76         config_volume: opendaylight
77         # 'file,concat,file_line,augeas' are included by default
78         puppet_tags: odl_user,tripleo::profile::base::neutron::opendaylight::configure_cluster
79         step_config: *step_config
80         config_image:
81           list_join:
82             - '/'
83             - [ {get_param: DockerNamespace}, {get_param: DockerOpendaylightConfigImage} ]
84       kolla_config:
85         /var/lib/kolla/config_files/opendaylight_api.json:
86           command: /opt/opendaylight/bin/karaf
87           config_files:
88             - source: "/var/lib/kolla/config_files/src/*"
89               dest: "/"
90               merge: true
91               preserve_properties: true
92           permissions:
93             - path: /opt/opendaylight
94               owner: odl:odl
95               recurse: true
96       docker_config:
97         step_1:
98           opendaylight_api:
99             start_order: 0
100             image: &odl_api_image
101               list_join:
102                 - '/'
103                 - [ {get_param: DockerNamespace}, {get_param: DockerOpendaylightApiImage} ]
104             privileged: false
105             net: host
106             detach: true
107             user: odl
108             restart: always
109             volumes:
110               list_concat:
111                 - {get_attr: [ContainersCommon, volumes]}
112                 -
113                   - /var/lib/kolla/config_files/opendaylight_api.json:/var/lib/kolla/config_files/config.json:ro
114                   - /var/lib/config-data/puppet-generated/opendaylight/:/var/lib/kolla/config_files/src:ro
115             environment:
116               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
117
118       upgrade_tasks:
119         - name: Stop and disable opendaylight_api service
120           tags: step2
121           service: name=opendaylight state=stopped enabled=no