]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
cobbler: adds a snippet to create post install kernel options.
authorAndrew Schoen <aschoen@redhat.com>
Fri, 15 May 2015 21:12:20 +0000 (16:12 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 20 May 2015 21:18:21 +0000 (16:18 -0500)
This snippet is used by the cephlab_preseed_late script to set the
GRUB_CMDLINE_LINUX value in /etc/defaults/grub to what's defined by
the system, profile or distro that's currently being imaged.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/cobbler/templates/scripts/cephlab_preseed_late
roles/cobbler/templates/snippets/cephlab_post_install_kernel_options [new file with mode: 0644]

index df4100117a472947a2ceff82c6cc36f0cfad286b..7f9180efdfe60b2e4708875ab3a1304cd54c2d09 100644 (file)
@@ -2,6 +2,9 @@
 # Start preseed_late_default
 # This script runs in the chroot /target by default
 $SNIPPET('post_install_network_config_deb')
+# set kernel options as defined by the system, profile or distro
+# in the Kernel Options (Post Install) field which populates the var kernel_options_post
+$SNIPPET('cephlab_post_install_kernel_options')
 $SNIPPET('late_apt_repo_config')
 $SNIPPET('post_run_deb')
 $SNIPPET('download_config_files')
diff --git a/roles/cobbler/templates/snippets/cephlab_post_install_kernel_options b/roles/cobbler/templates/snippets/cephlab_post_install_kernel_options
new file mode 100644 (file)
index 0000000..8479cc9
--- /dev/null
@@ -0,0 +1,12 @@
+## {{ ansible_managed }}
+#if $getVar('kernel_options_post','') != ''
+# Start post install kernel options update
+if [ -f /etc/default/grub ]; then
+  # set GRUB_CMDLINE_LINUX
+  TMP_GRUB=\$(gawk 'match(\$0,/^GRUB_CMDLINE_LINUX="([^"]+)"/,a) {printf("%s\n",a[1])}' /etc/default/grub)
+  sed -i '/^GRUB_CMDLINE_LINUX=/d' /etc/default/grub
+  echo "GRUB_CMDLINE_LINUX=\"\$TMP_GRUB $kernel_options_post\"" >> /etc/default/grub
+  grub-mkconfig -o /boot/grub/grub.cfg
+fi
+# End post install kernel options update
+#end if