MacOS: Please start with MacOS required packages.
The machine provisioner requires some basic packages. If your using ubuntu >= 20.04, you can follow along with the "Usage" section. On other operating system, i.e. MacOS, please satisfy the following requirements manually:
- python >= 3.10
- pip >= 20.3
- pip3 >= 20.3
- git
- vim
Important The command python3
needs to point to the python-executable for Python >= 3.10, python
might not work.
sudo apt update
sudo apt install -y software-properties-common git vim python3 python3-pip python-is-python3
cd ~
As preparation you need to install 1password CLI and be able to login. Follow the instructions here: https://developer.1password.com/docs/cli/get-started
After following the instructions you should be able to run
op vault list
and see a list of your vaults.
For newer Ubuntu versions (>=24.04) you need to allow pip to install global packages:
sudo -H pip3 config --global set global.break-system-packages true
git clone https://github.com/modell-aachen/modac-dev-machine-setup.git
For development users
cp $HOME/modac-dev-machine-setup/provisioning/inventory_custom_example.yml $HOME/.inventory_local.yml
For service users
cp $HOME/modac-dev-machine-setup/provisioning/inventory_service_example.yml $HOME/.inventory_local.yml
vim $HOME/.inventory_local.yml
- remove unused packages and snaps, insert your keys, e.g.
- create a local ssh key and set as SSH key to your GitHub Account (https://github.com/settings/keys)
- check successfull authentication against github.com
ssh -T [email protected]
- create a directory for your repositories and set REPOS_DIRECTORY to the created path
- set NEXUS_BOT_TOKEN to the value of 1Password entry at https://start.1password.com/open/i?a=CXJNQFCHNNGSLNOEP6SLPHLZQ4&v=3mhbwhicfwkifyq7bc2nrnhywa&i=32jtgjyel43vabz2wbukslo5bq&h=modac.1password.eu
- set GITHUB_AUTH_TOKEN to the value of 1Password entry at https://start.1password.com/open/i?a=CXJNQFCHNNGSLNOEP6SLPHLZQ4&h=modac.1password.eu&i=dwpktyrfuj6cyjfy6y74q3ifiy&v=6u4nznoclnkg7467ne4ntutcgq
- set FONTAWESOME_NPM_AUTH_TOKEN to the value of 1Password entry at https://start.1password.com/open/i?a=CXJNQFCHNNGSLNOEP6SLPHLZQ4&h=modac.1password.eu&i=xmhedekcuokrqrch62bsuvr5lu&v=6u4nznoclnkg7467ne4ntutcgq
- set FONTAWESOME_NEXUS_AUTH_TOKEN to the value of 1Password entry at https://start.1password.com/open/i?a=CXJNQFCHNNGSLNOEP6SLPHLZQ4&v=6u4nznoclnkg7467ne4ntutcgq&i=5xls52q24au3eie2itucvc635u&h=modac.1password.eu
- set HARBOR_USERNAME to your modac mail address
- set HARBOR_PASSWORD to your CLI token (https://harbor.modac.cloud -> Login -> user profile [top right corner] -> User Profile -> CLI secret)
cd $HOME/modac-dev-machine-setup/
./dev-provision -i ~/.inventory_local.yml
After that open up a new terminal to have an updated PATH with all the tools available.
Update your $HOME/.inventory_local.yml
:
machine edit-config
Apply updates:
machine provision
Source: https://stackoverflow.com/questions/12940626/github-error-message-permission-denied-publickey Solution: Write that before starting the script
ssh-agent -s
ssh-add ~/.ssh/id_rsa
Local Q.wiki (e.g. dev.modac) can't be resolved ( < Ubuntu 21.04 only):
sudo systemctl restart lxd-host-dns.service
If you use zsh, source .env
and bashrc.sh
in your .zshrc
[ -f $HOME/.env ] && source $HOME/.env
[ -f $HOME/.modac-bash/bashrc.sh ] && source $HOME/.modac-bash/bashrc.sh
The docker task requires a system restart. If any succeeding docker-related tasks fail (kubectl, calico, etc.) try restarting the system
and the provisioning process (machine provision
).
The calico task can fail because of an incompatibility issue:
Workaround:
apt-cache policy docker-ce | grep 24.0.7
Use the printed version (e.g. 5:24.0.7-1ubuntu.22.04jammy) to ...
sudo apt install docker-ce=*VERSION*