forked from msvsphere/cloud-images
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.2 KiB
53 lines
1.2 KiB
1 year ago
|
---
|
||
|
- name: Get root partition UUID
|
||
|
ansible.builtin.command: findmnt / -o UUID -n
|
||
|
changed_when: false
|
||
|
register: root_uuid
|
||
|
|
||
|
- name: Get default boot record title
|
||
|
ansible.builtin.command: grubby --default-title
|
||
|
changed_when: false
|
||
|
register: grub_rec_title
|
||
|
|
||
|
- name: Get default kernel path
|
||
|
ansible.builtin.command: grubby --default-kernel
|
||
|
changed_when: false
|
||
|
register: grub_kernel_path
|
||
|
|
||
|
- name: Get default initrd path
|
||
|
ansible.builtin.shell: grubby --info=DEFAULT | grep initrd | grep -oP 'initrd="\K\S+?.img'
|
||
|
changed_when: false
|
||
|
register: grub_initrd_path
|
||
|
|
||
|
- name: Create /boot/grub directory
|
||
|
ansible.builtin.file:
|
||
|
path: /boot/grub
|
||
|
state: directory
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0755
|
||
|
|
||
|
- name: Render /boot/grub/grub.conf
|
||
|
ansible.builtin.template:
|
||
|
src: grub.conf.j2
|
||
|
dest: /boot/grub/grub.conf
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0644
|
||
|
|
||
|
- name: Create /boot/grub/menu.lst symlink
|
||
|
ansible.builtin.file:
|
||
|
src: grub.conf
|
||
|
dest: /boot/grub/menu.lst
|
||
|
owner: root
|
||
|
group: root
|
||
|
state: link
|
||
|
|
||
|
- name: Create /etc/grub.conf symlink
|
||
|
ansible.builtin.file:
|
||
|
src: /boot/grub/grub.conf
|
||
|
dest: /etc/grub.conf
|
||
|
owner: root
|
||
|
group: root
|
||
|
state: link
|