From 715addcab6753260bb34b674d97566c76498e428 Mon Sep 17 00:00:00 2001 From: Eliezer Croitoru Date: Fri, 23 Dec 2022 05:34:21 +0200 Subject: [PATCH] Added Oracle and Centos stream --- cloud-init/centos-cloud/README.md | 9 ++++ .../centos-cloud/centos-cloud-init-data.iso | Bin 0 -> 374784 bytes cloud-init/centos-cloud/meta-data | 2 + cloud-init/centos-cloud/user-data | 5 ++ cloud-init/oracle-cloud/README.md | 9 ++++ cloud-init/oracle-cloud/meta-data | 2 + .../oracle-cloud/oracle-cloud-init-data.iso | Bin 0 -> 374784 bytes cloud-init/oracle-cloud/user-data | 5 ++ packer/centos/centos-cloud-init-data.iso | 1 + packer/centos/centos8.json | 51 ++++++++++++++++++ packer/centos/scripts/centos-gns3-user.sh | 5 ++ packer/centos/scripts/post_setup.sh | 10 ++++ packer/centos/scripts/upgrade-os.sh | 7 +++ packer/oracle/oracle-cloud-init-data.iso | 1 + packer/oracle/oracle8.json | 51 ++++++++++++++++++ packer/oracle/scripts/oracle-gns3-user.sh | 5 ++ packer/oracle/scripts/post_setup.sh | 10 ++++ packer/oracle/scripts/upgrade-os.sh | 7 +++ 18 files changed, 180 insertions(+) create mode 100644 cloud-init/centos-cloud/README.md create mode 100644 cloud-init/centos-cloud/centos-cloud-init-data.iso create mode 100644 cloud-init/centos-cloud/meta-data create mode 100644 cloud-init/centos-cloud/user-data create mode 100644 cloud-init/oracle-cloud/README.md create mode 100644 cloud-init/oracle-cloud/meta-data create mode 100644 cloud-init/oracle-cloud/oracle-cloud-init-data.iso create mode 100644 cloud-init/oracle-cloud/user-data create mode 120000 packer/centos/centos-cloud-init-data.iso create mode 100644 packer/centos/centos8.json create mode 100644 packer/centos/scripts/centos-gns3-user.sh create mode 100644 packer/centos/scripts/post_setup.sh create mode 100644 packer/centos/scripts/upgrade-os.sh create mode 120000 packer/oracle/oracle-cloud-init-data.iso create mode 100644 packer/oracle/oracle8.json create mode 100644 packer/oracle/scripts/oracle-gns3-user.sh create mode 100644 packer/oracle/scripts/post_setup.sh create mode 100644 packer/oracle/scripts/upgrade-os.sh diff --git a/cloud-init/centos-cloud/README.md b/cloud-init/centos-cloud/README.md new file mode 100644 index 0000000..f331dd2 --- /dev/null +++ b/cloud-init/centos-cloud/README.md @@ -0,0 +1,9 @@ +# Centos-cloud cloud-init-data image for GNS3 virtual appliance + +Generated using the following commands: + +``` +printf "#cloud-config\n\npassword: centos\nchpasswd: { expire: False }\nssh_pwauth: True\n" > user-data +printf "instance-id: centos-cloud\nlocal-hostname: centos-cloud\n" > meta-data +mkisofs -output centos-cloud-init-data.iso -volid cidata -joliet -rock user-data meta-data +``` diff --git a/cloud-init/centos-cloud/centos-cloud-init-data.iso b/cloud-init/centos-cloud/centos-cloud-init-data.iso new file mode 100644 index 0000000000000000000000000000000000000000..7306891cb27d0ce015788410948f4f17efe15fd6 GIT binary patch literal 374784 zcmeI*+in}j0RYh107VU^$U{)HMPN6B^nwJfWKuS4D1BmAOKB7F0xlKUPX-|~u>eal zLK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1hRai*=%KDyX@^eh_Bvu_a2Xr$FDxW zl>FyBvIv%`=ff<7tbT?YH$r26y7AM~Y(J}`ABCIql$+s39k~%Yb(s*}sSDQSqwQJ+ zHj7?a^~-L1vxq4Y*YDkH-rnj|u~Tjr)x&C3bYng&+N1t3ew=?2TkGq0VzK(Lzth{? zXm1zG#QQ62&E~!M+3KKZ537Ff_GhbAzEy6gt8#Oer#@ZhxgYb5;pgQjj*52ojSqdT zxwh6?Tf5V2-M!mtHJjmFLi5aaK1UYbc(*n9RtePaU^W78g}^(D`9ExjGW5buco5=+ zkKM2r9*1!_PS1;SEJm}O|9^A4_@CpO&)?sj|9^2>;)6Q+Q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B*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ bfB*pk1PBlyK!5-N0t5&UAV7e?l?wb9Nw4+r literal 0 HcmV?d00001 diff --git a/cloud-init/centos-cloud/meta-data b/cloud-init/centos-cloud/meta-data new file mode 100644 index 0000000..a04521c --- /dev/null +++ b/cloud-init/centos-cloud/meta-data @@ -0,0 +1,2 @@ +instance-id: centos-cloud +local-hostname: centos-cloud diff --git a/cloud-init/centos-cloud/user-data b/cloud-init/centos-cloud/user-data new file mode 100644 index 0000000..28ea93c --- /dev/null +++ b/cloud-init/centos-cloud/user-data @@ -0,0 +1,5 @@ +#cloud-config + +password: centos +chpasswd: { expire: False } +ssh_pwauth: True diff --git a/cloud-init/oracle-cloud/README.md b/cloud-init/oracle-cloud/README.md new file mode 100644 index 0000000..e21fb7d --- /dev/null +++ b/cloud-init/oracle-cloud/README.md @@ -0,0 +1,9 @@ +# Oracle-cloud cloud-init-data image for GNS3 virtual appliance + +Generated using the following commands: + +``` +printf "#cloud-config\n\npassword: oracle\nchpasswd: { expire: False }\nssh_pwauth: True\n" > user-data +printf "instance-id: oracle-cloud\nlocal-hostname: oracle-cloud\n" > meta-data +mkisofs -output oracle-cloud-init-data.iso -volid cidata -joliet -rock user-data meta-data +``` diff --git a/cloud-init/oracle-cloud/meta-data b/cloud-init/oracle-cloud/meta-data new file mode 100644 index 0000000..1b71690 --- /dev/null +++ b/cloud-init/oracle-cloud/meta-data @@ -0,0 +1,2 @@ +instance-id: oracle-cloud +local-hostname: oracle-cloud diff --git a/cloud-init/oracle-cloud/oracle-cloud-init-data.iso b/cloud-init/oracle-cloud/oracle-cloud-init-data.iso new file mode 100644 index 0000000000000000000000000000000000000000..b50064dc8212a7bfe1b6277c377f0e40c535def8 GIT binary patch literal 374784 zcmeI*&2AgV0RZ6HphX2X$RQ}&Ah4T-+XBu(5+%D*m7JK>QrblP0e2PHCxeigT7YC3 zqJ$I;62Pan?~!-tt#4%X5!zY)NU$W=MPWq^{4KFNv$OO2k>HRNv=f4j009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5Jr?r)*F_Lbqtu>do+hy7=cJlIJS>>HH8|1C3H%RYhAEzrD8~4(D>0xiT zyS3Tc$>)jdi>uA%TKf4?KW`1nUU&KPr83(tcH*mYYm%qFT<2L&v(3R5MU_^0tMfyQ z@TE3Zo2#oUtE=~#_wTR&ey!PDxRlVmu!T!GlJHWMPTo3!>3fXdYrl7@}279Y*d%#?o*%rhFX3l~}_@xEEu2Sc)Zj@fF&QZEVK8buItRsNP(rOOyGfgbUMu z)BOL|P4BNA@cFx(7=arW_}6^?zu|spo&W&?1PBlyK!5-N0t5&UxITeo@;CP6`WjF( z0RjXF5FkK+009C72oNA};{ua!{C ztK{V%%WoyWo@Sf{A-tHLzxe8P{Yc(G2f}yZqiK5|txv=CSr6k`{3Rs$c_*)0k2YJ? z(x)qRdw=V8-b=#a=w!H9FMm)E|NG~4$>-lsemI$wn$|QwUL5}2cNgYud>7JbuCy}^ zJM$~E)_2Q%aH;jv@#y$}ZhiUAS?lu-3JDM(K!Cti_t>A!NoQ;9T)qqcg&fKK*UYN# zhr=+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jXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly jK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNA}tpfiBZF%}@ literal 0 HcmV?d00001 diff --git a/cloud-init/oracle-cloud/user-data b/cloud-init/oracle-cloud/user-data new file mode 100644 index 0000000..26d25a8 --- /dev/null +++ b/cloud-init/oracle-cloud/user-data @@ -0,0 +1,5 @@ +#cloud-config + +password: oracle +chpasswd: { expire: False } +ssh_pwauth: True diff --git a/packer/centos/centos-cloud-init-data.iso b/packer/centos/centos-cloud-init-data.iso new file mode 120000 index 0000000..154f415 --- /dev/null +++ b/packer/centos/centos-cloud-init-data.iso @@ -0,0 +1 @@ +../../cloud-init/centos-cloud/centos-cloud-init-data.iso \ No newline at end of file diff --git a/packer/centos/centos8.json b/packer/centos/centos8.json new file mode 100644 index 0000000..1d43530 --- /dev/null +++ b/packer/centos/centos8.json @@ -0,0 +1,51 @@ +{ + "builders": [ + { + "disk_compression": true, + "disk_image": true, + "disk_interface": "virtio-scsi", + "disk_size": "{{user `disk_size`}}", + "headless": true, + "iso_checksum": "sha256:{{user `iso_checksum`}}", + "iso_url": "{{user `iso_url`}}", + "net_device": "virtio-net-pci", + "qemuargs": [ + [ + "-cdrom", + "centos-cloud-init-data.iso" + ] + ], + "shutdown_command": "sudo shutdown -P now", + "ssh_password": "centos", + "ssh_timeout": "3600s", + "ssh_username": "centos", + "type": "qemu", + "vm_name": "{{user `vm_name`}}" + } + ], + "provisioners": [ + { + "execute_command": "sudo env {{ .Vars }} {{ .Path }}", + "script": "scripts/upgrade-os.sh", + "type": "shell" + }, + { + "execute_command": "sudo env {{ .Vars }} {{ .Path }}", + "script": "scripts/centos-gns3-user.sh", + "type": "shell" + }, + { + "execute_command": "sudo env {{ .Vars }} {{ .Path }}", + "script": "scripts/post_setup.sh", + "type": "shell" + } + ], + "variables": { + "disk_size": "20G", + "iso_checksum": "8717251f8e4d2fe3e5032799caae89358c1ba68d65a16b5128a59ec6003aac1c", + "iso_url": "https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-20220913.0.x86_64.qcow2", + "setup_script": "centos8.sh", + "vm_name": "centos8.qcow2" + } +} + diff --git a/packer/centos/scripts/centos-gns3-user.sh b/packer/centos/scripts/centos-gns3-user.sh new file mode 100644 index 0000000..669ffe1 --- /dev/null +++ b/packer/centos/scripts/centos-gns3-user.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +set -ex + +printf "gns3\ngns3\n" | useradd -c "gns3" -G wheel gns3 diff --git a/packer/centos/scripts/post_setup.sh b/packer/centos/scripts/post_setup.sh new file mode 100644 index 0000000..28fa782 --- /dev/null +++ b/packer/centos/scripts/post_setup.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -ex + +# clear repository +dnf clean all + +# clear unused space +echo 'Clearing unused space...' +dd if=/dev/zero bs=1M of=/zero >/dev/null 2>&1 || true; rm -f /zero +sync diff --git a/packer/centos/scripts/upgrade-os.sh b/packer/centos/scripts/upgrade-os.sh new file mode 100644 index 0000000..ed5f36d --- /dev/null +++ b/packer/centos/scripts/upgrade-os.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -ex + +# clear repository +dnf clean all + +dnf update -y diff --git a/packer/oracle/oracle-cloud-init-data.iso b/packer/oracle/oracle-cloud-init-data.iso new file mode 120000 index 0000000..bf2c166 --- /dev/null +++ b/packer/oracle/oracle-cloud-init-data.iso @@ -0,0 +1 @@ +../../cloud-init/oracle-cloud/oracle-cloud-init-data.iso \ No newline at end of file diff --git a/packer/oracle/oracle8.json b/packer/oracle/oracle8.json new file mode 100644 index 0000000..180110d --- /dev/null +++ b/packer/oracle/oracle8.json @@ -0,0 +1,51 @@ +{ + "builders": [ + { + "disk_compression": true, + "disk_image": true, + "disk_interface": "virtio-scsi", + "disk_size": "{{user `disk_size`}}", + "headless": true, + "iso_checksum": "sha256:{{user `iso_checksum`}}", + "iso_url": "{{user `iso_url`}}", + "net_device": "virtio-net-pci", + "qemuargs": [ + [ + "-cdrom", + "oracle-cloud-init-data.iso" + ] + ], + "shutdown_command": "sudo shutdown -P now", + "ssh_password": "oracle", + "ssh_timeout": "240s", + "ssh_username": "cloud-user", + "type": "qemu", + "vm_name": "{{user `vm_name`}}" + } + ], + "provisioners": [ + { + "execute_command": "sudo env {{ .Vars }} {{ .Path }}", + "script": "scripts/upgrade-os.sh", + "type": "shell" + }, + { + "execute_command": "sudo env {{ .Vars }} {{ .Path }}", + "script": "scripts/oracle-gns3-user.sh", + "type": "shell" + }, + { + "execute_command": "sudo env {{ .Vars }} {{ .Path }}", + "script": "scripts/post_setup.sh", + "type": "shell" + } + ], + "variables": { + "disk_size": "40G", + "iso_checksum": "4a98e22908333dae1423e0bb4032c88aed60dbf1267addb73a6905778e9930df", + "iso_url": "https://yum.oracle.com/templates/OracleLinux/OL8/u7/x86_64/OL8U7_x86_64-kvm-b148.qcow", + "setup_script": "oracle8.sh", + "vm_name": "oracle8.qcow2" + } +} + diff --git a/packer/oracle/scripts/oracle-gns3-user.sh b/packer/oracle/scripts/oracle-gns3-user.sh new file mode 100644 index 0000000..669ffe1 --- /dev/null +++ b/packer/oracle/scripts/oracle-gns3-user.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +set -ex + +printf "gns3\ngns3\n" | useradd -c "gns3" -G wheel gns3 diff --git a/packer/oracle/scripts/post_setup.sh b/packer/oracle/scripts/post_setup.sh new file mode 100644 index 0000000..28fa782 --- /dev/null +++ b/packer/oracle/scripts/post_setup.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -ex + +# clear repository +dnf clean all + +# clear unused space +echo 'Clearing unused space...' +dd if=/dev/zero bs=1M of=/zero >/dev/null 2>&1 || true; rm -f /zero +sync diff --git a/packer/oracle/scripts/upgrade-os.sh b/packer/oracle/scripts/upgrade-os.sh new file mode 100644 index 0000000..ed5f36d --- /dev/null +++ b/packer/oracle/scripts/upgrade-os.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -ex + +# clear repository +dnf clean all + +dnf update -y