1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2017 Mirantis Inc., Enea AB and others.
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
13 Two changes are squashed into a single patch so we can test for
14 reverse-applying the cummulative diff.
16 1. Poor implementation that allows overiding comissioning/deploying
17 timeouts, which are hardcoded in MaaS source code.
19 Add the following reclass _param:
20 - opnfv_maas_timeout_comissioning;
21 - opnfv_maas_timeout_deploying;
23 The defaults are now 10/15 minutes (MaaS defaults to 20/40 min).
25 2. maas: region: interface: default mode DHCP
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.
31 One alternative would be to handle this via API calls, for each
32 node's PXE physical interface, but that overcomplicates things.
36 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
39 diff --git a/maas/region.sls b/maas/region.sls
44 - pkg: maas_region_packages
46 +maas_timeout_commissioning:
48 + - name: "/usr/lib/python3/dist-packages/maasserver/node_status.py"
49 + - pattern: '^(\s+NODE_STATUS.COMMISSIONING:)\s+\d+,$'
50 + - repl: \1 {{ salt['pillar.get']('_param:opnfv_maas_timeout_comissioning', '10') }},
52 + - pkg: maas_region_packages
54 + - service: maas_region_services
56 +maas_timeout_deploying:
58 + - name: "/usr/lib/python3/dist-packages/maasserver/node_status.py"
59 + - pattern: '^(\s+NODE_STATUS.DEPLOYING:)\s+\d+,$'
60 + - repl: \1 {{ salt['pillar.get']('_param:opnfv_maas_timeout_deploying', '15') }},
62 + - pkg: maas_region_packages
64 + - service: maas_region_services
66 +maas_interface_default_mode_dhcp:
68 + - name: "/usr/lib/python3/dist-packages/maasserver/models/node.py"
69 + - pattern: '^(\s+INTERFACE_LINK_TYPE)\.AUTO'
72 + - pkg: maas_region_packages
74 + - service: maas_region_services
76 {%- if region.get('enable_iframe', False) %}
78 /etc/apache2/conf-enabled/maas-http.conf: