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

ansible: Fix sync-secrets playbook to not clobber s3-keys alias symlinks #608

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

martinpitt
Copy link
Member

The psi/image-cache playbook installs the s3-keys/ symlink for the local S3 mirror on rhos-01-1. But sync-secrets clobbers that (as it always removes the entire existing secrets dir before re-syncing it).

Fix this by factoring out the symlink creation into a nwe "local-s3-alias" role and calling it from both places.


I tested this by first removing the existing symlink /var/lib/cockpit-secrets/tasks/s3-keys/10.0.203.194, then running

ansible-playbook -v -i inventory psi/image-cache.yml

which installed it everywhere. Afterwards I ran

ansible-playbook -v -i inventory maintenance/sync-secrets.yml  -l rhos-01-1

(i.e. the step which previously removed the symlink), and confirmed that it installed it correctly. In a tasks container I can now do

$ ./image-upload --store http://10.0.203.194/images/ cirros
Uploading to http://10.0.203.194/images/cirros-ff4ccf16a162d7d3bf86d30141bd8cfe30821dd3b09712fe2f84d201c8e948af.qcow2

(which previously failed with "no such key", see pilot board)

@martinpitt
Copy link
Member Author

Not sure why the workflows don't start, I just try a force-push.

The psi/image-cache playbook installs the s3-keys/ symlink for the local
S3 mirror on rhos-01-1. But sync-secrets clobbers that (as it always
removes the entire existing secrets dir before re-syncing it).

Fix this by factoring out the symlink creation into a nwe
"local-s3-alias" role and calling it from both places.
Copy link
Member

@allisonkarlitskaya allisonkarlitskaya left a comment

Choose a reason for hiding this comment

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

yeah....
..ml.

@allisonkarlitskaya allisonkarlitskaya merged commit 0edd89e into main Mar 20, 2024
3 checks passed
@allisonkarlitskaya allisonkarlitskaya deleted the s3-image-key branch March 20, 2024 14:09
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.

2 participants