Enforce static configuration instead of DHCP
[fuel.git] / mcp / patches / 0016-Set-boot-source-selections.patch
1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2018 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: Michael Polenchuk <mpolenchuk@mirantis.com>
10 Date: Thu, 26 Apr 2018 16:29:02 +0400
11 Subject: [PATCH] Set boot source selections
12
13 Change-Id: I8dc738b3e6e6f1bfcc1348873f162651aff8bbdf
14
15 diff --git a/maas/region.sls b/maas/region.sls
16 --- a/maas/region.sls
17 +++ b/maas/region.sls
18 @@ -171,6 +171,13 @@ maas_login_admin:
19    cmd.run:
20    - name: "maas-region apikey --username {{ region.admin.username }} > /var/lib/maas/.maas_credentials"
21
22 +boot_source_selections:
23 +  cmd.run:
24 +  - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv boot-resources stop-import && maas opnfv boot-source-selection update 1 1 release='{{ region.maas_config.default_distro_series }}' {%- for arch in region.opnfv_arches.split(' ') %} arches='{{ arch }}' subarches='generic' subarches='ga-16.04' subarches='hwe-16.04' {%- endfor %}"
25 +  - require:
26 +    - cmd: maas_login_admin
27 +  - unless: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv boot-source-selections read 1 | grep -q {{ region.maas_config.default_distro_series }}"
28 +
29  maas_force_artifact_sync:
30    cmd.script:
31    - name: salt://maas/files/maas-artifact-sync.sh