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

correct clevis askpass unit conditional #81

Merged

Conversation

headwest
Copy link
Contributor

A bug was introduced in PR Add default clevis luks askpass unit #79 which silently fails to configure the clevis askpass unit correctly on RHEL 8.2 and 8.3 with certain versions of the clevis-systemd package installed. This PR fixes it by changing the conditional such that if the clevis-luks-askpass.path service exists, it is enabled. If it doesn't exist, then a version of clevis-systemd that uses templated units is installed, and the unit will be enabled by dracut. Tests have been successful with templated, and static clevis-luks-askpass.path units.

when: ansible_distribution != "RedHat" or
(not ansible_distribution_version is version("8.2", "==") and
not ansible_distribution_version is version("8.3", "=="))
when: ansible_facts.services['clevis-luks-askpass.service'] is defined
Copy link
Contributor

Choose a reason for hiding this comment

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

@sergio-correia is this service created when you install the clevis RPM packages? If so, then this looks correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to dnf the service is provided by clevis-systemd.

[root@mt-test01 ~]# dnf whatprovides "/usr/*/clevis-luks-askpass*"
Updating Subscription Management repositories.
Last metadata expiration check: 0:09:53 ago on Fri 30 Sep 2022 08:16:08 PM UTC.
clevis-systemd-11-2.el8.x86_64 : systemd integration for clevis
Repo        : rhel-8-for-x86_64-appstream-rpms
Matched from:
Filename    : /usr/lib/systemd/system/clevis-luks-askpass.path
Filename    : /usr/lib/systemd/system/clevis-luks-askpass.service
Filename    : /usr/libexec/clevis-luks-askpass

clevis-systemd-11-9.el8.x86_64 : systemd integration for clevis
Repo        : rhel-8-for-x86_64-appstream-rpms
Matched from:
Filename    : /usr/lib/systemd/system/[email protected]
Filename    : /usr/lib/systemd/system/[email protected]
Filename    : /usr/libexec/clevis-luks-askpass

...

clevis-systemd-15-8.el8.x86_64 : systemd integration for clevis
Repo        : rhel-8-for-x86_64-appstream-rpms
Matched from:
Filename    : /usr/lib/systemd/system/clevis-luks-askpass.path
Filename    : /usr/lib/systemd/system/clevis-luks-askpass.service
Filename    : /usr/libexec/clevis-luks-askpass

Copy link
Member

Choose a reason for hiding this comment

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

@sergio-correia is this service created when you install the clevis RPM packages? If so, then this looks correct.

Yeah, it's installed by the clevis-systemd package. And I agree it looks correct.

@richm
Copy link
Contributor

richm commented Oct 3, 2022

[citest]

Copy link
Member

@sergio-correia sergio-correia left a comment

Choose a reason for hiding this comment

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

Thanks, this looks good to me.

@richm richm merged commit e0b5c30 into linux-system-roles:master Oct 3, 2022
@headwest headwest deleted the correct-clevis-askpass-unit branch October 3, 2022 19:01
richm added a commit to richm/linux-system-roles-nbde_client that referenced this pull request Nov 1, 2022
[1.2.7] - 2022-11-01
--------------------

### New Features

- none

### Bug Fixes

- correct clevis askpass unit conditional (linux-system-roles#81)

- Add default clevis luks askpass unit (linux-system-roles#79)

skip clevis askpass systemd unit for RHEL 8.2 and 8.3

- use no_log: true where secrets might be revealed

### Other Changes

- fix test tmp files (linux-system-roles#80)

tests - use generated temp directory for all controller files

If you run multiple tests in parallel, some of the tests could overwrite
or remove files in use by other tests on the controller.  Use a
temp directory for controller files.

- test support for CentOS Stream 9

Signed-off-by: Rich Megginson <[email protected]>
richm added a commit that referenced this pull request Nov 1, 2022
[1.2.7] - 2022-11-01
--------------------

### New Features

- none

### Bug Fixes

- correct clevis askpass unit conditional (#81)

- Add default clevis luks askpass unit (#79)

skip clevis askpass systemd unit for RHEL 8.2 and 8.3

- use no_log: true where secrets might be revealed

### Other Changes

- fix test tmp files (#80)

tests - use generated temp directory for all controller files

If you run multiple tests in parallel, some of the tests could overwrite
or remove files in use by other tests on the controller.  Use a
temp directory for controller files.

- test support for CentOS Stream 9

Signed-off-by: Rich Megginson <[email protected]>

Signed-off-by: Rich Megginson <[email protected]>
@richm richm mentioned this pull request Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants