restore lineinfile method
This commit is contained in:
parent
b826e5519c
commit
afed19e036
@ -1,17 +1,7 @@
|
|||||||
---
|
---
|
||||||
# - name: Cleanup /etc/default/grub to remove fsck
|
- name: Cleanup /etc/default/grub to remove fsck
|
||||||
# ansible.builtin.replace:
|
ansible.builtin.replace:
|
||||||
# path: /etc/default/grub
|
path: /etc/default/grub
|
||||||
# regexp: '(GRUB_CMDLINE_LINUX=".*)\s+(fsck\.mode=force)\s+(fsck.repair=yes)(.*")'
|
regexp: '(GRUB_CMDLINE_LINUX=".*)\s+(fsck\.mode=force)\s+(fsck.repair=yes)(.*")'
|
||||||
# replace: '\1\4'
|
replace: '\1\4'
|
||||||
# notify: Update_Grub
|
notify: Update_Grub
|
||||||
|
|
||||||
- name: Remove fsck args from Grub
|
|
||||||
ansible.builtin.command:
|
|
||||||
cmd: grubby --remove-args="fsck.mode=force fsck.repair=yes" --update-kernel=ALL
|
|
||||||
changed_when: false
|
|
||||||
register: autofsck_grubby_rm_args
|
|
||||||
|
|
||||||
- name: Debug autofsck_grubby_rm_args
|
|
||||||
ansible.builtin.debug:
|
|
||||||
var: autofsck_grubby_rm_args
|
|
||||||
|
@ -1,20 +1,10 @@
|
|||||||
---
|
---
|
||||||
# - name: Configure /etc/default/grub for fsck
|
- name: Configure /etc/default/grub for fsck
|
||||||
# ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
# state: present
|
state: present
|
||||||
# dest: /etc/default/grub
|
dest: /etc/default/grub
|
||||||
# backrefs: true
|
backrefs: true
|
||||||
# regexp: '^(GRUB_CMDLINE_LINUX=(?!.* fsck)\"[^\"]+)(\".*)'
|
regexp: '^(GRUB_CMDLINE_LINUX=(?!.* fsck)\"[^\"]+)(\".*)'
|
||||||
# line: '\1 fsck.mode=force fsck.repair=yes\2'
|
line: '\1 fsck.mode=force fsck.repair=yes\2'
|
||||||
# backup: true
|
backup: true
|
||||||
# notify: Update_Grub
|
notify: Update_Grub
|
||||||
|
|
||||||
- name: Configure Grub args for fsck
|
|
||||||
ansible.builtin.command:
|
|
||||||
cmd: grubby --args="fsck.mode=force fsck.repair=yes" --update-kernel=ALL
|
|
||||||
changed_when: false
|
|
||||||
register: autofsck_grubby_add_args
|
|
||||||
|
|
||||||
- name: Debug autofsck_grubby_add_args
|
|
||||||
ansible.builtin.debug:
|
|
||||||
var: autofsck_grubby_add_args
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user