22 lines
578 B
YAML
22 lines
578 B
YAML
|
---
|
||
|
- name: "Look for parameter {{ item.key }}"
|
||
|
ansible.builtin.shell:
|
||
|
cmd: 'grep "^GRUB_CMDLINE_LINUX=.*{{ item.key }}={{ item.value }}" /etc/default/grub || true'
|
||
|
changed_when: False
|
||
|
register: grub_cmdline_find_param
|
||
|
|
||
|
|
||
|
- name: "Add {{ item.key }}={{ item.value }}"
|
||
|
ansible.builtin.lineinfile:
|
||
|
path: /etc/default/grub
|
||
|
line: 'GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} {{ item.key }}={{ item.value }}"'
|
||
|
insertafter: '^GRUB_CMDLINE_LINUX='
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0644
|
||
|
backup: yes
|
||
|
notify:
|
||
|
- "update-grub for cmdlineparameter"
|
||
|
|
||
|
|