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

Run a check of the squid configuration before deploying it #44

Merged
merged 2 commits into from
Feb 17, 2024

Conversation

ndf-dw
Copy link
Contributor

@ndf-dw ndf-dw commented Feb 1, 2024

Run a check of the squid configuration before deploying it (and before restarting squid with a faulty configuration)

Description

When restarting squid service, squid will resolve all domain provided in configuration.
If a DNS entry does not exists, squid doesn't restart properly (it stops, and never start because of a faulty configuration).
This patch create a temporary configuration file, and run a check of this temporary configuration file.
If the check is OK, it will simply deploy the new configuration as it used to do.
If the check is KO, ansible will stop the playbook before modifying configuration on server (and before restating squid)

Related Issue

No related issue (except loosing squid service in production! :-/)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

…e restarting squid with a faulty configuration)
@mrlesmithjr
Copy link
Owner

@ndf-dw this is a great thing to add but it doesn’t appear to cleanup the staged file to validate?

@ndf-dw
Copy link
Contributor Author

ndf-dw commented Feb 5, 2024

@ndf-dw this is a great thing to add but it doesn’t appear to cleanup the staged file to validate?

I added a task to cleanup after the check (it won't do the cleanup in case of check failure (but clean will be done once check is ok again))

@mrlesmithjr mrlesmithjr merged commit 51e8c68 into mrlesmithjr:master Feb 17, 2024
1 check 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.

2 participants