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