Add option for install behind http_proxy #384
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.
Proposed Changes
Added the option to install from behind an http proxy.
If configured (false by default), it puts your
http_proxy
+https_proxy
+no_proxy
env vars into ak3s(-agent).service.d/http_proxy.conf
file, before anything gets installed.This way k3s can access the internet for images etc through the proxy.
Also added env vars to the playbooks, defaulted to '', so ansible can still download the binaries and manifests even if you're behind a proxy.
In the reset main.yml I thought I'd add a conditional task.
So it doesn't try to remove the http_proxy files and errors out when you don't have them enabled/installed.
(I've ran and re-ran the checks a bunch of times on my fork, not sure what's up with the hosted runners.
The majority of the time it failed with the gurumeditation state error and when it did go past that, it couldn't resolve DNS.
I've ran this both with http_proxy enabled and disabled, installed fine in both environments.)
Checklist
site.yml
playbookreset.yml
playbook