Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace crypttab with lineinfile #228

Merged
merged 3 commits into from
Oct 3, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions tasks/main-blivet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,9 @@
# Manage /etc/crypttab
#
- name: Manage /etc/crypttab to account for changes we just made
crypttab:
name: "{{ entry.name }}"
backing_device: "{{ entry.backing_device }}"
password: "{{ entry.password }}"
lineinfile:
Copy link
Contributor Author

@spetrosi spetrosi Sep 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dwlehman, do you know if we can use the cryptsetup command for this? I didn't find a way to set password via it, and the crypttab module simply handles the config file, so I ended up using lineinfile, but maybe you can help.
The current solution with the lineinfile module works in tests_luks* consistently.
Thank you

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I can tell - the cryptsetup command is used for modifying the runtime configuration, not the persistent configuration - it doesn't modify /etc/crypttab - the crypttab module only modifies the persistent configuration, it does not modify the runtime configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the changes I made good to go then?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the changes I made good to go then?

I think so - let's see if we can get some better test results.

[citest]

path: /etc/crypttab
line: "{{ entry.name }} {{ entry.backing_device }} {{ entry.password }}"
state: "{{ entry.state }}"
spetrosi marked this conversation as resolved.
Show resolved Hide resolved
loop: "{{ blivet_output.crypts }}"
loop_control:
Expand Down