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

RouterOS - make deploy more resilient #5245

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

nathanejohnson
Copy link
Contributor

Newer releases of RouterOS automatically delete the cert and key files from disk when importing the certs, and that means the existing deploy will fail when it tries to explicitly remove those files. This still attempts to remove the files but catches the error and moves on instead of bombing like before.

Similarly, if the deploy had failed before but the script was created, subsequent deploys would fail because the script already existed. This first attempts to remove the script if it exists, and then creates the script.

This has been tested on RouterOS 7.15.3 , but I assume this should be backwards compatible, and it's currently broken on later ROS versions for reasons mentioned above.

In the case where importing the cert and key removes the files from disk
the existing deploy will fail when it tries to remove those files.  This
still attempts to remove the files but catches the error and moves on instead
of bombing like before.

Similarly, if the deploy had failed before, subsequent deploys would fail
because the script already existed, so it would not be able to create
the script.  This first attempts to remove the script if it exists, and then
creates the script.
@cngarrison
Copy link
Contributor

I haven't tested on my routers, but code change looks good. 👍

@nathanejohnson
Copy link
Contributor Author

@cngarrison I don't have anything running 6.x unfortunately, but the two 7.x devices I tried it on worked.

@Neilpang Neilpang merged commit bb8386a into acmesh-official:dev Aug 15, 2024
2 checks passed
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