Bring in ovn based scenario
[fuel.git] / mcp / patches / 0011-maas-region-interface-default-mode-DHCP.patch
1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2017 Mirantis Inc., Enea AB and others.
3 :
4 : All rights reserved. This program and the accompanying materials
5 : are made available under the terms of the Apache License, Version 2.0
6 : which accompanies this distribution, and is available at
7 : http://www.apache.org/licenses/LICENSE-2.0
8 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
9 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
10 Date: Mon, 18 Dec 2017 02:03:01 +0200
11 Subject: [PATCH] maas: region: interface: default mode DHCP
12
13 Switch MaaS interface mode default from AUTO to DHCP.
14 This way, MaaS will not statically assign IPs *outside* the dynamic
15 reserved range, but instead DHCP will assign them *inside* the range.
16
17 One alternative would be to handle this via API calls, for each
18 node's PXE physical interface, but that overcomplicates things.
19
20 JIRA: FUEL-316
21
22 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
23 ---
24
25 diff --git a/maas/region.sls b/maas/region.sls
26 --- a/maas/region.sls
27 +++ b/maas/region.sls
28 @@ -39,6 +39,16 @@
29      - require_in:
30        - service: maas_region_services
31
32 +maas_interface_default_mode_dhcp:
33 +  file.replace:
34 +    - name: "/usr/lib/python3/dist-packages/maasserver/models/node.py"
35 +    - pattern: '^(\s+INTERFACE_LINK_TYPE)\.AUTO'
36 +    - repl: \1.DHCP
37 +    - require:
38 +      - pkg: maas_region_packages
39 +    - require_in:
40 +      - service: maas_region_services
41 +
42  {%- if region.get('enable_iframe', False)  %}
43
44  /etc/apache2/conf-enabled/maas-http.conf: