-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
191 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"variables" : { | ||
"ssh_pass" : "gns3", | ||
"ssh_name" : "gns3", | ||
"gns3_version": "{{env `GNS3_VERSION`}}" | ||
"gns3_src": "{{env `GNS3_SRC`}}" | ||
}, | ||
"provisioners" : [ | ||
{ | ||
"inline": "sudo rm -rf /tmp/*", | ||
"type": "shell" | ||
}, | ||
{ | ||
"inline" : "sudo pip3 install gns3-server=={{user `gns3_version`}}", | ||
"type" : "shell" | ||
} | ||
], | ||
"builders" : [ | ||
{ | ||
"type": "vmware-vmx", | ||
"vm_name" : "GNS3 VM", | ||
"headless": true, | ||
"source_path": "{{user `gns3_src`}}", | ||
"ssh_username": "{{user `ssh_name`}}", | ||
"ssh_password": "{{user `ssh_pass`}}", | ||
"shutdown_command" : "echo {{user `ssh_name`}} | sudo -S shutdown -P now", | ||
"vmx_data" : | ||
{ | ||
"ethernet0.connectionType": "nat" | ||
}, | ||
"vmx_data_post": | ||
{ | ||
"ethernet0.connectionType": "hostonly" | ||
} | ||
}, | ||
{ | ||
"type": "virtualbox-ovf", | ||
"vm_name" : "GNS3 VM", | ||
"headless": true, | ||
"source_path": "{{user `gns3_src`}}", | ||
"ssh_username": "{{user `ssh_name`}}", | ||
"ssh_password": "{{user `ssh_pass`}}", | ||
"shutdown_command" : "echo {{user `ssh_name`}} | sudo -S shutdown -P now", | ||
"vmx_data" : | ||
{ | ||
"ethernet0.connectionType": "nat" | ||
}, | ||
"vboxmanage" : [ | ||
[ | ||
"modifyvm", | ||
"{{.Name}}", | ||
"--nic1", | ||
"nat" | ||
] | ||
], | ||
"vboxmanage_post" : [ | ||
[ | ||
"modifyvm", | ||
"{{.Name}}", | ||
"--nic1", | ||
"hostonly" | ||
], | ||
[ | ||
"modifyvm", | ||
"{{.Name}}", | ||
"--nictype1", | ||
"82540EM" | ||
], | ||
[ | ||
"modifyvm", | ||
"{{.Name}}", | ||
"--hostonlyadapter1", | ||
"vboxnet0" | ||
] | ||
], | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
# | ||
# This script take a VM and install GNS3 server on it | ||
# | ||
# You need to pass the GNS3 VM OVA as parameter and GNS3 version as second parameter | ||
# | ||
|
||
set -e | ||
|
||
|
||
export PATH=$PATH:/Applications/VMware\ OVF\ Tool/ | ||
export GNS3_VERSION=`echo $2 | sed "s/^v//"` | ||
|
||
if [ "$GNS3_VERSION" == "" ] | ||
then | ||
echo "You need to pass the GNS3 version as parameter" | ||
exit 1 | ||
fi | ||
|
||
|
||
echo "Build VM for GNS3 $GNS3_VERSION" | ||
|
||
rm -Rf output-* | ||
export GNS3_SRC=$1 | ||
packer build -only=virtualbox-ovf gns3_release.json | ||
|
||
cd output-vmware-vmx | ||
|
||
zip -9 "../GNS3 VM VirtualBox ${GNS3_VERSION}.zip" "GNS3 VM.ova" | ||
|
||
cd .. | ||
rm -Rf output-* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# | ||
# This script take a VM and install GNS3 server on it | ||
# | ||
# You need to pass the GNS3 VM OVA as parameter | ||
# | ||
|
||
set -e | ||
|
||
|
||
|
||
|
||
export PATH=$PATH:/Applications/VMware\ OVF\ Tool/ | ||
export GNS3_VERSION=`echo $2 | sed "s/^v//"` | ||
|
||
if [ "$GNS3_VERSION" == "" ] | ||
then | ||
echo "You need to pass the GNS3 version as parameter" | ||
exit 1 | ||
fi | ||
|
||
|
||
|
||
echo "Build VM for GNS3 $GNS3_VERSION" | ||
|
||
rm -Rf output-vmx | ||
mkdir output-vmx | ||
ovftool --allowAllExtraConfig "$1" output-vmx/gns3.vmx | ||
|
||
rm -Rf output-vmware-vmx | ||
export GNS3_SRC="output-vmx/gns3.vmx" | ||
packer build -only=vmware-vmx gns3_release.json | ||
|
||
cd output-vmware-vmx | ||
|
||
ovftool --allowAllExtraConfig "GNS3 VM.vmx" "GNS3 VM.ova" | ||
|
||
zip -9 "../GNS3 VM VMware ${GNS3_VERSION}.zip" "GNS3 VM.ova" | ||
|
||
cd .. | ||
rm -Rf output-* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.8.6 | ||
0.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters