refactor(configuration): extract shared BLS update task to reduce duplication
This commit is contained in:
19
roles/configuration/tasks/_bls_update.yml
Normal file
19
roles/configuration/tasks/_bls_update.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
# Shared task: update BLS (Boot Loader Specification) entries with kernel cmdline.
|
||||
# Expects variable: _bls_cmdline (the kernel command line string)
|
||||
- name: Find BLS entries
|
||||
ansible.builtin.find:
|
||||
paths: /mnt/boot/loader/entries
|
||||
patterns: "*.conf"
|
||||
register: _bls_entries
|
||||
changed_when: false
|
||||
|
||||
- name: Update BLS options
|
||||
when: _bls_entries.files | length > 0
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ item.path }}"
|
||||
regexp: "^options "
|
||||
line: "options {{ _bls_cmdline }}"
|
||||
loop: "{{ _bls_entries.files }}"
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
Reference in New Issue
Block a user