@@ -259,12 +259,6 @@ function install_ansible-language-server() {
|
||||
sudo npm -s -g i yaml-language-server --force
|
||||
}
|
||||
|
||||
function install_meraki_ansible() {
|
||||
# Install python, ansible module for meraki
|
||||
ansible-galaxy collection install cisco.meraki --force
|
||||
$pip install meraki $PIPEXT
|
||||
}
|
||||
|
||||
function install_azure_cli() {
|
||||
# Install azure_cli
|
||||
$install azure-cli
|
||||
@@ -275,11 +269,6 @@ function install_awscli() {
|
||||
$install awscli
|
||||
}
|
||||
|
||||
function install_aws_adfs() {
|
||||
# Install aws-adfs
|
||||
$pip install aws-adfs $PIPEXTPRE
|
||||
}
|
||||
|
||||
function install_ytdlp() {
|
||||
# Install yt-dlp
|
||||
$pip install yt-dlp $PIPEXTPRE
|
||||
@@ -444,11 +433,6 @@ function install_tss_client() {
|
||||
fi
|
||||
}
|
||||
|
||||
function install_taplo() {
|
||||
# Install taplo
|
||||
$install taplo
|
||||
}
|
||||
|
||||
function install_precommit() {
|
||||
# Install pre-commit
|
||||
$pip install pre-commit $PIPEXTPRE
|
||||
@@ -610,18 +594,15 @@ function main() {
|
||||
command_start install_terragrunt
|
||||
command_start install_azure_cli
|
||||
command_start install_ansible
|
||||
command_start install_meraki_ansible
|
||||
command_start install_ansible-language-server
|
||||
command_start install_ytdlp
|
||||
command_start install_spotifydl
|
||||
command_start install_awscli
|
||||
command_start install_aws_adfs
|
||||
command_start install_speedtest
|
||||
command_start install_gh_cli
|
||||
command_start install_kubernetes
|
||||
command_start install_rust
|
||||
command_start install_tss_client "1.5.9"
|
||||
command_start install_taplo
|
||||
command_start install_precommit
|
||||
command_start install_streamlink
|
||||
command_start install_fzf
|
||||
@@ -631,7 +612,6 @@ function main() {
|
||||
command_start install_font_terminess
|
||||
command_start install_zsh_addons
|
||||
command_start install_brew_programs
|
||||
command_start update_zsh
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
+46
-4
@@ -2,8 +2,8 @@
|
||||
|
||||
source "$HOME"/.local/bin/functions
|
||||
|
||||
# Function for creating a python env
|
||||
python_env(){
|
||||
# Base function for creating a python venv
|
||||
python_env_base() {
|
||||
|
||||
[ -z "$PYTHONVERSION" ] && err "Python version is not set"
|
||||
|
||||
@@ -14,7 +14,49 @@ python_env(){
|
||||
virtualenv -p "$PYTHONVERSION" .venv
|
||||
|
||||
.venv/bin/python -m pip install --upgrade pip
|
||||
.venv/bin/pip install -r requirements.txt --break --force
|
||||
.venv/bin/pip install pre-commit --break --force
|
||||
}
|
||||
|
||||
python_env "$@"
|
||||
# Default python env with requirements.txt
|
||||
python_env() {
|
||||
python_env_base
|
||||
if [ -f requirements.txt ]; then
|
||||
.venv/bin/pip install -r requirements.txt --break --force
|
||||
timestamp "Installing Python packages from requirements.txt"
|
||||
fi
|
||||
}
|
||||
|
||||
# Ansible python env
|
||||
python_env_ansible() {
|
||||
python_env_base
|
||||
timestamp "Installing Ansible packages"
|
||||
.venv/bin/pip install \
|
||||
ansible \
|
||||
ansible-core \
|
||||
ansible-lint \
|
||||
ansible-parallel \
|
||||
passlib \
|
||||
python-tss-sdk \
|
||||
--break --force
|
||||
|
||||
export ANSIBLE_COLLECTIONS_PATH=".venv/collections"
|
||||
export ANSIBLE_ROLES_PATH=".venv/roles"
|
||||
|
||||
timestamp "Installing Ansible Galaxy collections to .venv/collections"
|
||||
.venv/bin/ansible-galaxy collection install community.general -p .venv/collections --upgrade
|
||||
|
||||
timestamp "Installing Ansible Galaxy roles from requirements.yml files to .venv/roles"
|
||||
find . -maxdepth 3 -name "requirements.yml" -path "*/roles/*" -not -path "./.venv/*" -print0 | while IFS= read -r -d '' req; do
|
||||
timestamp "Found requirements: $req"
|
||||
.venv/bin/ansible-galaxy install --force -r "$req" -p .venv/roles
|
||||
done
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
ansible)
|
||||
python_env_ansible
|
||||
;;
|
||||
*)
|
||||
python_env
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user