From d8f5a8fd77199a7115b021c52581a18f845c5800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Tue, 30 Sep 2025 11:59:45 +0300 Subject: [PATCH] Init: Move Ansible to different directory and remove sudo --- init.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/init.sh b/init.sh index 055d5b6..b9d4d31 100755 --- a/init.sh +++ b/init.sh @@ -38,27 +38,27 @@ exit 1 } ti-header "Haetaan pakettien tiedot..." -sudo apt update +apt update echo -e "\n\n" ti-header "Asennetaan Ansiblen järjestelmäpaketti riippuvuudet..." -sudo apt-get install -y python3-pip python3-venv jq git curl lsb-release +apt-get install -y python3-pip python3-venv jq git curl lsb-release echo -e "\n\n" ti-header "Luodaan Ansiblelle virtuaalinen ympäristö..." -python3 -m venv $HOME/.venv/ansible +python3 -m venv /opt/ansible echo -e "\n\n" ti-header "Asennetaan Ansiblen Python-kirjasto riippuvuudet..." -$HOME/.venv/ansible/bin/pip3 install cryptography dnspython hvac jmespath netaddr pexpect +/opt/ansible/bin/pip3 install cryptography dnspython hvac jmespath netaddr pexpect echo -e "\n\n" ti-header "Asennetaan Ansible..." -$HOME/.venv/ansible/bin/pip3 install ansible +/opt/ansible/bin/pip3 install ansible echo -e "\n\n" ti-header "Asennetaan Ansible kokoelmat..." -$HOME/.venv/ansible/bin/ansible-galaxy collection install ansible.posix containers.podman --upgrade +/opt/ansible/bin/ansible-galaxy collection install ansible.posix containers.podman --upgrade echo -e "\n\n" mkdir -p $HOME/.ssh/keys &> /dev/null @@ -97,7 +97,7 @@ then fi ti-header "Suoritetaan Infran asennus..." -$HOME/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/cwchristerw/tjas-infra -d $HOME/.ansible/pull/infra --accept-host-key --private-key $HOME/.ssh/keys/infra --vault-password-file $HOME/.ansible/vault/infra tasks.yml -t installer +/opt/ansible/bin/ansible-pull -U ssh://git@github.com/cwchristerw/tjas-infra -d $HOME/.ansible/pull/infra --accept-host-key --private-key $HOME/.ssh/keys/infra --vault-password-file $HOME/.ansible/vault/infra tasks.yml -t installer echo -e "\n\n" echo "