We leverage pipx to ensure that all programs and librarys we depend on can be installed globally and isolated with venvs out of the box. It's also supported by MacOS, Linux, and Windows.
brew install pipx
apt install pipx
pipx install ansible-core
pipx inject ansible-core requests pynetbox pyutils pytz netaddr
pipx install ansible-lint
pipx install --include-deps ansible-sign
pipx install --include-deps molecule
pipx ensurepath
You can either log out of the shell and log back in or run the following command to refresh your PATH
source ~/.bashrc
or
source ~/.zshrc
On the DeEEP Device - the main Ansible Controller is the Device itself which in turn can manage the VM's (via Incus). Each VM is also an independent Ansible Controller for itself. This setup requires every role to be localhost
first when developed. This isn't the normal way Ansible is meant to be used (push model) so there are some gotchas and things we do that are slightly out of the norm. Being localhost
first however provides the VMs the ability to configure themselves when necessary. It's also important to not that if it works via localhost
it will always work being pushed (not always the case in reverse).
[!NOTE] For testing, we skip the Incus layer. Meaning the Ansible Controller for tests is your local machine (acting like the Device). Pushing directly to the VM running locally (managed by Orbstack, multipass, KVM, or LXD). This is meant to simplify the testing process. Especially since MacOS support for intel based CPU architecture is not well supported.
As such, depending on your development environment pick the most convenient virtualization software. Usually based on OS and CPU
orbstack - docs
brew install orbstack
multipass - docs
brew install --cask multipass
snap install multipass
UTM - docs
brew install --cask utm
-
set the
MOLECULE_SUBSTRATE
environment variable to the one of your choiceIf you've already ran molecule before updating this variable you may need to use
molecule destroy
ormolecule reset
for it to take effect -
Setup Pulumi ESC
-
Install Pulumi ESC
-
Install Direnv
-
Login to Pulumi ESC - request access to
deeep-network/dev/services
(DM @anthonyra) -
run
direnv allow .
in root directory
-
-
test all services
molecule converge
-
test an individual service
molecule converge -- -e='fqcn=test' molecule converge -- -e='fqcn=depin.services.test'
-
test all libs
molecule converge -s libs
-
test an individual lib
molecule converge -s libs -- -e='fqcn=test' molecule converge -s libs -- -e='fqcn=depin.libs.test'