abb2f9e117d256a4f54afaa282dd99e060650bcb
[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   DockerOpenvswitchImage:
8     description: image
9     type: string
10   DockerNeutronConfigImage:
11     description: The container image to use for the neutron config_volume
12     type: string
13   ServiceNetMap:
14     default: {}
15     description: Mapping of service_name -> network name. Typically set
16                  via parameter_defaults in the resource registry.  This
17                  mapping overrides those in ServiceNetMapDefaults.
18     type: json
19   DefaultPasswords:
20     default: {}
21     type: json
22   RoleName:
23     default: ''
24     description: Role name on which the service is applied
25     type: string
26   RoleParameters:
27     default: {}
28     description: Parameters specific to the role
29     type: json
30   EndpointMap:
31     default: {}
32     description: Mapping of service endpoint -> protocol. Typically set
33                  via parameter_defaults in the resource registry.
34     type: json
35
36 resources:
37
38   ContainersCommon:
39     type: ./containers-common.yaml
40
41   NeutronOvsAgentBase:
42     type: ../../puppet/services/neutron-ovs-agent.yaml
43     properties:
44       EndpointMap: {get_param: EndpointMap}
45       ServiceNetMap: {get_param: ServiceNetMap}
46       DefaultPasswords: {get_param: DefaultPasswords}
47       RoleName: {get_param: RoleName}
48       RoleParameters: {get_param: RoleParameters}
49
50 outputs:
51   role_data:
52     description: Role data for Neutron openvswitch service
53     value:
54       service_name: {get_attr: [NeutronOvsAgentBase, role_data, service_name]}
55       config_settings: {get_attr: [NeutronOvsAgentBase, role_data, config_settings]}
56       step_config: &step_config
57         get_attr: [NeutronOvsAgentBase, role_data, step_config]
58       puppet_config:
59         config_volume: neutron
60         puppet_tags: neutron_config,neutron_agent_ovs,neutron_plugin_ml2
61         step_config: *step_config
62         config_image: {get_param: DockerNeutronConfigImage}
63       kolla_config:
64         /var/lib/kolla/config_files/neutron_ovs_agent.json:
65           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 --config-dir /etc/neutron/conf.d/common
66           config_files:
67             - source: "/var/lib/kolla/config_files/src/*"
68               dest: "/"
69               merge: true
70               preserve_properties: true
71           permissions:
72             - path: /var/log/neutron
73               owner: neutron:neutron
74               recurse: true
75       docker_config:
76         step_4:
77           neutron_ovs_agent:
78             image: {get_param: DockerOpenvswitchImage}
79             net: host
80             pid: host
81             privileged: true
82             restart: always
83             volumes:
84               list_concat:
85                 - {get_attr: [ContainersCommon, volumes]}
86                 -
87                   - /var/lib/kolla/config_files/neutron_ovs_agent.json:/var/lib/kolla/config_files/config.json:ro
88                   - /var/lib/config-data/puppet-generated/neutron/:/var/lib/kolla/config_files/src:ro
89                   - /lib/modules:/lib/modules:ro
90                   - /run:/run
91                   - /var/log/containers/neutron:/var/log/neutron
92             environment:
93               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
94       host_prep_tasks:
95         - name: create persistent logs directory
96           file:
97             path: /var/log/containers/neutron
98             state: directory
99       upgrade_tasks:
100         - name: Stop and disable neutron_ovs_agent service
101           tags: step2
102           service: name=neutron-openvswitch-agent state=stopped enabled=no