diff options
author | Emil Renner Berthing <esmil@labitat.dk> | 2018-09-23 21:44:01 +0200 |
---|---|---|
committer | Emil Renner Berthing <esmil@labitat.dk> | 2018-09-23 21:44:01 +0200 |
commit | 2bcbb416d2d14b522f245ed50985558f4be4ffb7 (patch) | |
tree | f0904da167be81ade23a3b3e7611df3dad7a68a3 /roles/space_server | |
parent | 44dbb520f8ae96e25c96085904dd6645d8631efc (diff) | |
download | labitat-ansible-2bcbb416d2d14b522f245ed50985558f4be4ffb7.tar.gz labitat-ansible-2bcbb416d2d14b522f245ed50985558f4be4ffb7.tar.xz labitat-ansible-2bcbb416d2d14b522f245ed50985558f4be4ffb7.zip |
space_server: kernel: order entries by time
Diffstat (limited to 'roles/space_server')
-rwxr-xr-x | roles/space_server/files/kernel/90-loaderentry.install | 1 | ||||
-rwxr-xr-x | roles/space_server/files/kernel/95-syslinux-menu.install | 19 | ||||
-rw-r--r-- | roles/space_server/tasks/kernel.yml | 26 |
3 files changed, 15 insertions, 31 deletions
diff --git a/roles/space_server/files/kernel/90-loaderentry.install b/roles/space_server/files/kernel/90-loaderentry.install index d31529e..df0526e 100755 --- a/roles/space_server/files/kernel/90-loaderentry.install +++ b/roles/space_server/files/kernel/90-loaderentry.install @@ -18,7 +18,6 @@ fi BOOT_DIR="/$MACHINE_ID/$KERNEL_VERSION" BOOT_ROOT=${BOOT_DIR_ABS%$BOOT_DIR} LOADER_ENTRY="$BOOT_ROOT/loader/entries/$MACHINE_ID-$KERNEL_VERSION.conf" -MENU="$BOOT_ROOT/loader/${MACHINE_ID}.cfg" if [[ $COMMAND == remove ]]; then exec rm -f "$LOADER_ENTRY" diff --git a/roles/space_server/files/kernel/95-syslinux-menu.install b/roles/space_server/files/kernel/95-syslinux-menu.install index 06ddad7..183da9e 100755 --- a/roles/space_server/files/kernel/95-syslinux-menu.install +++ b/roles/space_server/files/kernel/95-syslinux-menu.install @@ -19,19 +19,14 @@ BOOT_DIR="/$MACHINE_ID/$KERNEL_VERSION" BOOT_ROOT=${BOOT_DIR_ABS%$BOOT_DIR} MENU="$BOOT_ROOT/loader/${MACHINE_ID}.cfg" -{ - declare -a paths - len=0 - for path in "$BOOT_ROOT/loader/entries/$MACHINE_ID"-*; do - paths[$((len++))]="$path" - done +readarray -t ENTRIES < <(ls -1 -t "$BOOT_ROOT/loader/entries/$MACHINE_ID"-*) - i=0 - while [[ $len -gt 0 ]]; do - path="${paths[$((--len))]}" - echo "LABEL $((++i))" - echo "INCLUDE ${path#$BOOT_ROOT}" - done +{ + i=0 + for entry in "${ENTRIES[@]}"; do + echo "LABEL $((++i))" + echo "INCLUDE ${entry#$BOOT_ROOT}" + done } > "$MENU" || { echo "Could not create aggregated menu '$MENU'." >&2 exit 1 diff --git a/roles/space_server/tasks/kernel.yml b/roles/space_server/tasks/kernel.yml index 2ab417c..ca80476 100644 --- a/roles/space_server/tasks/kernel.yml +++ b/roles/space_server/tasks/kernel.yml @@ -1,18 +1,14 @@ --- -- name: Make sure /etc/kernel exists - file: - path: '/etc/kernel' - state: directory - owner: root - group: root - mode: 0755 - name: Make sure /etc/kernel/install.d exists file: - path: '/etc/kernel/install.d' + path: '{{ item }}' state: directory owner: root group: root mode: 0755 + with_items: + - '/etc/kernel' + - '/etc/kernel/install.d' - name: Mask grubby file: @@ -20,20 +16,14 @@ state: link src: '/dev/null' -- name: Create syslinux loader entry - copy: - src: kernel/90-loaderentry.install - dest: '/etc/kernel/install.d/90-loaderentry.install' - owner: root - group: root - mode: 0755 -- name: Create syslinux menu +- name: Create syslinux loader entry and menu copy: - src: kernel/95-syslinux-menu.install - dest: '/etc/kernel/install.d/95-syslinux-menu.install' + src: '{{ item }}' + dest: '/etc/kernel/install.d/' owner: root group: root mode: 0755 + with_fileglob: 'kernel/*.install' - name: Set kernel command line template: |