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

Notify gpg --import resources when key files change. #96

Open
wants to merge 1 commit into
base: latest
Choose a base branch
from

Conversation

nuclearsandwich
Copy link
Collaborator

This patch improves configuration behavior when key contents change.
When deploying changes to the public key, the keys on disk were updated
but the gpg keyring did not import the new keys since existing keys were
present.

Now, changes to the file resources will trigger runs of the import
execute resources which will provide the same behavior as before for
a freshly provisioned host but will correctly re-import keys when those
files change.

@nuclearsandwich nuclearsandwich self-assigned this Jun 3, 2021
@nuclearsandwich
Copy link
Collaborator Author

CI failure is exposing a failed GPG import so I must have missed something here.

@nuclearsandwich
Copy link
Collaborator Author

CI failure is exposing a failed GPG import so I must have missed something here.

Okay I've figured out what's happening. There are two identically named execute resources, one for the Jenkins agent and one for the pulp user, and the notifies added to the file[/var/repos/repos.key] resources is triggering both of them but the latter is failing because the pulp user and group does not exist yet.

Naively I think there are two ways out of this, moving the pulp user creation resoures above all gpg related file resources, or changing the pulp import and trust resources to target their own copy of the file on disk which is changed later in the recipe when the prerequisite resources have already converged.

@nuclearsandwich
Copy link
Collaborator Author

I think this will be revisit-able once pulp is removed.

This patch improves configuration behavior when key contents change.
When deploying changes to the public key, the keys on disk were updated
but the gpg keyring did not import the new keys since existing keys were
present.

Now, changes to the file resources will trigger runs of the import
execute resources which will provide the same behavior as before for
a freshly provisioned host but will correctly re-import keys when those
files change.
@nuclearsandwich
Copy link
Collaborator Author

This is now updated and ready for review with pulp removed.

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.

1 participant