Merge branch 'develop' of github.com:ajschroeder/proxmox-packer-examples into develop
This commit is contained in:
16
.gitignore
vendored
16
.gitignore
vendored
@@ -5,21 +5,27 @@
|
|||||||
**/credentials*
|
**/credentials*
|
||||||
|
|
||||||
# Configurations
|
# Configurations
|
||||||
## Ignore default config directory.
|
# Ignore default config directory.
|
||||||
config/
|
config/
|
||||||
|
|
||||||
# Manifests
|
# Manifests
|
||||||
## Ignore manifests directory.
|
# Ignore manifests directory.
|
||||||
manifests/*.json
|
manifests/*.json
|
||||||
|
|
||||||
# MacOS
|
# MacOS
|
||||||
## Ignore desktop services files.
|
# Ignore desktop services files.
|
||||||
**/.DS_Store
|
**/.DS_Store
|
||||||
|
|
||||||
# Certificates and Keys
|
# Certificates and Keys
|
||||||
## Ignore certificates files.
|
# Ignore certificates files.
|
||||||
**/*.cer
|
**/*.cer
|
||||||
**/*.crt
|
**/*.crt
|
||||||
**/*.p7b
|
**/*.p7b
|
||||||
## Ignore public key files
|
|
||||||
|
# Ignore public key files
|
||||||
**/*.pub
|
**/*.pub
|
||||||
|
|
||||||
|
# Ignore packer plugin files
|
||||||
|
plugin.hwm
|
||||||
|
plugin.pwd
|
||||||
|
plugin.pwi
|
||||||
|
|||||||
92
README.md
92
README.md
@@ -27,18 +27,20 @@ The following builds are available:
|
|||||||
| :--- | :--- | :---: | :---: | :---: | :---: |
|
| :--- | :--- | :---: | :---: | :---: | :---: |
|
||||||
| AlmaLinux | 9 | ✓ | ✓ | ✓ | |
|
| AlmaLinux | 9 | ✓ | ✓ | ✓ | |
|
||||||
| AlmaLinux | 8 | ✓ | ✓ | ✓ | |
|
| AlmaLinux | 8 | ✓ | ✓ | ✓ | |
|
||||||
| CentOS Stream | 9 | ✓ | ✓ | | |
|
| CentOS Stream | 10 | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Debian | 12 | ✓ | | | |
|
| CentOS Stream | 9 | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Debian | 11 | ✓ | | | |
|
| Debian | 12 | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Oracle Linux | 9 | ✓ | | | |
|
| Debian | 11 | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Oracle Linux | 8 | ✓ | | | |
|
| OpenSUSE Leap | 15.6 | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Rocky Linux | 9 | ✓ | | | |
|
| OpenSUSE Leap | 15.5 | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Rocky Linux | 8 | ✓ | | | |
|
| Oracle Linux | 9 | ✓ | ✓ | ✓ | ✓ |
|
||||||
| OpenSUSE Leap | 15.6 | ✓ | | | |
|
| Oracle Linux | 8 | ✓ | ✓ | ✓ | ✓ |
|
||||||
| OpenSUSE Leap | 15.5 | ✓ | | | |
|
| Rocky Linux | 9 | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Ubuntu Server | 24.04 LTS | ✓ | | | |
|
| Rocky Linux | 8 | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Ubuntu Server | 22.04 LTS | ✓ | | | |
|
| Ubuntu Server | 24.04 LTS | ✓ | ✓ | ✓ | ✓ |
|
||||||
|
| Ubuntu Server | 22.04 LTS | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Ubuntu Server | 20.04 LTS | ✓ | ✓ | ✓ | ✓ |
|
| Ubuntu Server | 20.04 LTS | ✓ | ✓ | ✓ | ✓ |
|
||||||
|
| Windows Desktop | 11 | | | ✓ | N/A |
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
@@ -52,7 +54,7 @@ Operating systems and versions tested with the project:
|
|||||||
|
|
||||||
**Packer**:
|
**Packer**:
|
||||||
|
|
||||||
- HashiCorp [Packer][packer-install] 1.11.0 or higher.
|
- HashiCorp [Packer][packer-install] 1.12.0 or higher.
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
>
|
>
|
||||||
@@ -121,12 +123,12 @@ Operating systems and versions tested with the project:
|
|||||||
>
|
>
|
||||||
> Required plugins are automatically downloaded and initialized when using `./build.sh`. For dark sites, you may download the plugins and place these same directory as your Packer executable `/usr/local/bin` or `$HOME/.packer.d/plugins`.
|
> Required plugins are automatically downloaded and initialized when using `./build.sh`. For dark sites, you may download the plugins and place these same directory as your Packer executable `/usr/local/bin` or `$HOME/.packer.d/plugins`.
|
||||||
|
|
||||||
- HashiCorp [Packer Plugin for Proxmox][packer-plugin-proxmox] 1.1.8 or later.
|
|
||||||
- [Packer Plugin for Git][packer-plugin-git] 0.6.2 or later - a community plugin for HashiCorp Packer.
|
- [Packer Plugin for Git][packer-plugin-git] 0.6.2 or later - a community plugin for HashiCorp Packer.
|
||||||
|
- HashiCorp [Packer Plugin for Proxmox-ISO][packer-plugin-proxmox] version 1.2.1 - the plugin for HashiCorp Packer to communicate with Proxmox VE. This needs to be pinned to version 1.2.1 at this time due to a [CPU bug](https://github.com/hashicorp/packer-plugin-proxmox/issues/307).
|
||||||
|
|
||||||
**Ansible**:
|
**Ansible**:
|
||||||
|
|
||||||
- [Ansible][ansible] [Core][ansible-core] version 2.10 or higher.
|
- [Ansible][ansible] [Core][ansible-core] version 2.14 or higher.
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
>
|
>
|
||||||
@@ -165,12 +167,12 @@ Operating systems and versions tested with the project:
|
|||||||
- <details>
|
- <details>
|
||||||
<summary>CentOS Stream 9</summary>
|
<summary>CentOS Stream 9</summary>
|
||||||
|
|
||||||
It is recommended that you install ansible-core using your system's package manager instead of via pip.
|
It is recommended that you install ansible using your system's package manager instead of via pip.
|
||||||
|
|
||||||
Install.
|
Install.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dnf -y install ansible-core
|
dnf -y install ansible
|
||||||
```
|
```
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@@ -263,7 +265,7 @@ You will need to generate a SHA-512 encrypted password for the `build_password_e
|
|||||||
Run the following command to generate a SHA-512 encrypted password:
|
Run the following command to generate a SHA-512 encrypted password:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
mkpasswd -m sha512
|
mkpasswd -m sha512crypt
|
||||||
```
|
```
|
||||||
|
|
||||||
The following output is displayed:
|
The following output is displayed:
|
||||||
@@ -315,12 +317,13 @@ Edit the `config/common.pkrvars.hcl` file to configure the following common vari
|
|||||||
common_iso_storage = "<Proxmox Storage Location>"
|
common_iso_storage = "<Proxmox Storage Location>"
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
common_data_source = "http"
|
common_data_source = "http"
|
||||||
common_http_ip = null
|
common_http_interface = null
|
||||||
common_http_port_min = 8000
|
common_http_bind_address = null
|
||||||
common_http_port_max = 8099
|
common_http_port_min = 8000
|
||||||
common_ip_wait_timeout = "20m"
|
common_http_port_max = 8099
|
||||||
common_shutdown_timeout = "15m"
|
common_ip_wait_timeout = "20m"
|
||||||
|
common_shutdown_timeout = "15m"
|
||||||
|
|
||||||
// HCP Packer
|
// HCP Packer
|
||||||
common_hcp_packer_registry_enabled = false
|
common_hcp_packer_registry_enabled = false
|
||||||
@@ -359,21 +362,42 @@ common_data_source = "disk"
|
|||||||
|
|
||||||
The Packer plugin's `cd_content` option is used when selecting `disk` unless the distribution does not support a secondary CD-ROM.
|
The Packer plugin's `cd_content` option is used when selecting `disk` unless the distribution does not support a secondary CD-ROM.
|
||||||
|
|
||||||
#### HTTP Binding
|
#### HTTP Interface
|
||||||
|
|
||||||
If you need to define a specific IPv4 address from your host for Packer's built-in HTTP server, modify the `common_http_ip` variable from `null` to a `string` value that matches an IP address on your Packer host.
|
Name of the network interface that Packer gets `HTTPIP` from. Defaults to the first non loopback interface.
|
||||||
|
|
||||||
```hcl title="config/common.pkrvars.hcl"
|
```hcl title="config/common.pkrvars.hcl"
|
||||||
common_http_ip = "172.16.11.254"
|
common_http_interface = "eth2"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### HTTP Bind Address
|
||||||
|
|
||||||
|
IP address on the build server to bind the Packer HTTP instance to. Must be an interface that is reachable from the Proxmox server.
|
||||||
|
```hcl title="config/common.pkrvars.hcl"
|
||||||
|
common_http_bind_address = 172.16.15.97"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Network Variables
|
### Network Variables
|
||||||
|
|
||||||
Configuring a static IP address under the `configs/network.pkrvars.hcl` file is supported. If you want to use DHCP for the templates then leave these variables commented out. The default is DHCP.
|
|
||||||
|
|
||||||
Edit the `config/network.pkrvars.hcl` file to configure the following:
|
Edit the `config/network.pkrvars.hcl` file to configure the following:
|
||||||
|
|
||||||
- Static IP address settings
|
#### Proxmox Specific Network Variables for VM Templates
|
||||||
|
These variables are used by Packer to configure the network interface for the VM template. These are specific to your environment. For example, to use the default `vmbr0` interface and the tag for VLAN 102, you would set it as follows:
|
||||||
|
|
||||||
|
```hcl title="config/network.pkrvars.hcl"
|
||||||
|
// Proxmox settings for VM templates
|
||||||
|
vm_bridge_interface = "vmbr0"
|
||||||
|
vm_vlan_tag = "102"
|
||||||
|
```
|
||||||
|
|
||||||
|
Configuring a static IP address under the `configs/network.pkrvars.hcl` file is supported. If you want to use DHCP for the templates then leave these variables commented out. The default is DHCP.
|
||||||
|
|
||||||
|
> **Note**
|
||||||
|
>
|
||||||
|
> - These settings are site specific for each Proxmox host and are going to be needed regardless if you use DHCP or static IP addresses.
|
||||||
|
|
||||||
|
#### Static IP address settings
|
||||||
|
The Packer build templates default to using DHCP, however, you can use static IP addressing for your VM templates. Simply uncomment the following vars and configure to your specific requirements:
|
||||||
|
|
||||||
```hcl title="config/network.pkrvars.hcl"
|
```hcl title="config/network.pkrvars.hcl"
|
||||||
vm_ip_address = "192.168.101.100"
|
vm_ip_address = "192.168.101.100"
|
||||||
@@ -382,6 +406,10 @@ vm_ip_gateway = "192.168.101.1"
|
|||||||
vm_dns_list = [ "8.8.8.8", "8.8.4.4" ]
|
vm_dns_list = [ "8.8.8.8", "8.8.4.4" ]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> **Note**
|
||||||
|
>
|
||||||
|
> - If you need/want to go back to using DHCP, just comment these variables out again and the templates should go back to using DHCP.
|
||||||
|
|
||||||
### Proxmox Variables
|
### Proxmox Variables
|
||||||
|
|
||||||
Edit the `config/proxmox.pkrvars.hcl` file to configure the following:
|
Edit the `config/proxmox.pkrvars.hcl` file to configure the following:
|
||||||
@@ -390,13 +418,13 @@ Edit the `config/proxmox.pkrvars.hcl` file to configure the following:
|
|||||||
|
|
||||||
```hcl title="config/proxmox.pkrvars.hcl"
|
```hcl title="config/proxmox.pkrvars.hcl"
|
||||||
// Proxmox Credentials
|
// Proxmox Credentials
|
||||||
proxmox_api_url = "<FQDN or IP of proxmox server>"
|
|
||||||
proxmox_api_token_id = "name@realm!token"
|
proxmox_api_token_id = "name@realm!token"
|
||||||
proxmox_api_token_secret = "<token secret>"
|
proxmox_api_token_secret = "<token secret>"
|
||||||
proxmox_insecure_connection = false
|
proxmox_insecure_connection = false
|
||||||
|
|
||||||
// Proxmox Settings
|
// Proxmox Specific Settings
|
||||||
proxmox_node = "<proxmox node name>"
|
proxmox_hostname = "<FQDN or IP of proxmox server>"
|
||||||
|
proxmox_node = "<proxmox node name>"
|
||||||
```
|
```
|
||||||
|
|
||||||
The `proxmox_api_token_id` variable uses a specific format and, as the time of this writing, needs to be assigned to the `PVEAdmin` role. One of the to-do's is to document a least-privilege method of creating the Proxmox API token.
|
The `proxmox_api_token_id` variable uses a specific format and, as the time of this writing, needs to be assigned to the `PVEAdmin` role. One of the to-do's is to document a least-privilege method of creating the Proxmox API token.
|
||||||
|
|||||||
@@ -1,2 +1,6 @@
|
|||||||
---
|
---
|
||||||
enable_cloudinit: false
|
enable_cloudinit: false
|
||||||
|
|
||||||
|
base_chocolatey_packages:
|
||||||
|
- firefox
|
||||||
|
- putty
|
||||||
|
|||||||
@@ -6,46 +6,13 @@
|
|||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "OS: {{ ansible_os_name }}"
|
msg: "OS: {{ ansible_os_name }}"
|
||||||
|
|
||||||
- name: Ensure .NET Framework 4.8 requirement is satisfied for Chocolatey v2.0.0 and later
|
- name: Install latest version of Chocolatey
|
||||||
when: ansible_os_installation_type != "Server Core"
|
chocolatey.chocolatey.win_chocolatey:
|
||||||
block:
|
name: chocolatey
|
||||||
- name: Install Chocolatey CLI
|
state: latest
|
||||||
chocolatey.chocolatey.win_chocolatey:
|
|
||||||
name: chocolatey
|
|
||||||
state: present
|
|
||||||
version: 1.4.0
|
|
||||||
|
|
||||||
- name: Install Microsoft .NET Framework 4.8
|
- name: Installing additional packages using Chocolatey
|
||||||
chocolatey.chocolatey.win_chocolatey:
|
chocolatey.chocolatey.win_chocolatey:
|
||||||
name: netfx-4.8
|
name: "{{ item }}"
|
||||||
state: present
|
state: latest
|
||||||
|
loop: "{{ base_chocolatey_packages }}"
|
||||||
- name: Reboot the host to complete .NET Framework 4.8 install
|
|
||||||
ansible.windows.win_reboot:
|
|
||||||
|
|
||||||
- name: Install latest version of Chocolatey
|
|
||||||
chocolatey.chocolatey.win_chocolatey:
|
|
||||||
name: chocolatey
|
|
||||||
state: latest
|
|
||||||
|
|
||||||
- name: Installing additional packages using Chocolatey
|
|
||||||
chocolatey.chocolatey.win_chocolatey:
|
|
||||||
name:
|
|
||||||
- googlechrome
|
|
||||||
- putty
|
|
||||||
state: latest
|
|
||||||
ignore_checksums: true
|
|
||||||
|
|
||||||
- name: Updating the operating system
|
|
||||||
ansible.windows.win_updates:
|
|
||||||
category_names:
|
|
||||||
- SecurityUpdates
|
|
||||||
- CriticalUpdates
|
|
||||||
reject_list:
|
|
||||||
- 5034439
|
|
||||||
- 5034441
|
|
||||||
reboot: true
|
|
||||||
register: win_updates
|
|
||||||
until: not win_updates.failed
|
|
||||||
retries: 5
|
|
||||||
delay: 300
|
|
||||||
|
|||||||
342
build.sh
342
build.sh
@@ -4,11 +4,55 @@ set -e
|
|||||||
|
|
||||||
source common.sh
|
source common.sh
|
||||||
|
|
||||||
|
if [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
|
||||||
|
echo "Usage: script.sh [OPTIONS] [CONFIG_PATH]"
|
||||||
|
echo ""
|
||||||
|
echo "Options:"
|
||||||
|
echo " -h, --help Show this help message and exit."
|
||||||
|
echo " -d, --debug Run builds in debug mode."
|
||||||
|
echo ""
|
||||||
|
echo "Arguments:"
|
||||||
|
echo " CONFIG_PATH Path to the configuration directory."
|
||||||
|
echo ""
|
||||||
|
echo "Examples:"
|
||||||
|
echo " ./build.sh"
|
||||||
|
echo " ./build.sh --help"
|
||||||
|
echo " ./build.sh --debug"
|
||||||
|
echo " ./build.sh config"
|
||||||
|
echo " ./build.sh us-west-1"
|
||||||
|
echo " ./build.sh --debug config"
|
||||||
|
echo " ./build.sh --debug us-west-1"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" == "--debug" ] || [ "$1" == "-d" ]; then
|
||||||
|
debug_mode=true
|
||||||
|
debug_option="-debug"
|
||||||
|
shift
|
||||||
|
else
|
||||||
|
debug_mode=false
|
||||||
|
debug_option=""
|
||||||
|
fi
|
||||||
|
|
||||||
SCRIPT_PATH=$(realpath "$(dirname "$(follow_link "$0")")")
|
SCRIPT_PATH=$(realpath "$(dirname "$(follow_link "$0")")")
|
||||||
CONFIG_PATH=$(realpath "${1:-${SCRIPT_PATH}/config}")
|
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
CONFIG_PATH=$(realpath "$1")
|
||||||
|
else
|
||||||
|
CONFIG_PATH=$(realpath "${SCRIPT_PATH}/config")
|
||||||
|
fi
|
||||||
|
|
||||||
|
menu_message="Select a HashiCorp Packer build for Proxmox."
|
||||||
|
|
||||||
|
if [ "$debug_mode" = true ]; then
|
||||||
|
menu_message+=" \e[31m(Debug Mode)\e[0m"
|
||||||
|
fi
|
||||||
|
|
||||||
menu_option_1() {
|
menu_option_1() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/almalinux/9/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/almalinux/9/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a AlmaLinux 9 Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a AlmaLinux 9 Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -26,13 +70,15 @@ menu_option_1() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
@@ -41,6 +87,9 @@ menu_option_1() {
|
|||||||
|
|
||||||
menu_option_2() {
|
menu_option_2() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/almalinux/8/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/almalinux/8/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a AlmaLinux 8 Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a AlmaLinux 8 Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -58,13 +107,15 @@ menu_option_2() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
@@ -72,7 +123,47 @@ menu_option_2() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
menu_option_3() {
|
menu_option_3() {
|
||||||
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/centos/10-stream/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
|
echo -e "\nCONFIRM: Build a CentOS 10 Stream Template for Proxmox?"
|
||||||
|
echo -e "\nContinue? (y/n)"
|
||||||
|
read -r REPLY
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||||
|
then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
### Build a CentOS 10 Stream Template for Proxmox. ###
|
||||||
|
echo "Building a CentOS 10 Stream Template for Proxmox..."
|
||||||
|
|
||||||
|
### Initialize HashiCorp Packer and required plugins. ###
|
||||||
|
echo "Initializing HashiCorp Packer and required plugins..."
|
||||||
|
packer init "$INPUT_PATH"
|
||||||
|
|
||||||
|
### Start the Build. ###
|
||||||
|
echo "Starting the build...."
|
||||||
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
|
"$INPUT_PATH"
|
||||||
|
|
||||||
|
### All done. ###
|
||||||
|
echo "Done."
|
||||||
|
}
|
||||||
|
|
||||||
|
menu_option_4() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/centos/9-stream/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/centos/9-stream/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a CentOS 9 Stream Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a CentOS 9 Stream Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -90,21 +181,26 @@ menu_option_3() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
echo "Done."
|
echo "Done."
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_option_4() {
|
menu_option_5() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/debian/12/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/debian/12/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a Debian 12 (Bookworm) Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a Debian 12 (Bookworm) Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -122,21 +218,26 @@ menu_option_4() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
echo "Done."
|
echo "Done."
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_option_5() {
|
menu_option_6() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/debian/11/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/debian/11/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a Debian 11 (Bullseye) Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a Debian 11 (Bullseye) Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -154,21 +255,26 @@ menu_option_5() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
echo "Done."
|
echo "Done."
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_option_6() {
|
menu_option_7() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/opensuse/leap-15-6/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/opensuse/leap-15-6/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a OpenSUSE Leap 15.6 Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a OpenSUSE Leap 15.6 Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -186,21 +292,26 @@ menu_option_6() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
echo "Done."
|
echo "Done."
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_option_7() {
|
menu_option_8() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/opensuse/leap-15-5/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/opensuse/leap-15-5/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a OpenSUSE Leap 15.5 Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a OpenSUSE Leap 15.5 Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -218,21 +329,26 @@ menu_option_7() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
echo "Done."
|
echo "Done."
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_option_8() {
|
menu_option_9() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/oracle/9/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/oracle/9/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a Oracle Linux 9 Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a Oracle Linux 9 Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -250,21 +366,26 @@ menu_option_8() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
echo "Done."
|
echo "Done."
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_option_9() {
|
menu_option_10() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/oracle/8/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/oracle/8/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a Oracle Linux 8 Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a Oracle Linux 8 Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -282,21 +403,26 @@ menu_option_9() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
echo "Done."
|
echo "Done."
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_option_10() {
|
menu_option_11() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/rocky/9/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/rocky/9/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a Rocky Linux 9 Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a Rocky Linux 9 Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -314,21 +440,26 @@ menu_option_10() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
echo "Done."
|
echo "Done."
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_option_11() {
|
menu_option_12() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/rocky/8/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/rocky/8/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a Rocky Linux 8 Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a Rocky Linux 8 Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -346,21 +477,26 @@ menu_option_11() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
echo "Done."
|
echo "Done."
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_option_12() {
|
menu_option_13() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/ubuntu/24-04-lts/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/ubuntu/24-04-lts/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a Ubuntu Server 24.04 LTS Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a Ubuntu Server 24.04 LTS Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -378,21 +514,26 @@ menu_option_12() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
echo "Done."
|
echo "Done."
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_option_13() {
|
menu_option_14() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/ubuntu/22-04-lts/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/ubuntu/22-04-lts/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a Ubuntu Server 22.04 LTS Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a Ubuntu Server 22.04 LTS Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -410,21 +551,26 @@ menu_option_13() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
echo "Done."
|
echo "Done."
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_option_14() {
|
menu_option_15() {
|
||||||
INPUT_PATH="$SCRIPT_PATH"/builds/linux/ubuntu/20-04-lts/
|
INPUT_PATH="$SCRIPT_PATH"/builds/linux/ubuntu/20-04-lts/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
echo -e "\nCONFIRM: Build a Ubuntu Server 20.04 LTS Template for Proxmox?"
|
echo -e "\nCONFIRM: Build a Ubuntu Server 20.04 LTS Template for Proxmox?"
|
||||||
echo -e "\nContinue? (y/n)"
|
echo -e "\nContinue? (y/n)"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
@@ -442,13 +588,125 @@ menu_option_14() {
|
|||||||
|
|
||||||
### Start the Build. ###
|
### Start the Build. ###
|
||||||
echo "Starting the build...."
|
echo "Starting the build...."
|
||||||
packer build -force \
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
|
"$INPUT_PATH"
|
||||||
|
|
||||||
|
### All done. ###
|
||||||
|
echo "Done."
|
||||||
|
}
|
||||||
|
|
||||||
|
menu_option_16() {
|
||||||
|
INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/11/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
|
echo -e "\nCONFIRM: Build all Windows 11 Templates for Proxmox?"
|
||||||
|
echo -e "\nContinue? (y/n)"
|
||||||
|
read -r REPLY
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||||
|
then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
### Build all Windows 11 Templates for Proxmox. ###
|
||||||
|
echo "Building all Windows 11 Templates for Proxmox..."
|
||||||
|
|
||||||
|
### Initialize HashiCorp Packer and required plugins. ###
|
||||||
|
echo "Initializing HashiCorp Packer and required plugins..."
|
||||||
|
packer init "$INPUT_PATH"
|
||||||
|
|
||||||
|
### Start the Build. ###
|
||||||
|
echo "Starting the build...."
|
||||||
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
|
"$INPUT_PATH"
|
||||||
|
|
||||||
|
### All done. ###
|
||||||
|
echo "Done."
|
||||||
|
}
|
||||||
|
|
||||||
|
menu_option_17() {
|
||||||
|
INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/11/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
|
echo -e "\nCONFIRM: Build a Windows 11 - Enterprise Template for Proxmox?"
|
||||||
|
echo -e "\nContinue? (y/n)"
|
||||||
|
read -r REPLY
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||||
|
then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
### Build a Windows 11 - Enterprise Template for Proxmox. ###
|
||||||
|
echo "Building a Windows 11 - Enterprise Template for Proxmox..."
|
||||||
|
|
||||||
|
### Initialize HashiCorp Packer and required plugins. ###
|
||||||
|
echo "Initializing HashiCorp Packer and required plugins..."
|
||||||
|
packer init "$INPUT_PATH"
|
||||||
|
|
||||||
|
### Start the Build. ###
|
||||||
|
echo "Starting the build...."
|
||||||
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
|
--only proxmox-iso.windows-desktop-ent \
|
||||||
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
|
"$INPUT_PATH"
|
||||||
|
|
||||||
|
### All done. ###
|
||||||
|
echo "Done."
|
||||||
|
}
|
||||||
|
|
||||||
|
menu_option_18() {
|
||||||
|
INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/11/
|
||||||
|
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
|
||||||
|
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
|
||||||
|
echo -e "\nCONFIRM: Build a Windows 11 - Professional Template for Proxmox?"
|
||||||
|
echo -e "\nContinue? (y/n)"
|
||||||
|
read -r REPLY
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||||
|
then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
### Build a Windows 11 - Professional Templates for Proxmox. ###
|
||||||
|
echo "Building a Windows 11 - Professional Template for Proxmox..."
|
||||||
|
|
||||||
|
### Initialize HashiCorp Packer and required plugins. ###
|
||||||
|
echo "Initializing HashiCorp Packer and required plugins..."
|
||||||
|
packer init "$INPUT_PATH"
|
||||||
|
|
||||||
|
### Start the Build. ###
|
||||||
|
echo "Starting the build...."
|
||||||
|
echo "packer build -force -on-error=ask $debug_option"
|
||||||
|
packer build -force -on-error=ask $debug_option \
|
||||||
|
--only proxmox-iso.windows-desktop-pro \
|
||||||
|
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
|
||||||
|
-var-file="$CONFIG_PATH/$BUILD_VARS" \
|
||||||
"$INPUT_PATH"
|
"$INPUT_PATH"
|
||||||
|
|
||||||
### All done. ###
|
### All done. ###
|
||||||
@@ -489,18 +747,22 @@ until [ "$selection" = "0" ]; do
|
|||||||
echo ""
|
echo ""
|
||||||
echo " 1 - AlmaLinux 9"
|
echo " 1 - AlmaLinux 9"
|
||||||
echo " 2 - AlmaLinux 8"
|
echo " 2 - AlmaLinux 8"
|
||||||
echo " 3 - CentOS 9 Stream"
|
echo " 3 - CentOS 10 Stream"
|
||||||
echo " 4 - Debian 12"
|
echo " 4 - CentOS 9 Stream"
|
||||||
echo " 5 - Debian 11"
|
echo " 5 - Debian 12"
|
||||||
echo " 6 - OpenSUSE Leap 15.6"
|
echo " 6 - Debian 11"
|
||||||
echo " 7 - OpenSUSE Leap 15.5"
|
echo " 7 - OpenSUSE Leap 15.6"
|
||||||
echo " 8 - Oracle Linux 9"
|
echo " 8 - OpenSUSE Leap 15.5"
|
||||||
echo " 9 - Oracle Linux 8"
|
echo " 9 - Oracle Linux 9"
|
||||||
echo " 10 - Rocky Linux 9"
|
echo " 10 - Oracle Linux 8"
|
||||||
echo " 11 - Rocky Linux 8"
|
echo " 11 - Rocky Linux 9"
|
||||||
echo " 12 - Ubuntu Server 24.04 LTS"
|
echo " 12 - Rocky Linux 8"
|
||||||
echo " 13 - Ubuntu Server 22.04 LTS"
|
echo " 13 - Ubuntu Server 24.04 LTS"
|
||||||
echo " 14 - Ubuntu Server 20.04 LTS"
|
echo " 14 - Ubuntu Server 22.04 LTS"
|
||||||
|
echo " 15 - Ubuntu Server 20.04 LTS"
|
||||||
|
echo " 16 - Windows 11 - All"
|
||||||
|
echo " 17 - Windows 11 - Enterprise Only"
|
||||||
|
echo " 18 - Windows 11 - Professional Only"
|
||||||
echo ""
|
echo ""
|
||||||
echo " Other:"
|
echo " Other:"
|
||||||
echo ""
|
echo ""
|
||||||
@@ -524,6 +786,10 @@ until [ "$selection" = "0" ]; do
|
|||||||
12) clear ; menu_option_12 ; press_enter ;;
|
12) clear ; menu_option_12 ; press_enter ;;
|
||||||
13) clear ; menu_option_13 ; press_enter ;;
|
13) clear ; menu_option_13 ; press_enter ;;
|
||||||
14) clear ; menu_option_14 ; press_enter ;;
|
14) clear ; menu_option_14 ; press_enter ;;
|
||||||
|
15) clear ; menu_option_15 ; press_enter ;;
|
||||||
|
16) clear ; menu_option_16 ; press_enter ;;
|
||||||
|
17) clear ; menu_option_17 ; press_enter ;;
|
||||||
|
18) clear ; menu_option_18 ; press_enter ;;
|
||||||
[Ii] ) clear ; info ; press_enter ;;
|
[Ii] ) clear ; info ; press_enter ;;
|
||||||
[Qq] ) clear ; exit ;;
|
[Qq] ) clear ; exit ;;
|
||||||
* ) clear ; incorrect_selection ; press_enter ;;
|
* ) clear ; incorrect_selection ; press_enter ;;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Default Account Credentials
|
// Default Account Credentials
|
||||||
build_username = "ubuntu"
|
build_username = "deploy"
|
||||||
build_password = "ubuntu"
|
build_password = "deploy"
|
||||||
build_password_encrypted = "$6$Gg0b6uacy6apqKTP$OIvG1n8YUNpiDpsQgS02PgGgGY0egsYM0lqQq1lvOLKCAhMQcrY6SXq2K6ynt6RI8GVvmiagbKkcN6YXRzQtb1"
|
build_password_encrypted = "$6$MsfTs/5vjdnlgqEt$pkl1uGs645Y1NLpzQu7R/coOohkyzksn2YkY2EgjOuXkA6Tnrr3Yag8LYeotfYaiiyIzn3MyYCWdeqM.2VKAz1"
|
||||||
build_key = "Your public SSH key goes here"
|
build_key = "Your public SSH key goes here"
|
||||||
|
|||||||
@@ -11,12 +11,14 @@ common_iso_storage = "OS"
|
|||||||
vm_storage_pool = "pool0"
|
vm_storage_pool = "pool0"
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
common_data_source = "http"
|
common_data_source = "http"
|
||||||
common_http_ip = null
|
common_http_interface = null
|
||||||
common_http_port_min = 8000
|
common_http_bind_address = null
|
||||||
common_http_port_max = 8099
|
common_http_port_min = 8000
|
||||||
common_ip_wait_timeout = "20m"
|
common_http_port_max = 8099
|
||||||
common_shutdown_timeout = "15m"
|
common_ip_wait_timeout = "20m"
|
||||||
|
common_shutdown_timeout = "15m"
|
||||||
|
|
||||||
// HCP Packer
|
// HCP Packer
|
||||||
common_hcp_packer_registry_enabled = false
|
common_hcp_packer_registry_enabled = false
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.11.0"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
@@ -18,7 +18,7 @@ packer {
|
|||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.1.8"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ locals {
|
|||||||
bios_boot_command = [
|
bios_boot_command = [
|
||||||
// This sends the "up arrow" key, typically used to navigate through boot menu options.
|
// This sends the "up arrow" key, typically used to navigate through boot menu options.
|
||||||
"<up>",
|
"<up>",
|
||||||
// This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options.
|
// This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options.
|
||||||
"<tab>",
|
"<tab>",
|
||||||
"inst.text biosdevname=0 net.ifnames=0 inst.gpt",
|
"inst.text biosdevname=0 net.ifnames=0 inst.gpt",
|
||||||
" ${local.data_source_command}",
|
" ${local.data_source_command}",
|
||||||
@@ -103,7 +103,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "linux-almalinux" {
|
source "proxmox-iso" "linux-almalinux" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -122,12 +122,14 @@ source "proxmox-iso" "linux-almalinux" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -136,13 +138,11 @@ source "proxmox-iso" "linux-almalinux" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -155,6 +155,7 @@ source "proxmox-iso" "linux-almalinux" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -162,6 +163,12 @@ source "proxmox-iso" "linux-almalinux" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.11.0"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
@@ -18,7 +18,7 @@ packer {
|
|||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.1.8"
|
version = ">= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ locals {
|
|||||||
bios_boot_command = [
|
bios_boot_command = [
|
||||||
// This sends the "up arrow" key, typically used to navigate through boot menu options.
|
// This sends the "up arrow" key, typically used to navigate through boot menu options.
|
||||||
"<up>",
|
"<up>",
|
||||||
// This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options.
|
// This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options.
|
||||||
"<tab>",
|
"<tab>",
|
||||||
"inst.text biosdevname=0 net.ifnames=0 inst.gpt",
|
"inst.text biosdevname=0 net.ifnames=0 inst.gpt",
|
||||||
" ${local.data_source_command}",
|
" ${local.data_source_command}",
|
||||||
@@ -103,7 +103,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "linux-almalinux" {
|
source "proxmox-iso" "linux-almalinux" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -122,12 +122,14 @@ source "proxmox-iso" "linux-almalinux" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -136,13 +138,11 @@ source "proxmox-iso" "linux-almalinux" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -155,6 +155,7 @@ source "proxmox-iso" "linux-almalinux" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -162,6 +163,12 @@ source "proxmox-iso" "linux-almalinux" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,18 +7,18 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.9.1"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
version = "~> 1"
|
version = "~> 1"
|
||||||
}
|
}
|
||||||
git = {
|
git = {
|
||||||
version = ">= 0.4.2"
|
version = ">= 0.6.2"
|
||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.0.6"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ locals {
|
|||||||
"text ${local.data_source_command}",
|
"text ${local.data_source_command}",
|
||||||
// This sends the "enter" key, waits, turns on the left control key, sends the "x" key, and then turns off the left control key. This is used to save the changes and exit the boot menu option's configuration, and then continue the boot process.
|
// This sends the "enter" key, waits, turns on the left control key, sends the "x" key, and then turns off the left control key. This is used to save the changes and exit the boot menu option's configuration, and then continue the boot process.
|
||||||
"<enter><wait><leftCtrlOn>x<leftCtrlOff>"
|
"<enter><wait><leftCtrlOn>x<leftCtrlOff>"
|
||||||
]
|
]
|
||||||
|
|
||||||
build_by = "Built by: HashiCorp Packer ${packer.version}"
|
build_by = "Built by: HashiCorp Packer ${packer.version}"
|
||||||
build_date = formatdate("DD-MM-YYYY hh:mm ZZZ", "${timestamp()}" )
|
build_date = formatdate("DD-MM-YYYY hh:mm ZZZ", "${timestamp()}" )
|
||||||
@@ -102,7 +102,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "linux-centos-stream" {
|
source "proxmox-iso" "linux-centos-stream" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -121,12 +121,14 @@ source "proxmox-iso" "linux-centos-stream" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -135,13 +137,11 @@ source "proxmox-iso" "linux-centos-stream" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -154,6 +154,7 @@ source "proxmox-iso" "linux-centos-stream" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -161,6 +162,12 @@ source "proxmox-iso" "linux-centos-stream" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
|
|||||||
@@ -7,18 +7,18 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.9.1"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
version = "~> 1"
|
version = "~> 1"
|
||||||
}
|
}
|
||||||
git = {
|
git = {
|
||||||
version = ">= 0.4.2"
|
version = ">= 0.6.2"
|
||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.0.6"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ locals {
|
|||||||
"text ${local.data_source_command}",
|
"text ${local.data_source_command}",
|
||||||
// This sends the "enter" key, waits, turns on the left control key, sends the "x" key, and then turns off the left control key. This is used to save the changes and exit the boot menu option's configuration, and then continue the boot process.
|
// This sends the "enter" key, waits, turns on the left control key, sends the "x" key, and then turns off the left control key. This is used to save the changes and exit the boot menu option's configuration, and then continue the boot process.
|
||||||
"<enter><wait><leftCtrlOn>x<leftCtrlOff>"
|
"<enter><wait><leftCtrlOn>x<leftCtrlOff>"
|
||||||
]
|
]
|
||||||
|
|
||||||
build_by = "Built by: HashiCorp Packer ${packer.version}"
|
build_by = "Built by: HashiCorp Packer ${packer.version}"
|
||||||
build_date = formatdate("DD-MM-YYYY hh:mm ZZZ", "${timestamp()}" )
|
build_date = formatdate("DD-MM-YYYY hh:mm ZZZ", "${timestamp()}" )
|
||||||
@@ -102,7 +102,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "linux-centos-stream" {
|
source "proxmox-iso" "linux-centos-stream" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -121,12 +121,14 @@ source "proxmox-iso" "linux-centos-stream" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -135,13 +137,11 @@ source "proxmox-iso" "linux-centos-stream" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -154,6 +154,7 @@ source "proxmox-iso" "linux-centos-stream" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -161,6 +162,12 @@ source "proxmox-iso" "linux-centos-stream" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,18 +7,18 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.9.1"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
version = "~> 1"
|
version = "~> 1"
|
||||||
}
|
}
|
||||||
git = {
|
git = {
|
||||||
version = ">= 0.4.2"
|
version = ">= 0.6.2"
|
||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.0.6"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ data "git-repository" "cwd" {}
|
|||||||
// BLOCK: locals
|
// BLOCK: locals
|
||||||
// Defines the local variables.
|
// Defines the local variables.
|
||||||
|
|
||||||
locals {
|
locals {
|
||||||
|
|
||||||
bios_boot_command = [
|
bios_boot_command = [
|
||||||
"<wait><wait><wait><esc><wait><wait><wait>",
|
"<wait><wait><wait><esc><wait><wait><wait>",
|
||||||
@@ -125,7 +125,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "debian" {
|
source "proxmox-iso" "debian" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -144,12 +144,14 @@ source "proxmox-iso" "debian" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -158,13 +160,11 @@ source "proxmox-iso" "debian" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -177,6 +177,7 @@ source "proxmox-iso" "debian" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -184,6 +185,12 @@ source "proxmox-iso" "debian" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,18 +7,18 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.9.1"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
version = "~> 1"
|
version = "~> 1"
|
||||||
}
|
}
|
||||||
git = {
|
git = {
|
||||||
version = ">= 0.4.2"
|
version = ">= 0.6.2"
|
||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.0.6"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ data "git-repository" "cwd" {}
|
|||||||
// BLOCK: locals
|
// BLOCK: locals
|
||||||
// Defines the local variables.
|
// Defines the local variables.
|
||||||
|
|
||||||
locals {
|
locals {
|
||||||
|
|
||||||
bios_boot_command = [
|
bios_boot_command = [
|
||||||
"<wait><wait><wait><esc><wait><wait><wait>",
|
"<wait><wait><wait><esc><wait><wait><wait>",
|
||||||
@@ -124,7 +124,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "debian" {
|
source "proxmox-iso" "debian" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -143,12 +143,14 @@ source "proxmox-iso" "debian" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -157,13 +159,11 @@ source "proxmox-iso" "debian" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -176,6 +176,7 @@ source "proxmox-iso" "debian" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -183,6 +184,12 @@ source "proxmox-iso" "debian" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,18 +7,18 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.9.1"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
version = "~> 1"
|
version = "~> 1"
|
||||||
}
|
}
|
||||||
git = {
|
git = {
|
||||||
version = ">= 0.4.2"
|
version = ">= 0.6.2"
|
||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.1.6"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "linux-opensuse-leap" {
|
source "proxmox-iso" "linux-opensuse-leap" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -126,12 +126,14 @@ source "proxmox-iso" "linux-opensuse-leap" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -140,13 +142,11 @@ source "proxmox-iso" "linux-opensuse-leap" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -159,6 +159,7 @@ source "proxmox-iso" "linux-opensuse-leap" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -166,6 +167,12 @@ source "proxmox-iso" "linux-opensuse-leap" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,18 +7,18 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.9.1"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
version = "~> 1"
|
version = "~> 1"
|
||||||
}
|
}
|
||||||
git = {
|
git = {
|
||||||
version = ">= 0.4.2"
|
version = ">= 0.6.2"
|
||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.1.6"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "linux-opensuse-leap" {
|
source "proxmox-iso" "linux-opensuse-leap" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -119,12 +119,14 @@ source "proxmox-iso" "linux-opensuse-leap" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -133,13 +135,11 @@ source "proxmox-iso" "linux-opensuse-leap" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -152,6 +152,7 @@ source "proxmox-iso" "linux-opensuse-leap" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -159,6 +160,12 @@ source "proxmox-iso" "linux-opensuse-leap" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.11.0"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
@@ -18,7 +18,7 @@ packer {
|
|||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.1.8"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ locals {
|
|||||||
bios_boot_command = [
|
bios_boot_command = [
|
||||||
// This sends the "up arrow" key, typically used to navigate through boot menu options.
|
// This sends the "up arrow" key, typically used to navigate through boot menu options.
|
||||||
"<up>",
|
"<up>",
|
||||||
// This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options.
|
// This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options.
|
||||||
"<tab>",
|
"<tab>",
|
||||||
"inst.text biosdevname=0 net.ifnames=0 inst.gpt",
|
"inst.text biosdevname=0 net.ifnames=0 inst.gpt",
|
||||||
" ${local.data_source_command}",
|
" ${local.data_source_command}",
|
||||||
@@ -103,7 +103,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "linux-oracle" {
|
source "proxmox-iso" "linux-oracle" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -122,12 +122,14 @@ source "proxmox-iso" "linux-oracle" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -136,13 +138,11 @@ source "proxmox-iso" "linux-oracle" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -155,6 +155,7 @@ source "proxmox-iso" "linux-oracle" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -162,6 +163,12 @@ source "proxmox-iso" "linux-oracle" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.11.0"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
@@ -18,7 +18,7 @@ packer {
|
|||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.1.8"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ locals {
|
|||||||
bios_boot_command = [
|
bios_boot_command = [
|
||||||
// This sends the "up arrow" key, typically used to navigate through boot menu options.
|
// This sends the "up arrow" key, typically used to navigate through boot menu options.
|
||||||
"<up>",
|
"<up>",
|
||||||
// This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options.
|
// This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options.
|
||||||
"<tab>",
|
"<tab>",
|
||||||
"inst.text biosdevname=0 net.ifnames=0 inst.gpt",
|
"inst.text biosdevname=0 net.ifnames=0 inst.gpt",
|
||||||
" ${local.data_source_command}",
|
" ${local.data_source_command}",
|
||||||
@@ -103,7 +103,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "linux-oracle" {
|
source "proxmox-iso" "linux-oracle" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -122,12 +122,14 @@ source "proxmox-iso" "linux-oracle" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -136,13 +138,11 @@ source "proxmox-iso" "linux-oracle" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -155,6 +155,7 @@ source "proxmox-iso" "linux-oracle" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -162,6 +163,12 @@ source "proxmox-iso" "linux-oracle" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,18 +7,18 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.9.1"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
version = "~> 1"
|
version = "~> 1"
|
||||||
}
|
}
|
||||||
git = {
|
git = {
|
||||||
version = ">= 0.4.2"
|
version = ">= 0.6.2"
|
||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.0.6"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ locals {
|
|||||||
"text ${local.data_source_command}",
|
"text ${local.data_source_command}",
|
||||||
// This sends the "enter" key, waits, turns on the left control key, sends the "x" key, and then turns off the left control key. This is used to save the changes and exit the boot menu option's configuration, and then continue the boot process.
|
// This sends the "enter" key, waits, turns on the left control key, sends the "x" key, and then turns off the left control key. This is used to save the changes and exit the boot menu option's configuration, and then continue the boot process.
|
||||||
"<enter><wait><leftCtrlOn>x<leftCtrlOff>"
|
"<enter><wait><leftCtrlOn>x<leftCtrlOff>"
|
||||||
]
|
]
|
||||||
|
|
||||||
build_by = "Built by: HashiCorp Packer ${packer.version}"
|
build_by = "Built by: HashiCorp Packer ${packer.version}"
|
||||||
build_date = formatdate("DD-MM-YYYY hh:mm ZZZ", "${timestamp()}" )
|
build_date = formatdate("DD-MM-YYYY hh:mm ZZZ", "${timestamp()}" )
|
||||||
@@ -103,7 +103,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "linux-rocky" {
|
source "proxmox-iso" "linux-rocky" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -122,12 +122,14 @@ source "proxmox-iso" "linux-rocky" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -136,13 +138,11 @@ source "proxmox-iso" "linux-rocky" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -155,6 +155,7 @@ source "proxmox-iso" "linux-rocky" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -162,6 +163,12 @@ source "proxmox-iso" "linux-rocky" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,18 +7,18 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.9.1"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
version = "~> 1"
|
version = "~> 1"
|
||||||
}
|
}
|
||||||
git = {
|
git = {
|
||||||
version = ">= 0.4.2"
|
version = ">= 0.6.2"
|
||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.0.6"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "linux-rocky" {
|
source "proxmox-iso" "linux-rocky" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -122,12 +122,14 @@ source "proxmox-iso" "linux-rocky" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -136,13 +138,11 @@ source "proxmox-iso" "linux-rocky" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -155,6 +155,7 @@ source "proxmox-iso" "linux-rocky" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -162,6 +163,12 @@ source "proxmox-iso" "linux-rocky" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,18 +7,18 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.9.1"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
version = "~> 1"
|
version = "~> 1"
|
||||||
}
|
}
|
||||||
git = {
|
git = {
|
||||||
version = ">= 0.4.2"
|
version = ">= 0.6.2"
|
||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.0.6"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "ubuntu" {
|
source "proxmox-iso" "ubuntu" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -129,12 +129,14 @@ source "proxmox-iso" "ubuntu" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -143,13 +145,11 @@ source "proxmox-iso" "ubuntu" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -162,6 +162,7 @@ source "proxmox-iso" "ubuntu" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -169,6 +170,12 @@ source "proxmox-iso" "ubuntu" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,18 +7,18 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.9.1"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
version = "~> 1"
|
version = "~> 1"
|
||||||
}
|
}
|
||||||
git = {
|
git = {
|
||||||
version = ">= 0.4.2"
|
version = ">= 0.6.2"
|
||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.0.6"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "ubuntu" {
|
source "proxmox-iso" "ubuntu" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -125,12 +125,14 @@ source "proxmox-iso" "ubuntu" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -139,13 +141,11 @@ source "proxmox-iso" "ubuntu" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -158,6 +158,7 @@ source "proxmox-iso" "ubuntu" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -165,6 +166,12 @@ source "proxmox-iso" "ubuntu" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,18 +7,18 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.9.1"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
version = "~> 1"
|
version = "~> 1"
|
||||||
}
|
}
|
||||||
git = {
|
git = {
|
||||||
version = ">= 0.4.2"
|
version = ">= 0.6.2"
|
||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.0.6"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ locals {
|
|||||||
// Defines the builder configuration blocks.
|
// Defines the builder configuration blocks.
|
||||||
|
|
||||||
source "proxmox-iso" "ubuntu" {
|
source "proxmox-iso" "ubuntu" {
|
||||||
|
|
||||||
// Proxmox Connection Settings and Credentials
|
// Proxmox Connection Settings and Credentials
|
||||||
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
|
||||||
username = "${var.proxmox_api_token_id}"
|
username = "${var.proxmox_api_token_id}"
|
||||||
@@ -125,12 +125,14 @@ source "proxmox-iso" "ubuntu" {
|
|||||||
memory = "${var.vm_mem_size}"
|
memory = "${var.vm_mem_size}"
|
||||||
os = "${var.vm_os_type}"
|
os = "${var.vm_os_type}"
|
||||||
scsi_controller = "${var.vm_disk_controller_type}"
|
scsi_controller = "${var.vm_disk_controller_type}"
|
||||||
|
|
||||||
disks {
|
disks {
|
||||||
disk_size = "${var.vm_disk_size}"
|
disk_size = "${var.vm_disk_size}"
|
||||||
type = "${var.vm_disk_type}"
|
type = "${var.vm_disk_type}"
|
||||||
storage_pool = "${var.vm_storage_pool}"
|
storage_pool = "${var.vm_storage_pool}"
|
||||||
format = "${var.vm_disk_format}"
|
format = "${var.vm_disk_format}"
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic "efi_config" {
|
dynamic "efi_config" {
|
||||||
for_each = var.vm_bios == "ovmf" ? [1] : []
|
for_each = var.vm_bios == "ovmf" ? [1] : []
|
||||||
content {
|
content {
|
||||||
@@ -139,13 +141,11 @@ source "proxmox-iso" "ubuntu" {
|
|||||||
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unmount_iso = true
|
|
||||||
ssh_username = "${var.build_username}"
|
ssh_username = "${var.build_username}"
|
||||||
ssh_password = "${var.build_password}"
|
ssh_password = "${var.build_password}"
|
||||||
ssh_timeout = "${var.timeout}"
|
ssh_timeout = "${var.timeout}"
|
||||||
ssh_port = "22"
|
ssh_port = "22"
|
||||||
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
|
||||||
iso_checksum = "${var.iso_checksum}"
|
|
||||||
qemu_agent = true
|
qemu_agent = true
|
||||||
|
|
||||||
network_adapters {
|
network_adapters {
|
||||||
@@ -158,6 +158,7 @@ source "proxmox-iso" "ubuntu" {
|
|||||||
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
|
||||||
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
|
||||||
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
|
||||||
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
|
||||||
@@ -165,6 +166,12 @@ source "proxmox-iso" "ubuntu" {
|
|||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
boot_command = local.boot_command
|
boot_command = local.boot_command
|
||||||
|
|
||||||
|
boot_iso {
|
||||||
|
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
|
||||||
|
unmount = true
|
||||||
|
iso_checksum = "${var.iso_checksum}"
|
||||||
|
}
|
||||||
|
|
||||||
dynamic "additional_iso_files" {
|
dynamic "additional_iso_files" {
|
||||||
for_each = var.common_data_source == "disk" ? [1] : []
|
for_each = var.common_data_source == "disk" ? [1] : []
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -250,7 +256,7 @@ variable "common_shutdown_timeout" {
|
|||||||
variable "build_username" {
|
variable "build_username" {
|
||||||
type = string
|
type = string
|
||||||
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
|
||||||
# sensitive = true
|
# sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "build_password" {
|
variable "build_password" {
|
||||||
@@ -304,4 +310,4 @@ variable "additional_packages" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional packages to install."
|
description = "Additional packages to install."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,11 +5,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Proxmox Credentials
|
// Proxmox Credentials
|
||||||
proxmox_api_url = "<FQDN or IP of proxmox server>"
|
|
||||||
proxmox_api_token_id = "name@realm!token"
|
proxmox_api_token_id = "name@realm!token"
|
||||||
proxmox_api_token_secret = "<token secret>"
|
proxmox_api_token_secret = "<token secret>"
|
||||||
proxmox_insecure_connection = false
|
proxmox_insecure_connection = false
|
||||||
|
|
||||||
// Proxmox Settings
|
// Proxmox Specific Settings
|
||||||
proxmox_node = "<proxmox node name>"
|
proxmox_hostname = "<FQDN or IP of proxmox server>"
|
||||||
proxmox_hostname = "<proxmox hostname>"
|
proxmox_node = "<proxmox node name>"
|
||||||
|
|||||||
@@ -114,19 +114,16 @@ variable "vm_os_name" {
|
|||||||
variable "vm_os_version" {
|
variable "vm_os_version" {
|
||||||
type = string
|
type = string
|
||||||
description = "The guest operating system version. Used for naming."
|
description = "The guest operating system version. Used for naming."
|
||||||
default = "11"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "vm_os_edition_pro" {
|
variable "vm_os_edition_pro" {
|
||||||
type = string
|
type = string
|
||||||
description = "The guest operating system edition. Used for naming."
|
description = "The guest operating system edition. Used for naming."
|
||||||
default = "pro"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "vm_os_edition_ent" {
|
variable "vm_os_edition_ent" {
|
||||||
type = string
|
type = string
|
||||||
description = "The guest operating system edition. Used for naming."
|
description = "The guest operating system edition. Used for naming."
|
||||||
default = "ent"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "vm_os_type" {
|
variable "vm_os_type" {
|
||||||
@@ -297,6 +294,12 @@ variable "common_http_bind_address" {
|
|||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "common_http_interface" {
|
||||||
|
type = string
|
||||||
|
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "common_http_port_min" {
|
variable "common_http_port_min" {
|
||||||
type = number
|
type = number
|
||||||
description = "The start of the HTTP port range."
|
description = "The start of the HTTP port range."
|
||||||
@@ -307,10 +310,10 @@ variable "common_http_port_max" {
|
|||||||
description = "The end of the HTTP port range."
|
description = "The end of the HTTP port range."
|
||||||
}
|
}
|
||||||
|
|
||||||
// variable "vm_boot_order" {
|
variable "vm_boot_order" {
|
||||||
// type = string
|
type = string
|
||||||
// description = "The boot order for virtual machines devices."
|
description = "The boot order for virtual machines devices."
|
||||||
// }
|
}
|
||||||
|
|
||||||
variable "vm_boot_wait" {
|
variable "vm_boot_wait" {
|
||||||
type = string
|
type = string
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
// The Packer configuration.
|
// The Packer configuration.
|
||||||
|
|
||||||
packer {
|
packer {
|
||||||
required_version = ">= 1.11.0"
|
required_version = ">= 1.12.0"
|
||||||
required_plugins {
|
required_plugins {
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
@@ -19,7 +19,7 @@ packer {
|
|||||||
source = "github.com/ethanmdavidson/git"
|
source = "github.com/ethanmdavidson/git"
|
||||||
}
|
}
|
||||||
proxmox = {
|
proxmox = {
|
||||||
version = ">= 1.2.2"
|
version = "= 1.2.1"
|
||||||
source = "github.com/hashicorp/proxmox"
|
source = "github.com/hashicorp/proxmox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,11 +125,11 @@ source "proxmox-iso" "windows-desktop-pro" {
|
|||||||
"autounattend.xml" = templatefile("${abspath(path.root)}/data/autounattend.pkrtpl.hcl", {
|
"autounattend.xml" = templatefile("${abspath(path.root)}/data/autounattend.pkrtpl.hcl", {
|
||||||
build_username = var.build_username
|
build_username = var.build_username
|
||||||
build_password = var.build_password
|
build_password = var.build_password
|
||||||
vm_inst_os_eval = var.vm_inst_os_eval // Does not support evaluation.
|
vm_inst_os_eval = var.vm_inst_os_eval
|
||||||
vm_inst_os_language = var.vm_inst_os_language
|
vm_inst_os_language = var.vm_inst_os_language
|
||||||
vm_inst_os_keyboard = var.vm_inst_os_keyboard
|
vm_inst_os_keyboard = var.vm_inst_os_keyboard
|
||||||
vm_inst_os_image = var.vm_inst_os_image_pro
|
vm_inst_os_image = var.vm_inst_os_image_pro
|
||||||
vm_inst_os_key = var.vm_inst_os_key_pro // Does not support evaluation.
|
vm_inst_os_key = var.vm_inst_os_key_pro
|
||||||
vm_guest_os_language = var.vm_os_language
|
vm_guest_os_language = var.vm_os_language
|
||||||
vm_guest_os_keyboard = var.vm_os_keyboard
|
vm_guest_os_keyboard = var.vm_os_keyboard
|
||||||
vm_guest_os_timezone = var.vm_os_timezone
|
vm_guest_os_timezone = var.vm_os_timezone
|
||||||
@@ -141,6 +141,8 @@ source "proxmox-iso" "windows-desktop-pro" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_http_interface
|
||||||
|
http_bind_address = var.common_http_bind_address
|
||||||
http_port_min = var.common_http_port_min
|
http_port_min = var.common_http_port_min
|
||||||
http_port_max = var.common_http_port_max
|
http_port_max = var.common_http_port_max
|
||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
@@ -235,11 +237,11 @@ source "proxmox-iso" "windows-desktop-ent" {
|
|||||||
"autounattend.xml" = templatefile("${abspath(path.root)}/data/autounattend.pkrtpl.hcl", {
|
"autounattend.xml" = templatefile("${abspath(path.root)}/data/autounattend.pkrtpl.hcl", {
|
||||||
build_username = var.build_username
|
build_username = var.build_username
|
||||||
build_password = var.build_password
|
build_password = var.build_password
|
||||||
vm_inst_os_eval = var.vm_inst_os_eval // Does not support evaluation.
|
vm_inst_os_eval = var.vm_inst_os_eval
|
||||||
vm_inst_os_language = var.vm_inst_os_language
|
vm_inst_os_language = var.vm_inst_os_language
|
||||||
vm_inst_os_keyboard = var.vm_inst_os_keyboard
|
vm_inst_os_keyboard = var.vm_inst_os_keyboard
|
||||||
vm_inst_os_image = var.vm_inst_os_image_ent
|
vm_inst_os_image = var.vm_inst_os_image_ent
|
||||||
vm_inst_os_key = var.vm_inst_os_key_ent // Does not support evaluation.
|
vm_inst_os_key = var.vm_inst_os_key_ent
|
||||||
vm_guest_os_language = var.vm_os_language
|
vm_guest_os_language = var.vm_os_language
|
||||||
vm_guest_os_keyboard = var.vm_os_keyboard
|
vm_guest_os_keyboard = var.vm_os_keyboard
|
||||||
vm_guest_os_timezone = var.vm_os_timezone
|
vm_guest_os_timezone = var.vm_os_timezone
|
||||||
@@ -251,6 +253,8 @@ source "proxmox-iso" "windows-desktop-ent" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Boot and Provisioning Settings
|
// Boot and Provisioning Settings
|
||||||
|
http_interface = var.common_http_interface
|
||||||
|
http_bind_address = var.common_http_bind_address
|
||||||
http_port_min = var.common_http_port_min
|
http_port_min = var.common_http_port_min
|
||||||
http_port_max = var.common_http_port_max
|
http_port_max = var.common_http_port_max
|
||||||
boot_wait = var.vm_boot_wait
|
boot_wait = var.vm_boot_wait
|
||||||
@@ -272,7 +276,8 @@ source "proxmox-iso" "windows-desktop-ent" {
|
|||||||
|
|
||||||
build {
|
build {
|
||||||
sources = [
|
sources = [
|
||||||
"source.proxmox-iso.windows-desktop-ent"
|
"source.proxmox-iso.windows-desktop-pro",
|
||||||
|
"source.proxmox-iso.windows-desktop-ent",
|
||||||
]
|
]
|
||||||
|
|
||||||
provisioner "ansible" {
|
provisioner "ansible" {
|
||||||
|
|||||||
@@ -5,16 +5,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Installation Operating System Metadata
|
// Installation Operating System Metadata
|
||||||
|
vm_inst_os_eval = true
|
||||||
|
vm_inst_os_language = "en-US"
|
||||||
|
vm_inst_os_keyboard = "en-US"
|
||||||
|
vm_inst_os_image_pro = "Windows 11 Pro"
|
||||||
vm_inst_os_key_pro = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
|
vm_inst_os_key_pro = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
|
||||||
|
vm_inst_os_image_ent = "Windows 11 Enterprise Evaluation"
|
||||||
vm_inst_os_key_ent = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
|
vm_inst_os_key_ent = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
|
||||||
|
|
||||||
// Virtual Machine Guest Operating System Setting
|
// Guest Operating System Metadata
|
||||||
vm_guest_os_type = "windows9_64Guest"
|
vm_os_language = "en-US"
|
||||||
|
vm_os_keyboard = "en-US"
|
||||||
// Virtual Machine Hardware Settings
|
vm_os_timezone = "UTC"
|
||||||
vm_firmware = "efi-secure"
|
vm_os_family = "windows"
|
||||||
|
vm_os_name = "desktop"
|
||||||
// Removable Media Settings
|
vm_os_version = "11"
|
||||||
iso_datastore_path = "iso/windows/windows-desktop/11/amd64"
|
vm_os_edition_pro = "pro"
|
||||||
iso_content_library_item = "22631.2428.231001-0608.23H2_NI_RELEASE_SVC_REFRESH_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us"
|
vm_os_edition_ent = "ent"
|
||||||
iso_file = "22631.2428.231001-0608.23H2_NI_RELEASE_SVC_REFRESH_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso"
|
|
||||||
|
|||||||
27
config.sh
27
config.sh
@@ -7,24 +7,31 @@ source common.sh
|
|||||||
SCRIPT_PATH=$(realpath "$(dirname "$(follow_link "$0")")")
|
SCRIPT_PATH=$(realpath "$(dirname "$(follow_link "$0")")")
|
||||||
CONFIG_PATH=${1:-${SCRIPT_PATH}/config}
|
CONFIG_PATH=${1:-${SCRIPT_PATH}/config}
|
||||||
|
|
||||||
mkdir -p "$CONFIG_PATH"
|
# Define the script and config paths
|
||||||
|
follow_link_result=$(follow_link "$0")
|
||||||
|
if ! SCRIPT_PATH=$(realpath "$(dirname "${follow_link_result}")"); then
|
||||||
|
echo "Error: follow_link or realpath failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
CONFIG_PATH=${1:-${SCRIPT_PATH}/config}
|
||||||
|
|
||||||
|
mkdir -p "${CONFIG_PATH}"
|
||||||
### Copy the example input variables.
|
### Copy the example input variables.
|
||||||
echo
|
echo
|
||||||
echo "> Copying the example input variables..."
|
echo "> Copying the example input variables..."
|
||||||
cp -av "$SCRIPT_PATH"/builds/*.pkrvars.hcl.example "$CONFIG_PATH"
|
cp -av "${SCRIPT_PATH}"/builds/*.pkrvars.hcl.example "${CONFIG_PATH}"
|
||||||
|
find "${SCRIPT_PATH}"/builds/*/ -type f -name "*.pkrvars.hcl.example" | while IFS= read -r srcfile; do
|
||||||
|
srcdir=$(dirname "${srcfile}" | tr -s /)
|
||||||
|
dstfile=$(echo "${srcdir#"${SCRIPT_PATH}"/builds/}" | tr '/' '-')
|
||||||
|
cp -av "${srcfile}" "${CONFIG_PATH}/${dstfile}.pkrvars.hcl.example"
|
||||||
|
done
|
||||||
|
|
||||||
### Rename the example input variables.
|
### Rename the example input variables.
|
||||||
echo
|
echo
|
||||||
echo "> Renaming the example input variables..."
|
echo "> Renaming the example input variables..."
|
||||||
srcext=".pkrvars.hcl.example"
|
for file in "${CONFIG_PATH}"/*.pkrvars.hcl.example; do
|
||||||
dstext=".pkrvars.hcl"
|
mv -- "${file}" "${file%.example}"
|
||||||
|
|
||||||
for f in "$CONFIG_PATH"/*"${srcext}"; do
|
|
||||||
bname="${f%"${srcext}"}"
|
|
||||||
echo "${bname}{${srcext} → ${dstext}}"
|
|
||||||
mv "${f}" "${bname}${dstext}"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "> Done."
|
echo "> Done."
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
||||||
# Set network connections provile to Private mode.
|
# Set network connections profile to Private mode.
|
||||||
Write-Output 'Setting the network connection profiles to Private...'
|
Write-Output 'Setting the network connection profiles to Private...'
|
||||||
$connectionProfile = Get-NetConnectionProfile
|
$connectionProfile = Get-NetConnectionProfile
|
||||||
While ($connectionProfile.Name -eq 'Identifying...') {
|
While ($connectionProfile.Name -eq 'Identifying...') {
|
||||||
|
|||||||
101
validate.sh
Executable file
101
validate.sh
Executable file
@@ -0,0 +1,101 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Load common functions
|
||||||
|
source common.sh
|
||||||
|
|
||||||
|
# === Colors ===
|
||||||
|
GREEN="\033[0;32m"
|
||||||
|
YELLOW="\033[1;33m"
|
||||||
|
RED="\033[0;31m"
|
||||||
|
BLUE="\033[0;34m"
|
||||||
|
NC="\033[0m"
|
||||||
|
|
||||||
|
# === Paths ===
|
||||||
|
SCRIPT_PATH=$(realpath "$(dirname "$(follow_link "$0")")")
|
||||||
|
CONFIG_PATH=$(realpath "${1:-${SCRIPT_PATH}/config}")
|
||||||
|
|
||||||
|
INPUT_PATHS=(
|
||||||
|
"$SCRIPT_PATH/builds/linux/almalinux/9/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/almalinux/8/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/centos/10-stream/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/centos/9-stream/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/debian/12/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/debian/11/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/opensuse/leap-15-6/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/opensuse/leap-15-5/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/oracle/9/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/oracle/8/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/rocky/9/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/rocky/8/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/ubuntu/24-04-lts/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/ubuntu/22-04-lts/"
|
||||||
|
"$SCRIPT_PATH/builds/linux/ubuntu/20-04-lts/"
|
||||||
|
"$SCRIPT_PATH/builds/windows/desktop/11/"
|
||||||
|
)
|
||||||
|
|
||||||
|
# === Result storage ===
|
||||||
|
declare -a summary=()
|
||||||
|
|
||||||
|
# === Validation Function ===
|
||||||
|
validate_packer() {
|
||||||
|
local input_path="$1"
|
||||||
|
local current_build_path current_build_vars os version
|
||||||
|
|
||||||
|
version=$(basename "$input_path")
|
||||||
|
os=$(basename "$(dirname "$input_path")")
|
||||||
|
|
||||||
|
echo -e "${BLUE}▶ Validating: ${YELLOW}${os^^} ${version}${NC}"
|
||||||
|
|
||||||
|
if echo "$input_path" | grep -qi "windows"; then
|
||||||
|
current_build_path=${input_path#"${SCRIPT_PATH}/builds/"}
|
||||||
|
current_build_vars="$(echo "${current_build_path%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
|
||||||
|
VAR_FILES=(
|
||||||
|
"$CONFIG_PATH/ansible.pkrvars.hcl"
|
||||||
|
"$CONFIG_PATH/build.pkrvars.hcl"
|
||||||
|
"$CONFIG_PATH/common.pkrvars.hcl"
|
||||||
|
"$CONFIG_PATH/network.pkrvars.hcl"
|
||||||
|
"$CONFIG_PATH/proxmox.pkrvars.hcl"
|
||||||
|
"$CONFIG_PATH/proxy.pkrvars.hcl"
|
||||||
|
"$CONFIG_PATH/$current_build_vars"
|
||||||
|
)
|
||||||
|
else
|
||||||
|
VAR_FILES=(
|
||||||
|
"$CONFIG_PATH/ansible.pkrvars.hcl"
|
||||||
|
"$CONFIG_PATH/build.pkrvars.hcl"
|
||||||
|
"$CONFIG_PATH/common.pkrvars.hcl"
|
||||||
|
"$CONFIG_PATH/linux-storage.pkrvars.hcl"
|
||||||
|
"$CONFIG_PATH/network.pkrvars.hcl"
|
||||||
|
"$CONFIG_PATH/proxmox.pkrvars.hcl"
|
||||||
|
"$CONFIG_PATH/proxy.pkrvars.hcl"
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if packer_output=$(packer validate "${VAR_FILES[@]/#/--var-file=}" "$input_path" 2>&1); then
|
||||||
|
echo -e " ${GREEN}✔ PASS${NC}"
|
||||||
|
summary+=("${os}/${version} : PASS")
|
||||||
|
else
|
||||||
|
echo -e " ${RED}✘ FAIL${NC}"
|
||||||
|
echo "$packer_output"
|
||||||
|
summary+=("${os}/${version} : FAIL")
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${NC}----------------------------------------"
|
||||||
|
}
|
||||||
|
|
||||||
|
# === Main Execution ===
|
||||||
|
echo -e "${BLUE}==> Starting Packer validations...${NC}"
|
||||||
|
for path in "${INPUT_PATHS[@]}"; do
|
||||||
|
validate_packer "$path"
|
||||||
|
done
|
||||||
|
|
||||||
|
# === Summary Output ===
|
||||||
|
echo -e "\n${BLUE}==> Validation Summary:${NC}"
|
||||||
|
for entry in "${summary[@]}"; do
|
||||||
|
if [[ "$entry" == *FAIL ]]; then
|
||||||
|
echo -e "${RED}$entry${NC}"
|
||||||
|
else
|
||||||
|
echo -e "${GREEN}$entry${NC}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
Reference in New Issue
Block a user