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

Restart k3s service unit on file change #28

Merged
merged 1 commit into from
Jun 6, 2020

Conversation

pedrohdz
Copy link

The K3s service on the control node is not being restarted when there is a change.

@pedrohdz
Copy link
Author

I THINK I know what I need to do to fix this. I will try and get back to it later.

@xanmanning xanmanning self-requested a review May 30, 2020 13:22
@xanmanning xanmanning self-assigned this May 30, 2020
@pedrohdz
Copy link
Author

@xanmanning
So please keep in mind that I am an Ansible noob. I'm not sure if my fix is legit, but it feels hacky to be honest.

I'm open to suggestions. Let's see if the tests pass or course!

@xanmanning
Copy link
Member

Hi @pedrohdz , I'll wait until the tests have run and either way I'll take a look at the implementation.

msg: Notify restart k3s
notify:
- restart k3s
when: k3s_service_unit.changed # noqa 503
Copy link
Member

Choose a reason for hiding this comment

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

Yes, this is a bit hacky. Still having a bit of a look and I might be able to come up with something, though it does seem to pass testing.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for taking a look. I'm open to ideas.

xanmanning added a commit that referenced this pull request May 31, 2020
@xanmanning
Copy link
Member

Does this work for you @pedrohdz ? The issue with the service not restarting at the point required is due to the k3s binary not existing on the control node (it's downloaded but not symlinked to the right location). There's a bit of duplication but it would allow the service to start I believe.

@pedrohdz
Copy link
Author

I think it will. Should my hack be removed then? I won't be able to test this until later this week, sorry.

@xanmanning
Copy link
Member

Don't worry about when you can get round to testing, no rush. I pushed it to your branch for your review, if it doesn't work for you then feel free to revert it.

pedrohdz pushed a commit to pedrohdz/ansible-role-k3s that referenced this pull request Jun 6, 2020
@pedrohdz
Copy link
Author

pedrohdz commented Jun 6, 2020

Your fix works, and is a lot cleaner.

I rewrote the git history to rip out my hack and get rid of the noisy merge information. If you want to pull the control-node-restart-k3s branch locally to get the changes, do a git pull --force.

Assuming my changes pass CI, this should be good to merge.

Thank you for taking the time!

@pedrohdz
Copy link
Author

pedrohdz commented Jun 6, 2020

Tests seem to have passed but the GitHub PR is not showing it for some strange reason.

@xanmanning
Copy link
Member

No worries, thanks for your assistance with this @pedrohdz - I shall merge it in now.

@xanmanning xanmanning merged commit f454334 into PyratLabs:master Jun 6, 2020
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