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