Merge "Add IronicPxe to the default controller" into stable/pike
[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   ServiceData:
14     default: {}
15     description: Dictionary packing service data
16     type: json
17   ServiceNetMap:
18     default: {}
19     description: Mapping of service_name -> network name. Typically set
20                  via parameter_defaults in the resource registry.  This
21                  mapping overrides those in ServiceNetMapDefaults.
22     type: json
23   DefaultPasswords:
24     default: {}
25     type: json
26   RoleName:
27     default: ''
28     description: Role name on which the service is applied
29     type: string
30   RoleParameters:
31     default: {}
32     description: Parameters specific to the role
33     type: json
34   EndpointMap:
35     default: {}
36     description: Mapping of service endpoint -> protocol. Typically set
37                  via parameter_defaults in the resource registry.
38     type: json
39   UpgradeRemoveUnusedPackages:
40     default: false
41     description: Remove package if the service is being disabled during upgrade
42     type: boolean
43
44 resources:
45
46   ContainersCommon:
47     type: ./containers-common.yaml
48
49   NeutronOvsAgentBase:
50     type: ../../puppet/services/neutron-ovs-agent.yaml
51     properties:
52       EndpointMap: {get_param: EndpointMap}
53       ServiceData: {get_param: ServiceData}
54       ServiceNetMap: {get_param: ServiceNetMap}
55       DefaultPasswords: {get_param: DefaultPasswords}
56       RoleName: {get_param: RoleName}
57       RoleParameters: {get_param: RoleParameters}
58
59 outputs:
60   role_data:
61     description: Role data for Neutron openvswitch service
62     value:
63       service_name: {get_attr: [NeutronOvsAgentBase, role_data, service_name]}
64       config_settings: {get_attr: [NeutronOvsAgentBase, role_data, config_settings]}
65       logging_source: {get_attr: [NeutronOvsAgentBase, role_data, logging_source]}
66       logging_groups: {get_attr: [NeutronOvsAgentBase, role_data, logging_groups]}
67       step_config: &step_config
68         get_attr: [NeutronOvsAgentBase, role_data, step_config]
69       puppet_config:
70         config_volume: neutron
71         puppet_tags: neutron_config,neutron_agent_ovs,neutron_plugin_ml2
72         step_config: *step_config
73         config_image: {get_param: DockerNeutronConfigImage}
74       kolla_config:
75         /var/lib/kolla/config_files/neutron_ovs_agent.json:
76           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
77           config_files:
78             - source: "/var/lib/kolla/config_files/src/*"
79               dest: "/"
80               merge: true
81               preserve_properties: true
82           permissions:
83             - path: /var/log/neutron
84               owner: neutron:neutron
85               recurse: true
86       docker_config:
87         step_3:
88           neutron_ovs_bridge:
89             detach: false
90             image: {get_param: DockerNeutronConfigImage}
91             net: host
92             pid: host
93             user: root
94             privileged: true
95             command:
96               - puppet
97               - apply
98               - --modulepath
99               - /etc/puppet/modules:/usr/share/openstack-puppet/modules
100               - --tags
101               - file,file_line,concat,augeas,neutron::plugins::ovs::bridge
102               - -v
103               - -e
104               - include neutron::agents::ml2::ovs
105             volumes:
106               list_concat:
107                 - {get_attr: [ContainersCommon, volumes]}
108                 -
109                   - /var/lib/kolla/config_files/neutron_ovs_agent.json:/var/lib/kolla/config_files/config.json:ro
110                   - /var/lib/config-data/puppet-generated/neutron/:/var/lib/kolla/config_files/src:ro
111                   - /lib/modules:/lib/modules:ro
112                   - /run:/run
113                   - /etc/puppet:/etc/puppet:ro
114                   - /usr/share/openstack-puppet/modules/:/usr/share/openstack-puppet/modules/:ro
115                   - /var/run/openvswitch/db.sock:/var/run/openvswitch/db.sock
116             environment:
117               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
118         step_4:
119           neutron_ovs_agent:
120             image: {get_param: DockerOpenvswitchImage}
121             net: host
122             pid: host
123             privileged: true
124             restart: always
125             volumes:
126               list_concat:
127                 - {get_attr: [ContainersCommon, volumes]}
128                 -
129                   - /var/lib/kolla/config_files/neutron_ovs_agent.json:/var/lib/kolla/config_files/config.json:ro
130                   - /var/lib/config-data/puppet-generated/neutron/:/var/lib/kolla/config_files/src:ro
131                   - /lib/modules:/lib/modules:ro
132                   - /run:/run
133                   - /var/log/containers/neutron:/var/log/neutron
134             environment:
135               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
136       host_prep_tasks:
137         - name: create persistent logs directory
138           file:
139             path: /var/log/containers/neutron
140             state: directory
141       upgrade_tasks:
142         - name: Stop and disable neutron_ovs_agent service
143           tags: step2
144           service: name=neutron-openvswitch-agent state=stopped enabled=no
145         - name: Remove openstack-neutron-openvswitch package if operator requests it
146           yum: name=openstack-neutron-openvswitch state=removed
147           tags: step2
148           ignore_errors: True
149           when: {get_param: UpgradeRemoveUnusedPackages}