Proof of concept to use --target within the wrapper script to allow m… - #693
Draft
ehelms wants to merge 1 commit into
Draft
Proof of concept to use --target within the wrapper script to allow m…#693ehelms wants to merge 1 commit into
ehelms wants to merge 1 commit into
Conversation
…ulti-host management
ekohl
reviewed
Jul 22, 2026
| } | ||
|
|
||
| # Extract --target before obsah sees the arguments | ||
| TARGET="" |
Member
There was a problem hiding this comment.
Why clear the value? If you keep it empty you can also use
export TARGET=myserverAnd then keep using anvil without remembering the target the whole time.
Suggested change
| TARGET="" |
Comment on lines
+55
to
+61
| *) | ||
| ARGS+=("$1") | ||
| shift | ||
| ;; | ||
| esac | ||
| done | ||
| set -- "${ARGS[@]}" |
Member
There was a problem hiding this comment.
Why is this needed? I don't think I've ever needed it. Isn't it safe to just drop that?
Suggested change
| *) | |
| ARGS+=("$1") | |
| shift | |
| ;; | |
| esac | |
| done | |
| set -- "${ARGS[@]}" | |
| esac | |
| done |
Comment on lines
+72
to
+96
| OBSAH_STATE=${OBSAH_BASE}/.var/lib/anvil/server/${TARGET} | ||
| else | ||
| OBSAH_STATE=${OBSAH_BASE}/.var/lib/anvil/server | ||
| fi | ||
| ANSIBLE_LOG_PATH=${OBSAH_STATE}/anvil.log | ||
| export ANSIBLE_LOG_PATH | ||
| unset http_proxy HTTP_PROXY https_proxy HTTPS_PROXY | ||
| ;; | ||
| deploy-proxy) | ||
| OBSAH_DATA=${OBSAH_BASE}/src | ||
| if [[ -n "$TARGET" ]]; then | ||
| OBSAH_STATE=${OBSAH_BASE}/.var/lib/anvil/proxy/${TARGET} | ||
| else | ||
| OBSAH_STATE=${OBSAH_BASE}/.var/lib/anvil/proxy | ||
| fi | ||
| ANSIBLE_LOG_PATH=${OBSAH_STATE}/anvil.log | ||
| export ANSIBLE_LOG_PATH | ||
| unset http_proxy HTTP_PROXY https_proxy HTTPS_PROXY | ||
| ;; | ||
| deploy-dev|vms|test|smoker|custom-certs|fetch-bundle|security|sos|lock) | ||
| OBSAH_DATA=${OBSAH_BASE}/development | ||
| if [[ -n "$TARGET" ]]; then | ||
| OBSAH_STATE=${OBSAH_BASE}/.var/lib/anvil/dev/${TARGET} | ||
| else | ||
| OBSAH_STATE=${OBSAH_BASE}/.var/lib/anvil/dev |
Member
There was a problem hiding this comment.
Given the repetition, perhaps define ANVIL_BASE=${OBSAH_BASE}/.var/lib/anvil and reuse that?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a proof of concept of the idea of using a wrapper script to handle multi-host management with the state management restrictions as described in #630.
The general idea is put the
--targetinto the wrapper script and use that to dynamically set the state directory based upon the target's value.