Add token to agents on existing clusters #360
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
#356 introduced a subtle issue for existing clusters where the token is removed from the service unit but not added to the
.env
file unless a version update happens at the same time. By moving the taskAdd the token for joining the cluster to the environment
outside of theblock:
it makes sure it is executed in all cases (a very subtle spacing issue).Issue occurring: https://github.com/nycmeshnet/k8s-infra/actions/runs/10756493721/job/29829415464#step:14:569
Testing fix: https://github.com/nycmeshnet/k8s-infra/actions/runs/10805984455/job/29973976530#step:14:570 - I confirmed the value is now in the
.env
file and our nodes remained active.Thank you for maintaining k3s-ansible, it is nice and easy to use. Also, #356 is good for security, thank you for this.