[2.1.1] 2.1.0 preseeds with '{{node_disable_pxe_data|escape.shell}}' cause a failed deployment if preseed wasn't upgraded on 2.1.1.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Unassigned | ||
2.1 |
Fix Released
|
Critical
|
Unassigned |
Bug Description
It seems that every recent update to MAAS is modifying curtin_userdata. We have customized curtin_userdata files that do some things we need done on deployment. These are broken with the last three updates I've performed (and broken in customer environments that use our tooling as well).
I expected to have to fix things moving from MAAS 1.9 to 2.0. And we did so, and so our curtin_userdata files were based on this, from MAAS 2.0:
#cloud-config
debconf_selections:
maas: |
{{for line in str(curtin_
{{line}}
{{endfor}}
{{if third_party_drivers and driver}}
early_commands:
{{py: key_string = ''.join(['\\x%x' % x for x in map(ord, driver[
driver_
driver_
driver_02_add: ["add-apt-
driver_
driver_04_load: ["sh", "-c", "depmod && modprobe {{driver[
{{endif}}
late_commands:
maas: [wget, '--no-proxy', '{{node_
{{if third_party_drivers and driver}}
driver_
driver_
driver_03_add: ["curtin", "in-target", "--", "add-apt-
driver_
driver_
driver_06_depmod: ["curtin", "in-target", "--", "depmod"]
driver_
{{endif}}
power_state:
mode: reboot
{{if node.split_
apt_mirrors:
ubuntu_archive: http://{{main_
ubuntu_security: http://{{main_
{{else}}
apt_mirrors:
ubuntu_archive: http://{{ports_
ubuntu_security: http://{{ports_
{{endif}}
{{if enable_http_proxy}}
{{if http_proxy }}
apt_proxy: {{http_proxy}}
{{else}}
apt_proxy: http://{{server_
{{endif}}
{{endif}}
Now, after doing a dist-upgrade once 2.1 appeared in maas/stable, deployments started failing. Investigation revealed this was because between 2.0 and 2.1, the last several lines of curtin_userdata, specifically these:
{{if node.split_
apt_mirrors:
ubuntu_archive: http://{{main_
ubuntu_security: http://{{main_
{{else}}
apt_mirrors:
ubuntu_archive: http://{{ports_
ubuntu_security: http://{{ports_
{{endif}}
{{if enable_http_proxy}}
{{if http_proxy }}
apt_proxy: {{http_proxy}}
{{else}}
apt_proxy: http://{{server_
{{endif}}
{{endif}}
were removed. So I modified just two days ago, our custom curtin_userdata files to match the ones in MAAS 2.1 (MAAS Version 2.1.0+bzr5480-
#cloud-config
debconf_selections:
maas: |
{{for line in str(curtin_
{{line}}
{{endfor}}
{{if third_party_drivers and driver}}
early_commands:
{{py: key_string = ''.join(['\\x%x' % x for x in map(ord, driver[
driver_
driver_
driver_02_add: ["add-apt-
driver_
driver_04_load: ["sh", "-c", "depmod && modprobe {{driver[
{{endif}}
late_commands:
maas: [wget, '--no-proxy', '{{node_
{{if third_party_drivers and driver}}
driver_
driver_
driver_03_add: ["curtin", "in-target", "--", "add-apt-
driver_
driver_
driver_06_depmod: ["curtin", "in-target", "--", "depmod"]
driver_
{{endif}}
power_state:
mode: reboot
Today, another update appears in maas/stable and apparently Xenial Updates:
bladernr@
maas:
Installed: 2.1.1+bzr5544-
Candidate: 2.1.1+bzr5544-
Version table:
*** 2.1.1+bzr5544-
500 http://
500 http://
100 /var/lib/
2.
500 http://
500 http://
And that one makes further changes to curtin_userdata which once again, break deployments. NOW curtin_userdata looks like so:
#cloud-config
debconf_selections:
maas: |
{{for line in str(curtin_
{{line}}
{{endfor}}
{{if third_party_drivers and driver}}
early_commands:
{{py: key_string = ''.join(['\\x%x' % x for x in map(ord, driver[
driver_
driver_
driver_02_add: ["add-apt-
driver_
driver_04_load: ["sh", "-c", "depmod && modprobe {{driver[
{{endif}}
late_commands:
maas: [wget, '--no-proxy', {{node_
{{if third_party_drivers and driver}}
driver_
driver_
driver_03_add: ["curtin", "in-target", "--", "add-apt-
driver_
driver_
driver_06_depmod: ["curtin", "in-target", "--", "depmod"]
driver_
{{endif}}
power_state:
mode: reboot
That's twice in a week I've had to fix problems in our version of curtin_userdata due to changes pushed into Xenial updates.
This time, the culprit is this:
Old version:
maas: [wget, '--no-proxy', '{{node_
New version:
maas: [wget, '--no-proxy', {{node_
SO... we need a way to allow for customizations to curtin_userdata that don't break every time there's a MAAS update pushed to stable or updates.
Perhaps there's a way to have a default curtin_userdata that imports things in a curtin_userdata.d directory? Or a method in the MAAS UI to add customizations that MAAS then injects into the stock curtin_userdata template?
Or perhaps another solution. I understand that we have a fork of curtin_userdata, but I have a hard time believing that Cert is the only customer who has curtin customizations for deployment.
Related branches
- Gavin Panella (community): Approve
-
Diff: 67 lines (+19/-4)2 files modifiedsrc/maasserver/preseed.py (+6/-2)
src/maasserver/tests/test_preseed.py (+13/-2)
- LaMont Jones (community): Approve
-
Diff: 87 lines (+28/-4)3 files modifieddocs/changelog.rst (+9/-0)
src/maasserver/preseed.py (+6/-2)
src/maasserver/tests/test_preseed.py (+13/-2)
description: | updated |
Changed in maas: | |
status: | New → Fix Committed |
Changed in maas: | |
milestone: | 2.2.0 → none |
status: | Fix Committed → Fix Released |
You should use: /maas.ubuntu. com/docs/ development/ preseeds. html
https:/