Change flat network name for nosdn fdio scenario
[apex-tripleo-heat-templates.git] / puppet / services / neutron-ovs-agent.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Neutron OVS agent configured with Puppet
5
6 parameters:
7   ServiceData:
8     default: {}
9     description: Dictionary packing service data
10     type: json
11   ServiceNetMap:
12     default: {}
13     description: Mapping of service_name -> network name. Typically set
14                  via parameter_defaults in the resource registry.  This
15                  mapping overrides those in ServiceNetMapDefaults.
16     type: json
17   DefaultPasswords:
18     default: {}
19     type: json
20   RoleName:
21     default: ''
22     description: Role name on which the service is applied
23     type: string
24   RoleParameters:
25     default: {}
26     description: Parameters specific to the role
27     type: json
28   EndpointMap:
29     default: {}
30     description: Mapping of service endpoint -> protocol. Typically set
31                  via parameter_defaults in the resource registry.
32     type: json
33   NeutronEnableL2Pop:
34     type: string
35     description: Enable/disable the L2 population feature in the Neutron agents.
36     default: "False"
37   NeutronBridgeMappings:
38     description: >
39       The OVS logical->physical bridge mappings to use. See the Neutron
40       documentation for details. Defaults to mapping br-ex - the external
41       bridge on hosts - to a physical name 'datacentre' which can be used
42       to create provider networks (and we use this for the default floating
43       network) - if changing this either use different post-install network
44       scripts or be sure to keep 'datacentre' as a mapping network name.
45     type: comma_delimited_list
46     default: "datacentre:br-ex"
47   NeutronTunnelTypes:
48     default: 'vxlan'
49     description: The tunnel types for the Neutron tenant network.
50     type: comma_delimited_list
51   NeutronAgentExtensions:
52     default: "qos"
53     description: |
54         Comma-separated list of extensions enabled for the Neutron agents.
55     type: comma_delimited_list
56   NeutronEnableDVR:
57     default: False
58     description: Enable Neutron DVR.
59     type: boolean
60   NeutronEnableARPResponder:
61     default: false
62     description: |
63       Enable ARP responder feature in the OVS Agent.
64     type: boolean
65   MonitoringSubscriptionNeutronOvs:
66     default: 'overcloud-neutron-ovs-agent'
67     type: string
68   NeutronOVSFirewallDriver:
69     default: ''
70     description: |
71       Configure the classname of the firewall driver to use for implementing
72       security groups. Possible values depend on system configuration. Some
73       examples are: noop, openvswitch, iptables_hybrid. The default value of an
74       empty string will result in a default supported configuration.
75     type: string
76   NeutronOpenVswitchAgentLoggingSource:
77     type: json
78     default:
79       tag: openstack.neutron.agent.openvswitch
80       path: /var/log/neutron/openvswitch-agent.log
81
82 conditions:
83   no_firewall_driver: {equals : [{get_param: NeutronOVSFirewallDriver}, '']}
84
85 resources:
86
87   NeutronBase:
88     type: ./neutron-base.yaml
89     properties:
90       ServiceData: {get_param: ServiceData}
91       ServiceNetMap: {get_param: ServiceNetMap}
92       DefaultPasswords: {get_param: DefaultPasswords}
93       EndpointMap: {get_param: EndpointMap}
94       RoleName: {get_param: RoleName}
95       RoleParameters: {get_param: RoleParameters}
96
97   Ovs:
98     type: ./openvswitch.yaml
99     properties:
100       ServiceNetMap: {get_param: ServiceNetMap}
101       DefaultPasswords: {get_param: DefaultPasswords}
102       EndpointMap: {get_param: EndpointMap}
103
104 outputs:
105   role_data:
106     description: Role data for the Neutron OVS agent service.
107     value:
108       service_name: neutron_ovs_agent
109       monitoring_subscription: {get_param: MonitoringSubscriptionNeutronOvs}
110       logging_source: {get_param: NeutronOpenVswitchAgentLoggingSource}
111       logging_groups:
112         - neutron
113       config_settings:
114         map_merge:
115           - get_attr: [NeutronBase, role_data, config_settings]
116           - neutron::agents::ml2::ovs::l2_population: {get_param: NeutronEnableL2Pop}
117             neutron::agents::ml2::ovs::enable_distributed_routing: {get_param: NeutronEnableDVR}
118             neutron::agents::ml2::ovs::arp_responder: {get_param: NeutronEnableARPResponder}
119             neutron::agents::ml2::ovs::bridge_mappings: {get_param: NeutronBridgeMappings}
120             neutron::agents::ml2::ovs::tunnel_types: {get_param: NeutronTunnelTypes}
121             neutron::agents::ml2::ovs::extensions: {get_param: NeutronAgentExtensions}
122             # NOTE: bind IP is found in Heat replacing the network name with the
123             # local node IP for the given network; replacement examples
124             # (eg. for internal_api):
125             # internal_api -> IP
126             # internal_api_uri -> [IP]
127             # internal_api_subnet - > IP/CIDR
128             neutron::agents::ml2::ovs::local_ip: {get_param: [ServiceNetMap, NeutronTenantNetwork]}
129             tripleo.neutron_ovs_agent.firewall_rules:
130               '118 neutron vxlan networks':
131                 proto: 'udp'
132                 dport: 4789
133               '136 neutron gre networks':
134                 proto: 'gre'
135           -
136             if:
137             - no_firewall_driver
138             - {}
139             - neutron::agents::ml2::ovs::firewall_driver: {get_param: NeutronOVSFirewallDriver}
140       step_config: |
141         include ::tripleo::profile::base::neutron::ovs
142       upgrade_tasks:
143         list_concat:
144           - get_attr: [Ovs, role_data, upgrade_tasks]
145           -
146             - name: Check if neutron_ovs_agent is deployed
147               command: systemctl is-enabled neutron-openvswitch-agent
148               tags: common
149               ignore_errors: True
150               register: neutron_ovs_agent_enabled
151             - name: "PreUpgrade step0,validation: Check service neutron-openvswitch-agent is running"
152               shell: /usr/bin/systemctl show 'neutron-openvswitch-agent' --property ActiveState | grep '\bactive\b'
153               when: neutron_ovs_agent_enabled.rc == 0
154               tags: step0,validation
155             - name: Stop neutron_ovs_agent service
156               tags: step1
157               when: neutron_ovs_agent_enabled.rc == 0
158               service: name=neutron-openvswitch-agent state=stopped