f9df42b4cf
journal and snapshots folders hold data needed for update. This
patch mounts these folders and adds ODL log file in
/var/log/containers/opendaylight
Change-Id: I65c6183c2867b2ced6e6ef25896d80154857b7dc
Closes:Bug: #1714231
(cherry picked from commit 81dd0808d2
)
117 lines
3.9 KiB
YAML
117 lines
3.9 KiB
YAML
heat_template_version: pike
|
|
|
|
description: >
|
|
OpenStack containerized OpenDaylight API service
|
|
|
|
parameters:
|
|
DockerOpendaylightApiImage:
|
|
description: image
|
|
type: string
|
|
DockerOpendaylightConfigImage:
|
|
description: image
|
|
type: string
|
|
EndpointMap:
|
|
default: {}
|
|
description: Mapping of service endpoint -> protocol. Typically set
|
|
via parameter_defaults in the resource registry.
|
|
type: json
|
|
ServiceData:
|
|
default: {}
|
|
description: Dictionary packing service data
|
|
type: json
|
|
ServiceNetMap:
|
|
default: {}
|
|
description: Mapping of service_name -> network name. Typically set
|
|
via parameter_defaults in the resource registry. This
|
|
mapping overrides those in ServiceNetMapDefaults.
|
|
type: json
|
|
DefaultPasswords:
|
|
default: {}
|
|
type: json
|
|
RoleName:
|
|
default: ''
|
|
description: Role name on which the service is applied
|
|
type: string
|
|
RoleParameters:
|
|
default: {}
|
|
description: Parameters specific to the role
|
|
type: json
|
|
|
|
resources:
|
|
|
|
ContainersCommon:
|
|
type: ./containers-common.yaml
|
|
|
|
OpenDaylightBase:
|
|
type: ../../puppet/services/opendaylight-api.yaml
|
|
properties:
|
|
EndpointMap: {get_param: EndpointMap}
|
|
ServiceData: {get_param: ServiceData}
|
|
ServiceNetMap: {get_param: ServiceNetMap}
|
|
DefaultPasswords: {get_param: DefaultPasswords}
|
|
RoleName: {get_param: RoleName}
|
|
RoleParameters: {get_param: RoleParameters}
|
|
|
|
outputs:
|
|
role_data:
|
|
description: Role data for the OpenDaylight API role.
|
|
value:
|
|
service_name: {get_attr: [OpenDaylightBase, role_data, service_name]}
|
|
config_settings:
|
|
map_merge:
|
|
- get_attr: [OpenDaylightBase, role_data, config_settings]
|
|
step_config: &step_config
|
|
get_attr: [OpenDaylightBase, role_data, step_config]
|
|
# BEGIN DOCKER SETTINGS
|
|
puppet_config:
|
|
config_volume: opendaylight
|
|
# 'file,concat,file_line,augeas' are included by default
|
|
puppet_tags: odl_user
|
|
step_config: *step_config
|
|
config_image: {get_param: DockerOpendaylightConfigImage}
|
|
kolla_config:
|
|
/var/lib/kolla/config_files/opendaylight_api.json:
|
|
command: /opt/opendaylight/bin/karaf
|
|
config_files:
|
|
- source: "/var/lib/kolla/config_files/src/*"
|
|
dest: "/"
|
|
merge: true
|
|
preserve_properties: true
|
|
permissions:
|
|
- path: /opt/opendaylight
|
|
owner: odl:odl
|
|
recurse: true
|
|
docker_config:
|
|
step_1:
|
|
opendaylight_api:
|
|
start_order: 0
|
|
image: &odl_api_image {get_param: DockerOpendaylightApiImage}
|
|
privileged: false
|
|
net: host
|
|
detach: true
|
|
user: odl
|
|
restart: always
|
|
volumes:
|
|
list_concat:
|
|
- {get_attr: [ContainersCommon, volumes]}
|
|
-
|
|
- /var/lib/kolla/config_files/opendaylight_api.json:/var/lib/kolla/config_files/config.json:ro
|
|
- /var/lib/config-data/puppet-generated/opendaylight/:/var/lib/kolla/config_files/src:ro
|
|
- /var/log/containers/opendaylight:/opt/opendaylight/data/log
|
|
- /var/lib/opendaylight/journal:/opt/opendaylight/journal
|
|
- /var/lib/opendaylight/snapshots:/opt/opendaylight/snapshots
|
|
environment:
|
|
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
|
|
host_prep_tasks:
|
|
- name: create persistent directories
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
with_items:
|
|
- /var/log/containers/opendaylight
|
|
- /var/lib/opendaylight/snapshots
|
|
- /var/lib/opendaylight/journal
|
|
upgrade_tasks:
|
|
- name: Stop and disable opendaylight_api service
|
|
tags: step2
|
|
service: name=opendaylight state=stopped enabled=no |