summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mcp/patches/0001-opendaylight-formula-neutron.patch (renamed from mcp/patches/0002-opendaylight-formula-neutron.patch)0
-rw-r--r--mcp/patches/0002-maas-region-skip-credentials-update.patch30
-rw-r--r--mcp/patches/0003-maas-region-force-artifact-download.patch39
-rw-r--r--mcp/patches/patches.list4
4 files changed, 72 insertions, 1 deletions
diff --git a/mcp/patches/0002-opendaylight-formula-neutron.patch b/mcp/patches/0001-opendaylight-formula-neutron.patch
index e52d315a5..e52d315a5 100644
--- a/mcp/patches/0002-opendaylight-formula-neutron.patch
+++ b/mcp/patches/0001-opendaylight-formula-neutron.patch
diff --git a/mcp/patches/0002-maas-region-skip-credentials-update.patch b/mcp/patches/0002-maas-region-skip-credentials-update.patch
new file mode 100644
index 000000000..f2104e51f
--- /dev/null
+++ b/mcp/patches/0002-maas-region-skip-credentials-update.patch
@@ -0,0 +1,30 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Sat, 5 Aug 2017 02:03:01 +0200
+Subject: [PATCH] maas: region: skip credentials update
+
+Password update for maas psql database breaks ulterior acesses
+to maas-region syncdb.
+For now, limit regiond.conf changes to maas_url, and skip
+updating credentials.
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+
+diff --git a/maas/region.sls b/maas/region.sls
+index d3227ca..8a2243d 100644
+--- a/maas/region.sls
++++ b/maas/region.sls
+@@ -6,10 +6,9 @@
+ - names: {{ region.pkgs }}
+
+ /etc/maas/regiond.conf:
+- file.managed:
+- - source: salt://maas/files/regiond.conf
+- - template: jinja
+- - group: maas
++ file.replace:
++ - pattern: ^maas_url.*$
++ - repl: "maas_url: http://{{ region.bind.host }}/MAAS"
+ - require:
+ - pkg: maas_region_packages
+
diff --git a/mcp/patches/0003-maas-region-force-artifact-download.patch b/mcp/patches/0003-maas-region-force-artifact-download.patch
new file mode 100644
index 000000000..72114bb48
--- /dev/null
+++ b/mcp/patches/0003-maas-region-force-artifact-download.patch
@@ -0,0 +1,39 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Sat, 5 Aug 2017 02:03:01 +0200
+Subject: [PATCH] maas: region: force artifact download
+
+MaaS configuration fails until all required artifacts are in place,
+including bootloaders and target images.
+
+Hack around this by forcing an explicit artifact sync.
+
+NOTE: This is probably achievable through existing maas salt custom
+module (py) and/or minor rework on that.
+This fixup should be temporary at best.
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+
+diff --git a/maas/region.sls b/maas/region.sls
+index d3227ca..8a2243d 100644
+--- a/maas/region.sls
++++ b/maas/region.sls
+@@ -109,11 +109,17 @@
+ cmd.run:
+ - name: "maas-region apikey --username {{ region.admin.username }} > /var/lib/maas/.maas_credentials"
+
++maas_force_artifact_sync:
++ cmd.run:
++ - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && while ! grep -qzE '(Unable to probe for DHCP servers|DHCP probe complete).*Rack controller' /var/log/maas/rackd.log; do sleep 5; echo -n '.'; done && maas opnfv boot-resources import && while maas opnfv boot-resources is-importing | grep -q -e 'true'; do sleep 5; echo -n '.'; done && maas opnfv rack-controllers import-boot-images && while ! test -d /var/lib/maas/boot-resources/current/ubuntu; do sleep 5; echo -n '.'; done"
++ - require:
++ - cmd: maas_login_admin
++
+ maas_config:
+ module.run:
+ - name: maas.process_maas_config
+ - require:
+- - cmd: maas_login_admin
++ - cmd: maas_force_artifact_sync
+
+ maas_commissioning_scripts:
+ module.run:
diff --git a/mcp/patches/patches.list b/mcp/patches/patches.list
index 0542433c7..e55e67984 100644
--- a/mcp/patches/patches.list
+++ b/mcp/patches/patches.list
@@ -1 +1,3 @@
-/usr/share/salt-formulas/env: 0002-opendaylight-formula-neutron.patch
+/usr/share/salt-formulas/env: 0001-opendaylight-formula-neutron.patch
+/usr/share/salt-formulas/env: 0002-maas-region-skip-credentials-update.patch
+/usr/share/salt-formulas/env: 0003-maas-region-force-artifact-download.patch