Skip to content

Commit 949977d

Browse files
committedSep 17, 2024
add shell command for vagrant and virtualbox automation
1 parent 8062cc7 commit 949977d

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed
 

‎g

2.81 KB
Binary file not shown.

‎scripts/install_vagrant.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg &&
2+
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list &&
3+
sudo apt-get update && sudo apt install vagrant

‎scripts/install_virtual_box.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sudo apt-get install virtualbox

‎start.sh

+14-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44

55
function usage(){
66

7-
cat <<EOF
7+
cat <<EOF
88
99
Usage: $(basename "$0") [options] <argument>
1010
@@ -85,9 +85,21 @@ else
8585
fi
8686

8787
## install required collections
88+
#!/bin/bash
89+
90+
# Check if Vagrant is installed
91+
if command -v vagrant &> /dev/null
92+
then
93+
echo "Vagrant is installed"
94+
vagrant --version
95+
else
96+
sh scripts/install_vagrant.sh
97+
fi
98+
99+
sh scripts/install_virtual_box.sh
88100
ansible-galaxy collection install -r requirements.yml
89101

90-
## provision the server
102+
# provision the server
91103
if [ -z "$STACK_SERVER"]; then
92104
lint_vagrant
93105
vagrant up

0 commit comments

Comments
 (0)
Please sign in to comment.