mirror of
https://github.com/GNS3/gns3-registry.git
synced 2024-12-19 21:07:55 +00:00
Add upload directory to packer/alpine, small restructuring
This commit is contained in:
parent
9208a5f1d7
commit
ce3f8099f6
@ -15,7 +15,7 @@ The only added packages are:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
packer build alpine_cli.json
|
||||
packer build alpine.json
|
||||
|
||||
|
||||
FRR
|
||||
@ -25,7 +25,7 @@ A build of Alpine with FRRouting preinstalled.
|
||||
|
||||
.. code:: bash
|
||||
|
||||
packer build -var-file=frr.json alpine_cli.json
|
||||
packer build -var-file=frr.json alpine.json
|
||||
|
||||
|
||||
Alpine GUI installation
|
||||
@ -35,5 +35,5 @@ The GUI version has XFCE4 installed.
|
||||
|
||||
.. code:: bash
|
||||
|
||||
packer build alpine_gui.json
|
||||
packer build -var-file=gui.json alpine.json
|
||||
|
||||
|
@ -2,7 +2,9 @@
|
||||
"variables": {
|
||||
"iso_url": "http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86_64/alpine-virt-3.12.0-x86_64.iso",
|
||||
"iso_checksum": "fe694a34c0e2d30b9e5dea7e2c1a3892c1f14cb474b69cc5c557a52970071da5",
|
||||
"ui_mode": "cli",
|
||||
"vm_name": "alpine_cli.qcow2",
|
||||
"file_source": "README.rst",
|
||||
"setup_script": "setup.sh",
|
||||
"disk_size": "500"
|
||||
},
|
||||
@ -49,12 +51,18 @@
|
||||
"type": "shell",
|
||||
"pause_before": "20s",
|
||||
"inline": [
|
||||
"apk upgrade --update-cache"
|
||||
"apk upgrade --update-cache",
|
||||
"mkdir -p /tmp/uploads"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"script": "scripts/serial.sh"
|
||||
"script": "scripts/{{user `ui_mode`}}.sh"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "files/{{user `file_source`}}",
|
||||
"destination": "/tmp/uploads/"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
@ -1,68 +0,0 @@
|
||||
{
|
||||
"variables": {
|
||||
"iso_url": "http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86_64/alpine-virt-3.12.0-x86_64.iso",
|
||||
"iso_checksum": "fe694a34c0e2d30b9e5dea7e2c1a3892c1f14cb474b69cc5c557a52970071da5",
|
||||
"vm_name": "alpine_gui.qcow2",
|
||||
"setup_script": "setup.sh",
|
||||
"disk_size": "1000"
|
||||
},
|
||||
"builders": [
|
||||
{
|
||||
"type": "qemu",
|
||||
"iso_url": "{{user `iso_url`}}",
|
||||
"iso_checksum": "{{user `iso_checksum`}}",
|
||||
"iso_checksum_type": "sha256",
|
||||
"shutdown_command": "poweroff",
|
||||
"headless": true,
|
||||
"ssh_username": "root",
|
||||
"ssh_password": "root",
|
||||
"vm_name": "{{user `vm_name`}}",
|
||||
"disk_interface": "ide",
|
||||
"disk_compression": true,
|
||||
"net_device": "e1000",
|
||||
"disk_size": "{{user `disk_size`}}",
|
||||
"boot_wait": "20s",
|
||||
"ssh_wait_timeout": "60s",
|
||||
"boot_command": [
|
||||
"root<enter><wait>",
|
||||
"echo 'root:root' | chpasswd<enter>",
|
||||
"ifconfig lo up<enter>",
|
||||
"ifconfig eth0 up && udhcpc -i eth0<enter><wait10>",
|
||||
"setup-sshd -c openssh<enter><wait>",
|
||||
"sed -i.orig '$aPermitRootLogin yes' /etc/ssh/sshd_config<enter>",
|
||||
"service sshd restart<enter><wait>"
|
||||
]
|
||||
}
|
||||
],
|
||||
"provisioners": [
|
||||
{
|
||||
"type": "shell",
|
||||
"script": "scripts/install.sh"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"inline": [
|
||||
"reboot"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"pause_before": "20s",
|
||||
"inline": [
|
||||
"apk upgrade --update-cache"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"script": "scripts/gui.sh"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"script": "scripts/{{user `setup_script`}}"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"script": "scripts/post_setup.sh"
|
||||
}
|
||||
]
|
||||
}
|
5
packer/alpine-linux/files/README.rst
Normal file
5
packer/alpine-linux/files/README.rst
Normal file
@ -0,0 +1,5 @@
|
||||
Upload directory
|
||||
================
|
||||
|
||||
A file/directory from this folder can be uploaded to the VM
|
||||
by entering it in the variable "file_source".
|
5
packer/alpine-linux/gui.json
Normal file
5
packer/alpine-linux/gui.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"ui_mode": "gui",
|
||||
"vm_name": "alpine_gui.qcow2",
|
||||
"disk_size": "1000"
|
||||
}
|
@ -69,6 +69,7 @@ cat > /etc/network/interfaces << EOF
|
||||
# Loopback interface
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
# Static config for eth0
|
||||
#auto eth0
|
||||
#iface eth0 inet static
|
||||
|
@ -4,5 +4,8 @@ mv /etc/ssh/sshd_config.orig /etc/ssh/sshd_config
|
||||
# clear cache
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
# clear uploads
|
||||
rm -rf /tmp/uploads
|
||||
|
||||
# Write 0
|
||||
dd if=/dev/zero bs=1M of=/zero ; rm -f /zero
|
||||
|
Loading…
Reference in New Issue
Block a user