【发布时间】:2019-12-02 21:49:15
【问题描述】:
我想使用 ansible 从以下行中仅删除“fsck.mode=auto”。
foo bar foo.bar=hold fsck.mode=auto foo foo bar foo
主机、root 用户和其他权限在项目的其他位置设置。
如果可能的话,我更喜欢使用 lineinfile 而不是替换。我不想删除整行,而只想删除带有 '' 的正则表达式中的内容。
- name: remove fsck
lineinfile:
dest: /etc/grub2.cfg
regexp: 'fsck.mode=auto'
line: ''
【问题讨论】:
标签: ansible