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