Merge "Mount hostpath logs on /var/log"
[apex-tripleo-heat-templates.git] / docker / services / neutron-ovs-agent.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Neutron openvswitch service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerOpenvswitchImage:
12     description: image
13     default: 'centos-binary-neutron-openvswitch-agent:latest'
14     type: string
15   ServiceNetMap:
16     default: {}
17     description: Mapping of service_name -> network name. Typically set
18                  via parameter_defaults in the resource registry.  This
19                  mapping overrides those in ServiceNetMapDefaults.
20     type: json
21   DefaultPasswords:
22     default: {}
23     type: json
24   EndpointMap:
25     default: {}
26     description: Mapping of service endpoint -> protocol. Typically set
27                  via parameter_defaults in the resource registry.
28     type: json
29
30 resources:
31
32   ContainersCommon:
33     type: ./containers-common.yaml
34
35   NeutronOvsAgentBase:
36     type: ../../puppet/services/neutron-ovs-agent.yaml
37     properties:
38       EndpointMap: {get_param: EndpointMap}
39       ServiceNetMap: {get_param: ServiceNetMap}
40       DefaultPasswords: {get_param: DefaultPasswords}
41
42 outputs:
43   role_data:
44     description: Role data for Neutron openvswitch service
45     value:
46       service_name: {get_attr: [NeutronOvsAgentBase, role_data, service_name]}
47       config_settings: {get_attr: [NeutronOvsAgentBase, role_data, config_settings]}
48       step_config: &step_config
49         get_attr: [NeutronOvsAgentBase, role_data, step_config]
50       puppet_config:
51         config_volume: neutron
52         puppet_tags: neutron_config,neutron_agent_ovs,neutron_plugin_ml2
53         step_config: *step_config
54         config_image: &neutron_ovs_agent_image
55           list_join:
56           - '/'
57           - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchImage} ]
58       kolla_config:
59         /var/lib/kolla/config_files/neutron-openvswitch-agent.json:
60           command: /usr/bin/neutron-openvswitch-agent --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/openvswitch_agent.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
61           permissions:
62             - path: /var/log/neutron
63               owner: neutron:neutron
64               recurse: true
65       docker_config:
66         step_4:
67           neutronovsagent:
68             image: *neutron_ovs_agent_image
69             net: host
70             pid: host
71             privileged: true
72             restart: always
73             volumes:
74               list_concat:
75                 - {get_attr: [ContainersCommon, volumes]}
76                 -
77                   - /var/lib/kolla/config_files/neutron-openvswitch-agent.json:/var/lib/kolla/config_files/config.json:ro
78                   - /var/lib/config-data/neutron/etc/neutron/:/etc/neutron/:ro
79                   - /lib/modules:/lib/modules:ro
80                   - /run:/run
81                   - /var/log/containers/neutron:/var/log/neutron
82             environment:
83               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
84       host_prep_tasks:
85         - name: create persistent logs directory
86           file:
87             path: /var/log/containers/neutron
88             state: directory
89       upgrade_tasks:
90         - name: Stop and disable neutron_ovs_agent service
91           tags: step2
92           service: name=neutron-openvswitch-agent state=stopped enabled=no