summaryrefslogtreecommitdiffstats
path: root/mcp/patches/salt-formula-maas/0006-curtin-Add-Bionic-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'mcp/patches/salt-formula-maas/0006-curtin-Add-Bionic-support.patch')
-rw-r--r--mcp/patches/salt-formula-maas/0006-curtin-Add-Bionic-support.patch30
1 files changed, 23 insertions, 7 deletions
diff --git a/mcp/patches/salt-formula-maas/0006-curtin-Add-Bionic-support.patch b/mcp/patches/salt-formula-maas/0006-curtin-Add-Bionic-support.patch
index 1f53697ad..a279e019d 100644
--- a/mcp/patches/salt-formula-maas/0006-curtin-Add-Bionic-support.patch
+++ b/mcp/patches/salt-formula-maas/0006-curtin-Add-Bionic-support.patch
@@ -12,19 +12,19 @@ Subject: [PATCH] curtin: Add Bionic support
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
- .../curtin_userdata_amd64_generic_bionic | 80 +++++++++++++++++++
- .../curtin_userdata_arm64_generic_bionic | 65 +++++++++++++++
+ .../curtin_userdata_amd64_generic_bionic | 83 +++++++++++++++++++
+ .../curtin_userdata_arm64_generic_bionic | 78 +++++++++++++++++
maas/region.sls | 24 ++++++
- 3 files changed, 169 insertions(+)
+ 3 files changed, 185 insertions(+)
create mode 100644 maas/files/curtin_userdata_amd64_generic_bionic
create mode 100644 maas/files/curtin_userdata_arm64_generic_bionic
diff --git a/maas/files/curtin_userdata_amd64_generic_bionic b/maas/files/curtin_userdata_amd64_generic_bionic
new file mode 100644
-index 0000000..0b6fd15
+index 0000000..6b01a58
--- /dev/null
+++ b/maas/files/curtin_userdata_amd64_generic_bionic
-@@ -0,0 +1,80 @@
+@@ -0,0 +1,83 @@
+{%- from "maas/map.jinja" import cluster with context %}
+{%- raw %}
+#cloud-config
@@ -63,6 +63,9 @@ index 0000000..0b6fd15
+ apt_04_install_pkgs_{{ loop.index }}: ["curtin", "in-target", "--", "apt-get", "-y", "install", "{{ pkg }}"]
+ {% endfor %}
+{%- endif %}
++{%- if salt['pillar.get']('maas:cluster:curtin_vars:amd64:bionic:kernel_package:enabled')|default(false) %}
++ apt_05_kernel_old_absent: ["curtin", "in-target", "--", "sh", "-c", "dpkg -l '*linux-generic-*[0-9]*' '*linux-image-*[0-9]*' '*linux-headers-*[0-9]*' '*linux-image-extra-*[0-9]*' '*linux-modules-extra-*[0-9]*' 2>/dev/null | grep -E '^ii' | awk '{print $2}' | grep -v '{{ pillar.maas.cluster.curtin_vars.amd64.bionic.kernel_package.value.split('-')[2:-1] | join('-') }}' | xargs dpkg --purge --force-depends"]
++{%- endif %}
+ salt_01_install: ["curtin", "in-target", "--", "apt-get", "-y", "install", "salt-minion", "ifupdown", "cloud-init", "dnsmasq"]
+ salt_02_hostname_set: ["curtin", "in-target", "--", "echo", "{% raw %}{{node.hostname}}{% endraw %}.{{pillar.linux.system.domain}}"]
+ salt_03_hostname_get: ["curtin", "in-target", "--", "sh", "-c", "echo 'id: {% raw %}{{node.hostname}}{% endraw %}.{{pillar.linux.system.domain}}' >> /etc/salt/minion.d/minion.conf"]
@@ -107,10 +110,10 @@ index 0000000..0b6fd15
+#}
diff --git a/maas/files/curtin_userdata_arm64_generic_bionic b/maas/files/curtin_userdata_arm64_generic_bionic
new file mode 100644
-index 0000000..c7cb997
+index 0000000..54c908c
--- /dev/null
+++ b/maas/files/curtin_userdata_arm64_generic_bionic
-@@ -0,0 +1,65 @@
+@@ -0,0 +1,78 @@
+{%- from "maas/map.jinja" import cluster with context %}
+{% raw %}
+#cloud-config
@@ -143,6 +146,14 @@ index 0000000..c7cb997
+{#- NOTE: Re-use amd64 repos on arm64 since most packages are arch independent #}
+ apt_01_set_repo: ["curtin", "in-target", "--", "sh", "-c", "echo '{{ saltstack_repo }}' >> /etc/apt/sources.list.d/mcp_saltstack.list"]
+ apt_03_update: ["curtin", "in-target", "--", "apt-get", "update"]
++{%- if salt['pillar.get']('maas:cluster:curtin_vars:arm64:bionic:extra_pkgs:enabled')|default(false) %}
++ {% for pkg in pillar.maas.cluster.curtin_vars.arm64.bionic.extra_pkgs.pkgs -%}
++ apt_04_install_pkgs_{{ loop.index }}: ["curtin", "in-target", "--", "apt-get", "-y", "install", "{{ pkg }}"]
++ {% endfor %}
++{%- endif %}
++{%- if salt['pillar.get']('maas:cluster:curtin_vars:arm64:bionic:kernel_package:enabled')|default(false) %}
++ apt_05_kernel_old_absent: ["curtin", "in-target", "--", "sh", "-c", "dpkg -l '*linux-generic-*[0-9]*' '*linux-image-*[0-9]*' '*linux-headers-*[0-9]*' '*linux-image-extra-*[0-9]*' '*linux-modules-extra-*[0-9]*' 2>/dev/null | grep -E '^ii' | awk '{print $2}' | grep -v '{{ pillar.maas.cluster.curtin_vars.arm64.bionic.kernel_package.value.split('-')[2:-1] | join('-') }}' | xargs dpkg --purge --force-depends"]
++{%- endif %}
+ salt_01_install: ["curtin", "in-target", "--", "apt-get", "-y", "install", "salt-minion", "python-futures", "ifupdown", "cloud-init", "dnsmasq"]
+ salt_02_hostname_set: ["curtin", "in-target", "--", "echo", "{% raw %}{{node.hostname}}{% endraw %}.{{pillar.linux.system.domain}}"]
+ salt_03_hostname_get: ["curtin", "in-target", "--", "sh", "-c", "echo 'id: {% raw %}{{node.hostname}}{% endraw %}.{{pillar.linux.system.domain}}' >> /etc/salt/minion.d/minion.conf"]
@@ -165,6 +176,11 @@ index 0000000..c7cb997
+ salt_26_bionic_networking_enable: ["curtin", "in-target", "--", "systemctl", "enable", "networking.service"]
+ salt_27_bionic_networking_start: ["curtin", "in-target", "--", "systemctl", "start", "networking.service"]
+
++{%- if salt['pillar.get']('maas:cluster:curtin_vars:arm64:bionic:kernel_package:enabled')|default(false) %}
++kernel:
++ package: {{ pillar.maas.cluster.curtin_vars.arm64.bionic.kernel_package.value }}
++{%- endif %}
++
+{% raw %}
+{{if third_party_drivers and driver}}
+ driver_00_key_get: curtin in-target -- sh -c "/bin/echo -en '{{key_string}}' > /tmp/maas-{{driver['package']}}.gpg"