Skip to content

Commit 89c1fac

Browse files
committed
Updated README with HCL details
1 parent ccd2e88 commit 89c1fac

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## News
44

5+
(2023/01/16) Switched all templates to HCL...finally! 😅
6+
57
(2023/01/16) Added Ubuntu 22.04 LTS template; validated usage with Packer 1.8.5.
68

79
(2021/03/17) Added Photon OS 4.0 and Ubuntu 20.04 LTS templates; validated usage with Packer 1.7.0.
@@ -23,28 +25,33 @@ I moved to the vsphere-iso builder for 2 main reasons:
2325

2426
> **Note**: Ubuntu and Photon OS are the only templates provided in this repository for now. Others coming soon, stay tuned!
2527
26-
* [Photon OS 3.0](https://github.com/cloudmaniac/packer-templates/tree/master/photon)
27-
* [Photon OS 4.0](https://github.com/cloudmaniac/packer-templates/tree/master/photon)
28-
* [Ubuntu 18.04 LTS](https://github.com/cloudmaniac/packer-templates/tree/master/ubuntu)
29-
* [Ubuntu 20.04 LTS](https://github.com/cloudmaniac/packer-templates/tree/master/ubuntu)
30-
* [Ubuntu 22.04 LTS](https://github.com/cloudmaniac/packer-templates/tree/master/ubuntu)
28+
* [Photon OS 3.0](https://github.com/cloudmaniac/packer-templates/tree/main/builds/photon/3.0)
29+
* [Photon OS 4.0](https://github.com/cloudmaniac/packer-templates/tree/main/builds/photon/4.0)
30+
* [Ubuntu 18.04 LTS](https://github.com/cloudmaniac/packer-templates/tree/main/builds/ubuntu/18.04)
31+
* [Ubuntu 20.04 LTS](https://github.com/cloudmaniac/packer-templates/tree/main/builds/ubuntu/20.04)
32+
* [Ubuntu 22.04 LTS](https://github.com/cloudmaniac/packer-templates/tree/main/builds/ubuntu/22.04)
3133

3234
## Usage
3335

3436
Step 1 - Clone the git repository.
3537

36-
Step 2 - Edit the respective JSON files, e.g. `ubuntu/ubuntu-22.04.json` file or `photon/photon-3.0.json`. For Ubuntu 20.04 and 22.04, adapt the `user-data` cloud-init file with the desired configuration ([documentation](https://ubuntu.com/server/docs/install/autoinstall-reference) for reference).
38+
Step 2 - Make a copy (or change) and adapt the [cloud definition file](https://github.com/cloudmaniac/packer-templates/tree/main/builds/clouds) to your environment (you will find them in the `builds/clouds` folder).
39+
40+
Step 3 - Update the `buils/common.pkrvars.hcl` file with your desired user credentials (or SSH key).
41+
42+
Step 4 - Navigate to the folder that matches the operating system (and version) that you want to build. E.g.: `builds/ubuntu/22.04`.
43+
44+
Step 4 - From that folder, edit the respective HCL file with your values, e.g. `ubuntu-22.04.auto.pkrvars.hcl` file or `photon-4.0.auto.pkrvars.hcl`. For Ubuntu 20.04 and 22.04, adapt the `user-data` cloud-init file with the desired configuration ([documentation](https://ubuntu.com/server/docs/install/autoinstall-reference) for reference).
3745

38-
Step 3 - Adapt one of the [cloud definition JSON file](https://github.com/cloudmaniac/packer-templates/tree/master/clouds) to your environment (you will find them in the `clouds` folder).
46+
Step 5 - Run `packer init .` to install the required plugin(s).
3947

40-
Step 4 - Build the template(s).
48+
Step 6 - Build your template with `packer build -force -var-file="../../clouds/infra-z67.pkrvars.hcl" -var-file="../../common.pkrvars.hcl" .`.
49+
*Note: adapt to filenames and location relevant to your environment.*
4150

42-
* Either manually by using the `packer` CLI: `packer build -var-file=../clouds/var-infra-z67.json ubuntu-20.04.json`
43-
* Or by using a quick script, e.g.: `./ubuntu/build-ubuntu-20.04.sh`
51+
Step 7 - Rinse and repeat for all templates you want to build. \o/
4452

4553
## Todo
4654

47-
* Migrate from JSON to HCL2
4855
* Add support for additional OS (Debian, CentOS, Windows)
4956
* Zero the disk before export
5057
* Use the Content Library to store the ISOs

builds/clouds/var-infra-z67.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)