packer-hcloud/README.md

45 lines
1.8 KiB
Markdown
Raw Normal View History

2022-09-08 13:01:32 +00:00
# packer-hcloud
[![Build Status](https://img.shields.io/drone/build/infra/packer-hcloud?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/infra/packer-hcloud)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?label=license)](LICENSE)
This repository provides infrastructure-as-code examples to automate the creation of virtual machine images on Hetzner Cloud using [HashiCorp Packer](https://www.packer.io) and the [Packer Plugin for Hetzner Cloud](https://www.packer.io/plugins/builders/hetzner-cloud). All examples are written in the HashiCorp Configuration Language `HCL2`.
This project is inspired by [jktr/hcloud-packer-templates](https://github.com/jktr/hcloud-packer-templates).
## Requirements
**Packer**:
- HashiCorp [Packer](https://www.packer.io/intro/getting-started/install.html)
- HashiCorp [Packer Plugin for Hetzner Cloud](https://www.packer.io/plugins/builders/hetzner-cloud) (`hcloud`)
2022-09-08 13:01:32 +00:00
Required plugins are automatically downloaded during the `packer init` phase. These plugins are placed in the same directory as your Packer executable `/usr/local/bin` or `$HOME/.packer.d/plugins`.
## Configuration
### Download the release
Download the **latest** release.
### Configure the Variables
All available [variables](https://www.packer.io/docs/templates/hcl_templates/variables) are defined in the `variables.pkr.hcl` files. They can be overwritten using environment variables or in the `server.auto.pkrvars.hcl` file.
### Modify the Configurations and Scripts (Optional)
If required, modify the configuration and scripts files.
## Build
> **Info:** Using the force flag will automatically remove existing _templates_ with a matching name or VMID.
2022-09-08 13:01:32 +00:00
```Shell
packer init rocky-9/
packer build -force rocky-9/
2022-09-08 13:01:32 +00:00
```
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.