Skip to content

Commit

Permalink
Remove entries with regexp regardeless of password specified, fix mode
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrosi committed Sep 30, 2021
1 parent acc112e commit ec52403
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tasks/main-blivet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,14 @@
- name: manage /etc/crypttab to account for changes we just made
lineinfile:
path: /etc/crypttab
# The line option is used when `state: present`
line: "{{ entry.name }} {{ entry.backing_device }} {{ entry.password }}"
# The regexp option is used when `state: absent` to remove entries
# regardless of password
regexp: ^{{ entry.name }} {{ entry.backing_device }}
state: "{{ entry.state }}"
create: true
mode: "{{ __storage_crypttab.stat.mode | d('0600') }}"
mode: "{{ __storage_crypttab.stat.mode | d('0644') }}"
owner: "{{ __storage_crypttab.stat.owner | d('root') }}"
group: "{{ __storage_crypttab.stat.group | d('root') }}"
loop: "{{ blivet_output.crypts }}"
Expand Down

0 comments on commit ec52403

Please sign in to comment.