opack cloud ?

This commit is contained in:
Samuel Aubertin
2023-09-24 23:48:17 +02:00
parent 48e79ad400
commit 52028964f2
11 changed files with 205 additions and 64 deletions

View File

@@ -9,7 +9,6 @@
░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░
░ ░
```
-----
*Samuel 'sk4nz' AUBERTIN*
**skz-opack** is an automated [OpenBSD](https://www.openbsd.org) bootstrapper.
@@ -27,8 +26,9 @@ To get started with **skz-opack**, follow these steps:
2. Ensure you have the following dependencies installed:
- [GNU Make](https://www.gnu.org/software/make/)
- [libvirt](https://libvirt.org/)
- [Vagrant](https://www.vagrantup.com/)
- [Vagrant](https://developer.hashicorp.com/vagrant/downloads)
- [Vagrant-Libvirt module](https://github.com/vagrant-libvirt/vagrant-libvirt)
- [Terraform](https://developer.hashicorp.com/terraform/downloads) (for `opack-cloud`)
3. Use the project by including `path/to/skz-opack/src/opack.mk` and invoking the `opack` target in your Makefile to create a local OpenBSD virtual machine with Packer and Vagrant. Use the 'opack-cloud' target to run the same virtual machine in GCP with Terraform.
@@ -41,7 +41,7 @@ To get started with **skz-opack**, follow these steps:
## Overridable default options
Every default option ending with an `?` in "src/options.mk" can be overrided in the invoking Makefile. Here is an short list of theses:
Every default option ending with an `?` in "src/options.mk" can be overrided in the invoking Makefile. Here is an short excerpt of theses:
- `OPACK_SYS_HOSTNAME`: VM hostname
- `OPACK_SYS_USER`: username to create
@@ -65,7 +65,9 @@ Every default option ending with an `?` in "src/options.mk" can be overrided in
- `OPACK_AUTODISKLABEL_FILE`: OpenBSD partitioning scheme for installation
- `OPACK_PROVISION_FILE`: Script executed after installation
- `OPACK_RUNTIME_PROVISION_FILE`: Script executed after VM creation
- `OPACK_GCE_PROJECT`: The Google Cloud project name where the VM will be created
- `OPACK_GCE_JSON_KEY`: The filename of the Google Cloud service account JSON key
- `OPACK_GCE_BUCKET`: The Google Cloud Storage bucket name to use for the image import
## Examples
@@ -74,8 +76,8 @@ Every default option ending with an `?` in "src/options.mk" can be overrided in
Here is the shortest Makefile that can be used to leverage skz-opack:
```make
OPACK_TARGET= demo # the VM name
include path/to/src/opack.mk # mandatory
OPACK_TARGET= demo
include path/to/src/opack.mk
```
After invokation with `make opack`, it will download, install, and run the latest OpenBSD release in a local VM with the default options.
@@ -108,7 +110,7 @@ Making "opack" a dependency target of "all" will ensure **skz-opack** operates b
Once the "opack" target dependency is finished, the VM is running and the system kernel version is outputted. This example showcases how to customize and run **skz-opack** for your specific needs.
### GCP example
### GCE example
TODO
@@ -132,9 +134,9 @@ In the "src" directory, are located the following files:
- **autodisklabel**: This file provides the partitioning layout for the installer and can be customized by using the `OPACK_AUTODISKLABEL_FILE` option.
- **defines.mk**: Contains internal skz-opack definitions for Packer and Vagrant.
- **opack.mk**: To use skz-opack in your projects, simply include this file in your Makefiles.
- **opack-provision.sh**: This file is executed for post-installation provisioning with Packer and can be customized using the `OPACK_PROVISION_FILE` option.
- **packer-provision.sh**: This file is executed for post-installation provisioning with Packer and can be customized using the `OPACK_PROVISION_FILE` option.
- **options.mk**: This file is where all skz-opack options are declared. Options are always in the `OPACK_[OPTION NAME]` format.
- **packerfile-gcp.mk**: Special Packerfile for Google Cloud Compute upload.
- **packerfile-gcp.mk**: Special Packerfile for Google Compute Platform upload.
- **packerfile.mk**: Generic Packerfile for local execution.
- **vagrantfile.mk**: Contains Vagrantfile definitions for local execution.
- **vagrant-provision.sh**: This file is executed for pre-run provisioning with Vagrant and can be customized using the `OPACK_RUNTIME_PROVISION_FILE` option.
@@ -143,10 +145,3 @@ In the "src" directory, are located the following files:
**skz-opack** is distributed under the [OpenBSD License](https://www.openbsd.org/policy.html). See the [LICENSE](LICENSE) file for more details.
## References
For more information on the tools used in this project, refer to the following resources:
- [Packer](https://www.packer.io/)
- [Vagrant](https://www.vagrantup.com/)