Compare commits
No commits in common. "924341a2765b2c875dac2708333dd8a52b0a55f1" and "9cd0cfcb4ff922f559cd962d65a9847a0767dc39" have entirely different histories.
924341a276
...
9cd0cfcb4f
2
.env
2
.env
@ -1,2 +0,0 @@
|
|||||||
ANSIBLE_COLLECTIONS_PATH=$(pwd)/.ansible
|
|
||||||
ANSIBLE_INVENTORY=$(pwd)/inventory.yaml
|
|
8
Makefile
8
Makefile
@ -2,7 +2,7 @@ clean:
|
|||||||
rm --recursive --force .ansible/
|
rm --recursive --force .ansible/
|
||||||
|
|
||||||
dev:
|
dev:
|
||||||
@poetry install --remove-untracked
|
poetry install --remove-untracked
|
||||||
@poetry run pre-commit install
|
poetry run pre-commit install
|
||||||
@poetry run ansible-galaxy collection install --requirements-file ./requirements.yaml --collections-path ./.ansible
|
poetry run ansible-galaxy collection install --requirements-file ./requirements.yaml --collections-path ./.ansible
|
||||||
@bash ./link-local-collections.sh
|
./dynamically-link-local-collections.bash
|
||||||
|
12
README.md
12
README.md
@ -2,15 +2,11 @@
|
|||||||
|
|
||||||
Ansible configs for the Skylab Homelab
|
Ansible configs for the Skylab Homelab
|
||||||
|
|
||||||
## Local workstation setup:
|
Main entrypoint is through the `ansible` script in this repository. The script sets up
|
||||||
|
basic environment variables to avoid conflicts with other environments and sets the
|
||||||
|
inventory.
|
||||||
|
|
||||||
```bash
|
Bootstrap checklist:
|
||||||
make dev
|
|
||||||
poetry shell
|
|
||||||
source .env
|
|
||||||
```
|
|
||||||
|
|
||||||
## Boostraping remote system for management:
|
|
||||||
|
|
||||||
1. Install a supported operating system: [Rocky Linux](https://rockylinux.org)
|
1. Install a supported operating system: [Rocky Linux](https://rockylinux.org)
|
||||||
2. During installation create a user named `ansible` with any password
|
2. During installation create a user named `ansible` with any password
|
||||||
|
5
ansible
Executable file
5
ansible
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
ANSIBLE_COLLECTIONS_PATH=$(pwd)/.ansible \
|
||||||
|
ANSIBLE_INVENTORY=$(pwd)/inventory.yaml \
|
||||||
|
"ansible-$1" "${@:2}"
|
@ -15,14 +15,4 @@ for collection_path in "$PWD"/"$ANSIBLE_NAMESPACE"/*; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Finished linking local collections"
|
echo "Done!"
|
||||||
|
|
||||||
LOCAL_COLLECTION_PATH=$(dirname "$ANSIBLE_COLLECTION_DIR")
|
|
||||||
|
|
||||||
if [ -z ${ANSIBLE_COLLECTIONS_PATH+x} ]; then
|
|
||||||
echo "WARNING: Environment variable ANSIBLE_COLLECTIONS_PATH is not set, collections will not be callable"
|
|
||||||
echo " HINT: export ANSIBLE_COLLECTIONS_PATH=$LOCAL_COLLECTION_PATH"
|
|
||||||
elif [[ ${ANSIBLE_COLLECTIONS_PATH} != *"$LOCAL_COLLECTION_PATH"* ]]; then
|
|
||||||
echo "WARNING: Environment variable ANSIBLE_COLLECTIONS_PATH does not include local collection directory"
|
|
||||||
echo " HINT: export ANSIBLE_COLLECTIONS_PATH=\$ANSIBLE_COLLECTIONS_PATH:$LOCAL_COLLECTION_PATH"
|
|
||||||
fi
|
|
Reference in New Issue
Block a user