Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions goad/provider/terraform/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def check(self):

def install(self):
self.command.run_terraform(['init'], self.path)
self.command.run_terraform(['plan'], self.path)
return self.command.run_terraform(['apply'], self.path)
self.command.run_terraform(['plan', '-out=lab.tfplan'], self.path)
return self.command.run_terraform(['apply', 'lab.tfplan'], self.path)

def destroy(self):
return self.command.run_terraform(['destroy'], self.path)
Expand Down
36 changes: 24 additions & 12 deletions scripts/setup_aws.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
#!/bin/bash

# Install git and python3
sudo apt-get update
sudo apt-get install -y git python3-venv python3-pip sshpass
# Install git, pipx, build tools
sudo apt update
sudo apt install -y git pipx build-essential sshpass

#python3 -m venv .venv
#source .venv/bin/activate
# Use pipx to install correct ansible and pywinrm for Python version
pipx ensurepath

# Install ansible and pywinrm
python3 -m pip install --upgrade pip
python3 -m pip install ansible-core==2.12.6
python3 -m pip install pywinrm
# Get the Python version (removes 'Python' from output)
version=$(python3 --version 2>&1 | awk '{print $2}')
echo "Python version in use : $version"
# Convert the version to comparable format (removes the dot and treats it as an integer)
version_numeric=$(echo $version | awk -F. '{printf "%d%02d%02d\n", $1, $2, $3}')

# Install the required ansible libraries
/home/goad/.local/bin/ansible-galaxy install -r /home/goad/GOAD/ansible/requirements.yml
if [ "$version_numeric" -lt 31100 ]; then
# python version < 3.11
pipx install pip install ansible-core==2.12.6
pipx inject ansible-core pywinrm
# Install the required ansible libraries
/home/goad/.local/bin/ansible-galaxy install -r /home/goad/GOAD/ansible/requirements.yml
else
# python version >= 3.11
pipx install pip install ansible-core==2.18.0
pipx inject ansible-core pywinrm
# Install the required ansible libraries
/home/goad/.local/bin/ansible-galaxy install -r /home/goad/GOAD/ansible/requirements_311.yml
fi

# set color
sudo sed -i '/force_color_prompt=yes/s/^#//g' /home/*/.bashrc
sudo sed -i '/force_color_prompt=yes/s/^#//g' /root/.bashrc
sudo sed -i '/force_color_prompt=yes/s/^#//g' /root/.bashrc
36 changes: 24 additions & 12 deletions scripts/setup_azure.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
#!/bin/bash

# Install git and python3
sudo apt-get update
sudo apt-get install -y git python3-venv python3-pip sshpass
# Install git, pipx, build tools
sudo apt update
sudo apt install -y git pipx build-essential sshpass

#python3 -m venv .venv
#source .venv/bin/activate
# Use pipx to install correct ansible and pywinrm for Python version
pipx ensurepath

# Install ansible and pywinrm
python3 -m pip install --upgrade pip
python3 -m pip install ansible-core==2.12.6
python3 -m pip install pywinrm
# Get the Python version (removes 'Python' from output)
version=$(python3 --version 2>&1 | awk '{print $2}')
echo "Python version in use : $version"
# Convert the version to comparable format (removes the dot and treats it as an integer)
version_numeric=$(echo $version | awk -F. '{printf "%d%02d%02d\n", $1, $2, $3}')

# Install the required ansible libraries
/home/goad/.local/bin/ansible-galaxy install -r /home/goad/GOAD/ansible/requirements.yml
if [ "$version_numeric" -lt 31100 ]; then
# python version < 3.11
pipx install pip install ansible-core==2.12.6
pipx inject ansible-core pywinrm
# Install the required ansible libraries
/home/goad/.local/bin/ansible-galaxy install -r /home/goad/GOAD/ansible/requirements.yml
else
# python version >= 3.11
pipx install pip install ansible-core==2.18.0
pipx inject ansible-core pywinrm
# Install the required ansible libraries
/home/goad/.local/bin/ansible-galaxy install -r /home/goad/GOAD/ansible/requirements_311.yml
fi

# set color
sudo sed -i '/force_color_prompt=yes/s/^#//g' /home/*/.bashrc
sudo sed -i '/force_color_prompt=yes/s/^#//g' /root/.bashrc
sudo sed -i '/force_color_prompt=yes/s/^#//g' /root/.bashrc