"Ubuntu-12.04-server-x86_64":
iso: "http://releases.ubuntu.com/12.04/ubuntu-12.04.5-server-amd64.iso"
kickstart: cephlab_ubuntu.preseed
+ kernel_options: "netcfg/choose_interface=auto biosdevname=0 console=tty0 console=ttyS1,115200"
+ kernel_options_post: "pci=realloc=off console=tty0 console=ttyS1,115200"
"Ubuntu-14.04-server-x86_64":
iso: "http://releases.ubuntu.com/14.04/ubuntu-14.04.2-server-amd64.iso"
kickstart: cephlab_ubuntu.preseed
+ kernel_options: "netcfg/choose_interface=auto biosdevname=0 console=tty0 console=ttyS1,115200"
+ kernel_options_post: "pci=realloc=off console=tty0 console=ttyS1,115200"
"Ubuntu-15.04-server-x86_64":
iso: "http://releases.ubuntu.com/15.04/ubuntu-15.04-server-amd64.iso"
kickstart: cephlab_ubuntu.preseed
+ kernel_options: "netcfg/choose_interface=auto biosdevname=0 console=tty0 console=ttyS1,115200"
+ kernel_options_post: "pci=realloc=off console=tty0 console=ttyS1,115200"
(import is defined and import.rc == 0))
- include: update_kickstart.yml
- when: distro.kickstart is defined and distro.kickstart != '' and
+ when: distro.kickstart is defined and
+ distro.kickstart != '' and
+ profile_found
+
+- include: update_kernel_options.yml
+ when: distro.kernel_options is defined and
+ distro.kernel_options != '' and
+ profile_found
+
+- include: update_kernel_options_post.yml
+ when: distro.kernel_options_post is defined and
+ distro.kernel_options_post != '' and
profile_found
--- /dev/null
+---
+# This returns additional kernel_options not explicitly set in the profile by us.
+# These values come from the distro import, I believe. Here's some example output from the vivid profile:
+# ksdevice=bootif lang= biosdevname=0 text netcfg/choose_interface=auto console=tty0 console=ttyS1,115200
+# The 'ksdevice=bootif lang=' was not added by the profile and persists even when resetting the kernel_options
+# in the next task. This means that setting kernel_options will never be idempotent.
+- name: Check to see if kernel_options needs updating
+ shell: "cobbler profile dumpvars --name={{ distro_name }} | grep '^kernel_options :' | cut -d : -f 2"
+ changed_when: false
+ register: kernel_options
+
+# This task is not idempotent because of the reason mentioned above.
+- name: "Set the profile's kernel_options"
+ command: cobbler profile edit --name={{ distro_name }} --kopts='{{ distro.kernel_options }}'
+ when: kernel_options.stdout.strip() != distro.kernel_options
--- /dev/null
+---
+- name: Get current value for kernel_options_post
+ shell: "cobbler profile dumpvars --name={{ distro_name }} | grep '^kernel_options_post :' | cut -d : -f 2"
+ changed_when: false
+ register: kernel_options_post
+
+- name: "Set the profile's kernel_options_post if needed."
+ command: cobbler profile edit --name={{ distro_name }} --kopts-post='{{ distro.kernel_options_post }}'
+ when: kernel_options_post.stdout.strip() != distro.kernel_options_post