[baremetal] Stein, Bionic, py3 support
[fuel.git] / mcp / patches / salt-formula-maas / 0002-maas-region-allow-timeout-override.patch
1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2019 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: Sat, 23 Sep 2017 02:03:01 +0200
11 Subject: [PATCH] maas: region: allow timeout override
12
13 Two changes are squashed into a single patch so we can test for
14 reverse-applying the cummulative diff.
15
16 1. Poor implementation that allows overiding comissioning/deploying
17 timeouts, which are hardcoded in MaaS source code.
18
19 Add the following reclass _param:
20 - opnfv_maas_timeout_comissioning;
21 - opnfv_maas_timeout_deploying;
22
23 The defaults are now 10/15 minutes (MaaS defaults to 20/40 min).
24
25 2. maas: region: interface: default mode DHCP
26
27 Switch MaaS interface mode default from AUTO to DHCP.
28 This way, MaaS will not statically assign IPs *outside* the dynamic
29 reserved range, but instead DHCP will assign them *inside* the range.
30
31 One alternative would be to handle this via API calls, for each
32 node's PXE physical interface, but that overcomplicates things.
33
34 3. MaaS blocksize: For some reason the python library behind tftp forces ip
35 blocksize to be 1008. We can force it to be 1464 and gain some performance due
36 to MTU beeing 1500 (i.e. allow bigger packets).
37
38 JIRA: FUEL-316
39
40 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
41 ---
42  maas/region.sls | 30 ++++++++++++++++++++++++++++++
43  1 file changed, 30 insertions(+)
44
45 diff --git a/maas/region.sls b/maas/region.sls
46 index de5054a..4a7f6cc 100644
47 --- a/maas/region.sls
48 +++ b/maas/region.sls
49 @@ -38,6 +38,36 @@ restore_maas_database_{{ region.database.name }}:
50
51  {%- endif %}
52
53 +maas_timeout_commissioning:
54 +  file.replace:
55 +    - name: "/usr/lib/python3/dist-packages/maasserver/node_status.py"
56 +    - pattern: '^(\s+NODE_STATUS.COMMISSIONING:)\s+\d+,$'
57 +    - repl: \1 {{ salt['pillar.get']('_param:opnfv_maas_timeout_comissioning', '20') }},
58 +    - require:
59 +      - pkg: maas_region_packages
60 +    - require_in:
61 +      - service: maas_region_services
62 +
63 +maas_timeout_deploying:
64 +  file.replace:
65 +    - name: "/usr/lib/python3/dist-packages/maasserver/node_status.py"
66 +    - pattern: '^(\s+NODE_STATUS.DEPLOYING:)\s+\d+,$'
67 +    - repl: \1 {{ salt['pillar.get']('_param:opnfv_maas_timeout_deploying', '40') }},
68 +    - require:
69 +      - pkg: maas_region_packages
70 +    - require_in:
71 +      - service: maas_region_services
72 +
73 +maas_interface_default_mode_dhcp:
74 +  file.replace:
75 +    - name: "/usr/lib/python3/dist-packages/maasserver/models/node.py"
76 +    - pattern: '^(\s+INTERFACE_LINK_TYPE)\.AUTO'
77 +    - repl: \1.DHCP
78 +    - require:
79 +      - pkg: maas_region_packages
80 +    - require_in:
81 +      - service: maas_region_services
82 +
83  {%- if region.get('enable_iframe', False)  %}
84
85  /etc/apache2/conf-enabled/maas-http.conf: