Testing¶
Testing Using Docker¶
Launch into a shell in a Debian Docker container.
In the Docker container.
cd ~ && \
apt update && \
apt install curl -y && \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/nicholaswilde/homelab-pull/refs/heads/main/scripts/bootstrap.sh)" && \
export PATH=$PATH:$HOME/.local/bin
Test the playbook.
Testing with a Specific Branch¶
To test changes from a specific branch before they are merged into main
, you can modify the ansible-pull
command to target that branch.
-
Identify the branch name: For example,
my-feature-branch
. -
Modify the
ansible-pull
command:Change the URL in the
ansible-pull
command fromhttps://github.com/nicholaswilde/homelab-pull.git
(which defaults to themain
branch) to point to your specific branch using the-C
or--checkout
option, or by specifying the branch in the URL if youransible-pull
version supports it directly for playbook repositories (though-C
is more standard for specifying a branch).Using
-C
(checkout) option (recommended): This tellsansible-pull
to checkout the specified branch after cloning.ansible-pull -U https://github.com/nicholaswilde/homelab-pull.git -C my-feature-branch -i "$(uname -n),"
Replace
my-feature-branch
with the actual name of your branch. -
Bootstrap Script (if applicable for new setups): If you are bootstrapping a new node and want it to use a specific branch from the start for the initial
requirements.yaml
and scripts, you would need to modify the URLs within the bootstrap script itself before running it. For example, changingrefs/heads/main
torefs/heads/my-feature-branch
in the script's URL paths:And similarly for theOWNER_NAME="nicholaswilde" REPO_NAME="homelab-pull" BRANCH_NAME="my-feature-branch" # Specify your branch # ... bash -c "$(curl -fsSL https://raw.githubusercontent.com/${OWNER_NAME}/${REPO_NAME}/refs/heads/${BRANCH_NAME}/scripts/bootstrap.sh)"
REQUIREMENTS_URL
inside the script if it's hardcoded, or ensure youransible-pull
command used post-bootstrap points to the correct branch. Theansible-pull
command shown above is the primary way to control the playbook branch after initial setup.
This allows you to test your changes in isolation on one or more managed nodes before merging to main
.