diff --git a/.gitignore b/.gitignore
index ffb3a23..41ffac3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ vbox/*
.scripts/*
.vscode/*
.snippets/*
+.obsoleted/*
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a3d2fc8..f2c040a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,9 +1,8 @@
variables:
packer_version: "1.9.2"
- dind: 20.10-dind
+ dind: 24.0-dind
build_alma8: "false"
build_alma9: "false"
- build_centos: "false"
build_rocky8: "false"
build_rocky9: "false"
build_oracle8: "false"
@@ -12,1046 +11,411 @@ variables:
build_ubuntu2204: "false"
build_windows2022_std: "false"
build_windows2022_dc: "false"
+ build_windows2019_std: "false"
+ build_windows2019_dc: "false"
+
+default:
+ artifacts:
+ expire_in: 1 hour
+ when: always
+ retry:
+ max: 2
+ when:
+ - runner_system_failure
+ - stuck_or_timeout_failure
+ - api_failure
stages:
- - get-packer
- - centos7-validate
- - alma8-validate
- - alma9-validate
- - rocky8-validate
- - rocky9-validate
- - oracle8-validate
- - oracle9-validate
- - ubuntu20-validate
- - windows2019-validate
- - windows2022-validate
- - ansible-lint
+ - alma-validate
+ - rocky-validate
+ - oracle-validate
+ - ubuntu-validate
+ - windows-validate
- install_packer
- - build_alma8
- - build_alma9
- - build_rocky8
- - build_rocky9
- - build_centos
- - build_oracle8
- - build_oracle9
- - build_ubuntu
- - build_windows2022
-get-packer:
- stage: get-packer
- image: hashicorp/packer:${packer_version}
- services:
- - docker:$dind
- artifacts:
- expire_in: 1d
- paths:
- - packer
- script:
- - pwd
- - cp -p /bin/packer ./packer
- tags:
- - docker
- - packer
-centos79:
- stage: centos7-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_centos7_g2.pkr.hcl"
- - export var_file="./variables/variables_centos79.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-centos79-docker:
- stage: centos7-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_centos7_g2_docker.pkr.hcl"
- - export var_file="./variables/variables_centos79.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-centos79-vagrant:
- stage: centos7-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_centos7_g2_vagrant.pkr.hcl"
- - export var_file="./variables/variables_centos79.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
+ - alma8-build
+ - alma9-build
+ - rocky8-build
+ - rocky9-build
+ - oracle8-build
+ - oracle9-build
+ - windows2022-build
+ - windows2019-build
+ - ubuntu2004-build
+ - ubuntu2204-build
+ # - ansible-lint
+
alma8:
- stage: alma8-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_almalinux8_g2.pkr.hcl"
- - export var_file="./variables/variables_almalinux86.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-alma8-vagrant:
- stage: alma8-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_almalinux8_g2_vagrant.pkr.hcl"
- - export var_file="./variables/variables_almalinux86.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-alma8-docker:
- stage: alma8-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_almalinux8_g2_docker.pkr.hcl"
- - export var_file="./variables/variables_almalinux86.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-alma9:
- stage: alma9-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_almalinux9_g2.pkr.hcl"
- - export var_file="./variables/variables_almalinux92.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-alma9-docker:
- stage: alma9-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_almalinux9_g2_docker.pkr.hcl"
- - export var_file="./variables/variables_almalinux92.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-alma9-vagrant:
- stage: alma9-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_almalinux9_g2_vagrant.pkr.hcl"
- - export var_file="./variables/variables_almalinux92.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-# Rocky 8
-rocky8:
- stage: rocky8-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_rockylinux8_g2.pkr.hcl"
- - export var_file="./variables/variables_rockylinux87.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-rocky8-vagrant:
- stage: rocky8-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_rockylinux8_g2_vagrant.pkr.hcl"
- - export var_file="./variables/variables_rockylinux87.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-rocky8-docker:
- stage: rocky8-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_rockylinux8_g2_docker.pkr.hcl"
- - export var_file="./variables/variables_rockylinux87.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-# Rocky 9
-rocky9:
- stage: rocky9-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_rockylinux9_g2.pkr.hcl"
- - export var_file="./variables/variables_rockylinux92.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-rocky9-docker:
- stage: rocky9-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_rockylinux9_g2_docker.pkr.hcl"
- - export var_file="./variables/variables_rockylinux92.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-rocky9-vagrant:
- stage: rocky9-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_rockylinux9_g2_vagrant.pkr.hcl"
- - export var_file="./variables/variables_rockylinux92.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-# Validate Oracle
-oracle8:
- stage: oracle8-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_oraclelinux8_g2.pkr.hcl"
- - export var_file="./variables/variables_oraclelinux86.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-oracle8-vagrant:
- stage: oracle8-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_oraclelinux8_g2_vagrant.pkr.hcl"
- - export var_file="./variables/variables_oraclelinux86.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-oracle8-docker:
- stage: oracle8-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_oraclelinux8_g2_docker.pkr.hcl"
- - export var_file="./variables/variables_oraclelinux86.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-# Oracle 9 Validate
-oracle9:
- stage: oracle9-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_oraclelinux9_g2.pkr.hcl"
- - export var_file="./variables/variables_oraclelinux92.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-oracle9-docker:
- stage: oracle9-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_oraclelinux9_g2_docker.pkr.hcl"
- - export var_file="./variables/variables_oraclelinux92.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-oracle9-vagrant:
- stage: oracle9-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_oraclelinux9_g2_vagrant.pkr.hcl"
- - export var_file="./variables/variables_oraclelinux92.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-# Ubuntu
-ubuntu2004:
- stage: ubuntu20-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_ubuntu2004_g2.pkr.hcl"
- - export var_file="./variables/variables_ubuntu2004.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-ubuntu2204:
- stage: ubuntu20-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_ubuntu2204_g2.pkr.hcl"
- - export var_file="./variables/variables_ubuntu2204.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-lts2019-std:
- stage: windows2019-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_win2019_g2.pkr.hcl"
- - export var_file="./variables/variables_win2019_std.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-lts2019-std-vagrant:
- stage: windows2019-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_win2019_g2_vagrant.pkr.hcl"
- - export var_file="./variables/variables_win2019_std.pkvars.hcl"
- - ./packer init config.pkr.hcl
+ stage: alma-validate
script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-lts2019-dc:
- stage: windows2019-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_win2019_g2.pkr.hcl"
- - export var_file="./variables/variables_win2019_dc.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-lts2019-dc-vagrant:
- stage: windows2019-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_win2019_g2_vagrant.pkr.hcl"
- - export var_file="./variables/variables_win2019_dc.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-# Windows Server 2022
-lts2022-std:
- stage: windows2022-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_win2022_g2.pkr.hcl"
- - export var_file="./variables/variables_win2022_std.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-lts2022-dc:
- stage: windows2022-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_win2022_g2.pkr.hcl"
- - export var_file="./variables/variables_win2022_dc.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-lts2022-std-vagrant:
- stage: windows2022-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_win2022_g2_vagrant.pkr.hcl"
- - export var_file="./variables/variables_win2022_std.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-lts2022-dc-vagrant:
- stage: windows2022-validate
- image: alpine
- services:
- - docker:$dind
- before_script:
- - export template_file="./templates/hv_win2022_g2_vagrant.pkr.hcl"
- - export var_file="./variables/variables_win2022_dc.pkvars.hcl"
- - ./packer init config.pkr.hcl
- script:
- - ./packer version --version
- - ./packer validate -var-file="$var_file" "$template_file"
- tags:
- - docker
- - packer
- needs:
- - get-packer
-ansible-lint:
- stage: ansible-lint
- image: ${PIPELINE_IMAGE}:${PIPELINE_IMAGE_TAG}
- allow_failure: true
- services:
- - docker:$dind
- before_script:
- - yamllint --version
- - ansible-lint --version
- script:
- - yamllint -c ./.yamllint ./extra/playbooks/*.yaml
- - yamllint -c ./.yamllint ./extra/playbooks/*.yml
- - ansible-lint ./extra/playbooks/*.yaml
- tags:
- - docker
- - packer
- needs:
- - get-packer
-# Here building starts
-# Install required packer choco package
-install_packer:
- variables:
- GIT_STRATEGY: none
- stage: install_packer
- before_script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff -Verbose"
- - Sleep 30
- - "Get-Vm -name packer-*|Remove-VM -Force"
- script:
- - choco upgrade packer --version $packer_version -y
- - packer --version
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - packer init config.pkr.hcl
+ - .\hv_generic.ps1 -Action verify -Version almalinux-8.8 -Template rhel -Log 0
tags:
- windows
- hyperv
-build_alma8:
- stage: build_alma8
+alma9:
+ stage: alma-validate
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff -Verbose"
- - Sleep 120
- - "Get-Vm -name packer-*|Remove-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
- packer init config.pkr.hcl
- - .\hv_almalinux86.ps1
- rules:
- - if: $build_alma8 == "true"
- when: on_success
+ - .\hv_generic.ps1 -Action verify -Version almalinux-9.2 -Template rhel -Log 0
tags:
- windows
- hyperv
-build_alma8_docker:
- stage: build_alma8
+rocky8:
+ stage: rocky-validate
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
- - Sleep 120
- - "Get-Vm -name packer-*|Remove-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
- packer init config.pkr.hcl
- - .\hv_almalinux86_docker.ps1
- rules:
- - if: $build_alma8 == "true"
- when: on_success
+ - .\hv_generic.ps1 -Action verify -Version rockylinux-8.8 -Template rhel -Log 0
tags:
- windows
- hyperv
- needs:
- - build_alma8
-build_alma8_vagrant:
- stage: build_alma8
+rocky9:
+ stage: rocky-validate
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
- - Sleep 120
- - "Get-Vm -name packer-*|Remove-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
- packer init config.pkr.hcl
- - .\hv_almalinux86_vagrant.ps1
- rules:
- - if: $build_alma8 == "true"
- when: on_success
+ - .\hv_generic.ps1 -Action verify -Version rockylinux-9.2 -Template rhel -Log 0
tags:
- windows
- hyperv
- needs:
- - build_alma8_docker
-build_alma9:
- stage: build_alma9
+oracle8:
+ stage: oracle-validate
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff -Verbose"
- - Sleep 120
- - "Get-Vm -name packer-*|Remove-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
- packer init config.pkr.hcl
- - .\hv_almalinux92.ps1
- rules:
- - if: $build_alma9 == "true"
- when: on_success
+ - .\hv_generic.ps1 -Action verify -Version oraclelinux-8.8 -Template rhel -Log 0
tags:
- windows
- hyperv
-build_alma9_docker:
- stage: build_alma9
+oracle9:
+ stage: oracle-validate
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
- - Sleep 120
- - "Get-Vm -name packer-*|Remove-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
- packer init config.pkr.hcl
- - .\hv_almalinux92_docker.ps1
- rules:
- - if: $build_alma9 == "true"
- when: on_success
+ - .\hv_generic.ps1 -Action verify -Version oraclelinux-9.2 -Template rhel -Log 0
tags:
- windows
- hyperv
- needs:
- - build_alma9
-build_alma9_vagrant:
- stage: build_alma9
+
+windows2022std:
+ stage: windows-validate
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
- - Sleep 120
- - "Get-Vm -name packer-*|Remove-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
- packer init config.pkr.hcl
- - .\hv_almalinux92_vagrant.ps1
- rules:
- - if: $build_alma9 == "true"
- when: on_success
+ - .\hv_generic.ps1 -Action verify -Version windows_server_2022_std -Template windows -Log 0
tags:
- windows
- hyperv
- needs:
- - build_alma9_docker
-# Rocky
-build_rocky8:
- stage: build_rocky8
+
+windows2022dc:
+ stage: windows-validate
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
- - Sleep 120
- - "Get-Vm -name packer-*|Remove-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
- packer init config.pkr.hcl
- - .\hv_rockylinux87.ps1
- rules:
- - if: $build_rocky8 == "true"
- when: on_success
+ - .\hv_generic.ps1 -Action verify -Version windows_server_2022_dc -Template windows -Log 0
tags:
- windows
- hyperv
-build_rocky8_docker:
- stage: build_rocky8
+
+windows2019std:
+ stage: windows-validate
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
- - Sleep 120
- - "Get-Vm -name packer-*|Remove-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
- packer init config.pkr.hcl
- - .\hv_rockylinux87_docker.ps1
- rules:
- - if: $build_rocky8 == "true"
- when: on_success
+ - .\hv_generic.ps1 -Action verify -Version windows_server_2019_std -Template windows -Log 0
tags:
- windows
- hyperv
- needs:
- - build_rocky8
-build_rocky8_vagrant:
- stage: build_rocky8
+
+windows2019dc:
+ stage: windows-validate
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
- - Sleep 120
- - "Get-Vm -name packer-*|Remove-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
- packer init config.pkr.hcl
- - .\hv_rockylinux87_vagrant.ps1
- rules:
- - if: $build_rocky8 == "true"
- when: on_success
+ - .\hv_generic.ps1 -Action verify -Version windows_server_2019_dc -Template windows -Log 0
tags:
- windows
- hyperv
- needs:
- - build_rocky8_docker
-# Rocky 9
-build_rocky9:
- stage: build_rocky9
+
+
+ubuntu2004:
+ stage: ubuntu-validate
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
- - Sleep 120
- - "Get-Vm -name packer-*|Remove-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
- packer init config.pkr.hcl
- - .\hv_rockylinux92.ps1
- rules:
- - if: $build_rocky9 == "true"
- when: on_success
+ - .\hv_generic.ps1 -Action verify -Version ubuntu-20.04 -Template ubuntu -Log 0
tags:
- windows
- hyperv
-build_rocky9_docker:
- stage: build_rocky9
+
+ubuntu2204:
+ stage: ubuntu-validate
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
- - Sleep 120
- - "Get-Vm -name packer-*|Remove-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
- packer init config.pkr.hcl
- - .\hv_rockylinux92_docker.ps1
- rules:
- - if: $build_rocky9 == "true"
- when: on_success
+ - .\hv_generic.ps1 -Action verify -Version ubuntu-22.04 -Template ubuntu -Log 0
tags:
- windows
- hyperv
- needs:
- - build_rocky9
-build_rocky9_vagrant:
- stage: build_rocky9
- script:
+
+# ansible-lint:
+# stage: ansible-lint
+# image: ${PIPELINE_IMAGE}:${PIPELINE_IMAGE_TAG}
+# allow_failure: true
+# services:
+# - docker:$dind
+# before_script:
+# - yamllint --version
+# - ansible-lint --version
+# script:
+# - yamllint -c ./.yamllint ./extra/playbooks/*.yaml
+# - yamllint -c ./.yamllint ./extra/playbooks/*.yml
+# - ansible-lint ./extra/playbooks/*.yaml
+# tags:
+# - docker
+# - packer
+# needs:
+# - get-packer
+
+# Here building starts
+# Install required packer choco package
+install_packer:
+ variables:
+ GIT_STRATEGY: none
+ stage: install_packer
+ before_script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
- - Sleep 120
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff -Verbose"
+ - Sleep 30
- "Get-Vm -name packer-*|Remove-VM -Force"
- - packer init config.pkr.hcl
- - .\hv_rockylinux92_vagrant.ps1
- rules:
- - if: $build_rocky9 == "true"
- when: on_success
+ script:
+ - choco upgrade packer --version $packer_version -y
+ - packer --version
tags:
- windows
- hyperv
- needs:
- - build_rocky9_docker
-# Build Oracle
-build_oracle8:
- stage: build_oracle8
+alma8_build:
+ stage: alma8-build
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- packer init config.pkr.hcl
- - .\hv_oraclelinux86.ps1
+ - .\hv_generic.ps1 -Action build -Version almalinux-8.8 -Template rhel -Log 0
rules:
- - if: $build_oracle8 == "true"
+ - if: $build_alma8 == "true"
when: on_success
tags:
- windows
- hyperv
-build_oracle8_docker:
- stage: build_oracle8
+
+alma9_build:
+ stage: alma9-build
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- packer init config.pkr.hcl
- - .\hv_oraclelinux86_docker.ps1
+ - .\hv_generic.ps1 -Action build -Version almalinux-9.2 -Template rhel -Log 0
rules:
- - if: $build_oracle8 == "true"
+ - if: $build_alma9 == "true"
when: on_success
tags:
- windows
- hyperv
- needs:
- - build_oracle8
-build_oracle8_vagrant:
- stage: build_oracle8
+rocky8_build:
+ stage: rocky8-build
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- packer init config.pkr.hcl
- - .\hv_oraclelinux86_vagrant.ps1
+ - .\hv_generic.ps1 -Action build -Version rockylinux-8.8 -Template rhel -Log 0
rules:
- - if: $build_oracle8 == "true"
+ - if: $build_rocky8 == "true"
when: on_success
tags:
- windows
- hyperv
- needs:
- - build_oracle8
-# Oracle 9
-build_oracle9:
- stage: build_oracle9
+rocky9_build:
+ stage: rocky9-build
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- packer init config.pkr.hcl
- - .\hv_oraclelinux92.ps1
+ - .\hv_generic.ps1 -Action build -Version rockylinux-9.2 -Template rhel -Log 0
rules:
- - if: $build_oracle9 == "true"
+ - if: $build_rocky9 == "true"
when: on_success
tags:
- windows
- hyperv
-build_oracle9_docker:
- stage: build_oracle9
+oracle8_build:
+ stage: oracle8-build
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- packer init config.pkr.hcl
- - .\hv_oraclelinux92_docker.ps1
+ - .\hv_generic.ps1 -Action build -Version oraclelinux-8.8 -Template rhel -Log 0
rules:
- - if: $build_oracle9 == "true"
+ - if: $build_oracle8 == "true"
when: on_success
tags:
- windows
- hyperv
- needs:
- - build_oracle9
-build_oracle9_vagrant:
- stage: build_oracle9
+oracle9_build:
+ stage: oracle9-build
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- packer init config.pkr.hcl
- - .\hv_oraclelinux92_vagrant.ps1
+ - .\hv_generic.ps1 -Action build -Version oraclelinux-9.2 -Template rhel -Log 0
rules:
- if: $build_oracle9 == "true"
when: on_success
tags:
- windows
- hyperv
- needs:
- - build_oracle9
-# CentOS
-build_centos:
- stage: build_centos
+windows2022_std_build:
+ stage: windows2022-build
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- packer init config.pkr.hcl
- - .\hv_centos79.ps1
+ - .\hv_generic.ps1 -Action build -Version windows_server_2022_std -Template windows -Log 0
rules:
- - if: $build_centos == "true"
+ - if: $build_windows2022_std == "true"
when: on_success
+ needs:
+ - install_packer
tags:
- windows
- hyperv
-build_centos_docker:
- stage: build_centos
+
+windows2022_dc_build:
+ stage: windows2022-build
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- packer init config.pkr.hcl
- - .\hv_centos79_docker.ps1
+ - .\hv_generic.ps1 -Action build -Version windows_server_2022_dc -Template windows -Log 0
rules:
- - if: $build_centos == "true"
+ - if: $build_windows2022_dc == "true"
when: on_success
tags:
- windows
- hyperv
needs:
- - build_centos
-build_centos_vagrant:
- stage: build_centos
+ - install_packer
+
+windows2019_std_build:
+ stage: windows2019-build
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- packer init config.pkr.hcl
- - .\hv_centos79_vagrant.ps1
+ - .\hv_generic.ps1 -Action build -Version windows_server_2019_std -Template windows -Log 0
rules:
- - if: $build_centos == "true"
+ - if: $build_windows2019_std == "true"
when: on_success
- tags:
- - windows
- - hyperv
needs:
- - build_centos_docker
-# Ubuntu
-build_ubuntu2004:
- stage: build_ubuntu
- script:
- - pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
- - Sleep 120
- - "Get-Vm -name packer-*|Remove-VM -Force"
- - packer init config.pkr.hcl
- - .\hv_ubuntu2004.ps1
- rules:
- - if: $build_ubuntu2004 == "true"
- when: on_success
+ - install_packer
tags:
- windows
- hyperv
-build_ubuntu2204:
- stage: build_ubuntu
+
+windows2019_dc_build:
+ stage: windows2019-build
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- packer init config.pkr.hcl
- - .\hv_ubuntu2204.ps1
+ - .\hv_generic.ps1 -Action build -Version windows_server_2019_dc -Template windows -Log 0
rules:
- - if: $build_ubuntu2204 == "true"
+ - if: $build_windows2019_dc == "true"
when: on_success
tags:
- windows
- hyperv
-# build windows 2022 std
-build_windows_2022_std:
- stage: build_windows2022
+ needs:
+ - install_packer
+
+ubuntu2004_build:
+ stage: ubuntu2004-build
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- packer init config.pkr.hcl
- - .\hv_win2022_std.ps1
+ - .\hv_generic.ps1 -Action build -Version ubuntu-20.04 -Template ubuntu -Log 0
rules:
- - if: $build_windows2022_std == "true"
+ - if: $build_ubuntu2004 == "true"
when: on_success
tags:
- windows
- hyperv
-build_windows_2022_dc:
- stage: build_windows2022
+ needs:
+ - install_packer
+
+ubuntu2204_build:
+ stage: ubuntu2204-build
script:
- pwd
- - '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- - "Get-Vm -name packer-*|Stop-VM -Force"
+ - '$env:PACKER_CACHE_DIR="d:\packer_cache"'
+ - "Get-Vm -name packer-*|Stop-VM -Force -TurnOff"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- packer init config.pkr.hcl
- - .\hv_win2022_dc.ps1
+ - .\hv_generic.ps1 -Action build -Version ubuntu-22.04 -Template ubuntu -Log 0
rules:
- - if: $build_windows2022_dc == "true"
+ - if: $build_ubuntu2204 == "true"
when: on_success
tags:
- windows
- hyperv
+ needs:
+ - install_packer
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 588bac0..af92638 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,50 +1,16 @@
# Changelog
-## Version 2.0.2 2023-07-26
-
-Codename: BAD - [https://www.youtube.com/watch?v=dsUXAEzaC3Q](https://www.youtube.com/watch?v=dsUXAEzaC3Q)
-
-* [BREAKING_CHANGE] for packer >= 1.9.0 hyperv-iso module was moved from core to plugins. Proper change was already set in `config.pkr.hcl`, but you have to remember to run `packer init --upgrade config.pkr.hcl` before running `packer build` command
-
- ```hcl
- packer {
- required_plugins {
- windows-update = {
- version = "0.14.1"
- source = "github.com/rgl/windows-update"
- }
- hyperv = {
- version = ">= 1.1.0"
- source = "github.com/hashicorp/hyperv"
- }
- }
- }
- ```
-
-* [Extra] `extra` scripts and playbooks optimizations
-* [Extra] `ks.cgf` files for all RHEL 9 clones - switching timezone to UTC during build
-* [Extra] ansible-lint fixes over playbooks
-* [Extra] resized partitions (/boot and /boot/EFI) to fit bigger kernel and initrd files as well as more kernels in Oracle Linux UEK. This will allow for UEK an standard kernels to coexist.
-
- ```ini
- part /boot/efi --fstype="vfat" --size=400
-
- part /boot --fstype="ext4" --size=2048
-
- part swap --fstype="swap" --size=8192
-
- part / --fstype="ext4" --grow --size=1
- ```
-
-* [RockyLinux] added `RockyLinux 9.2` support
-* [RockyLinux] added `RockyLinux 9.2` Docker support
-* [RockyLinux] added `RockyLinux 9.2` Vagrant support
-* [OracleLinux] added `OracleLinux 9.2` support
-* [OracleLinux] added `OracleLinux 9.2` Docker support
-* [OracleLinux] added `OracleLinux 9.2` Vagrant support
-* [AlmaLinux] added `AlmaLinux 9.2` support
-* [AlmaLinux] added `AlmaLinux 9.2` Docker support
-* [AlmaLinux] added `AlmaLinux 9.2` Vagrant support
+## Version 3.0.0 2023-09-16
+
+* [BREAKING_CHANGE] complete redesign of building process. Instead od separate scripts now you're presented with generic `hv_generic.ps1` script run with proper parameters. This will allow for easier maintenance and less clutter in repository
+* [BREAKING_CHANGE] complete redesign of `extra` folder structure. Instead of primary structure based on hypervisor, current structure focuses on OS type, then if needed on hypervisor or cloud model. This will allow for easier maintenance and less clutter in repository
+* [BREAKING_CHANGE] complete redesign of Windows Update process. Instead of Nuget-based module, now we're presented with packer `windows-update` plugin. This will allow for easier maintenance and less clutter in repository
+* [BREAKING_CHANGE] complete redesing of templates. Instead of separate files for each template, now we're presented with generic family template (windows/rhel/ubuntu) This will allow for easier maintenance and less clutter in repository. Since packer doesn't support conditions, we're using `empty` resources to change its flow.
+* [BREAKING_CHANGE] dropping support for Vagrant builds. This can be introduced later, but for now, these builds are removed.
+* [BREAKING_CHANGE] dropping support for extra volumes for Docker. This is related both with removal of Docker from Kubernetes in favor of containerd, which forces different paths for containers.
+* [BREAKING_CHANGE] dropping customization image tendencies. We'll try to generate images as much generic as possible, without ground changes in them. Non-generic changes like adding Zabbix or Puppet will be removed in next releases, as I do believe this is not the `Packer's` role.
+* [BREAKING_CHANGE] dropping support for CentOS 7.x
+* [BREAKING_CHANGE] dropping support for Windows Server 2016
## Version 2.0.1 2022-12-20
diff --git a/README.md b/README.md
index d96ea68..110f18c 100644
--- a/README.md
+++ b/README.md
@@ -3,13 +3,14 @@
![RockyLinux](https://img.shields.io/badge/Linux-Rocky-brightgreen)
![OracleLinux](https://img.shields.io/badge/Linux-Oracle-brightgreen)
![AlmaLinux](https://img.shields.io/badge/Linux-Alma-brightgreen)
-![CentosLinux](https://img.shields.io/badge/Linux-CentOS-brightgreen)
![UbuntuLinux](https://img.shields.io/badge/Linux-Ubuntu-orange)
-
-![Windows2016](https://img.shields.io/badge/Windows-2016-blue)
![Windows2019](https://img.shields.io/badge/Windows-2019-blue)
![Windows2022](https://img.shields.io/badge/Windows-2022-blue)
+[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/marcinbojko)
+
+Consider buying me a coffee if you like my work. All donations are appreciated. All donations will be used to pay for pipeline running costs
+
- [Set of Hashicorp's Packer templates to create Microsoft Hyper-V virtual machines](#set-of-hashicorps-packer-templates-to-create-microsoft-hyper-v-virtual-machines)
@@ -17,72 +18,27 @@
- [Requirements - Quick Start](#requirements---quick-start)
- [Install packer from Chocolatey](#install-packer-from-chocolatey)
- [Install required plugins](#install-required-plugins)
- - [Install vagrant from Chocolatey](#install-vagrant-from-chocolatey)
- [Use account with Administrator privileges for Hyper-V](#use-account-with-administrator-privileges-for-hyper-v)
- [Add firewal exclusions for TCP ports 8000-9000 default range](#add-firewal-exclusions-for-tcp-ports-8000-9000-default-range)
- [Adjust Hyper-V settings](#adjust-hyper-v-settings)
- [Default passwords](#default-passwords)
- - [Enable Packer debug logging](#enable-packer-debug-logging)
- [Scripts](#scripts)
- [Windows Machines](#windows-machines)
- [Linux Machines](#linux-machines)
- [Ansible Playbooks CentOS/AlmaLinux/RockyLinux/OracleLinux](#ansible-playbooks-centosalmalinuxrockylinuxoraclelinux)
- - [Templates Windows 2022](#templates-windows-2022)
- - [Hyper-V Generation 2 Windows Server 2022 Standard Image](#hyper-v-generation-2-windows-server-2022-standard-image)
- - [Windows 2022 Standard Generation 2 Prerequisites](#windows-2022-standard-generation-2-prerequisites)
- - [Hyper-V Generation 2 Windows Server 2022 Datacenter Image](#hyper-v-generation-2-windows-server-2022-datacenter-image)
- - [Windows 2022 Datacenter Generation 2 Prerequisites](#windows-2022-datacenter-generation-2-prerequisites)
- - [[Experimental] Hyper-V generation 2 Windows Server 2022 Standard Vagrant support](#experimental-hyper-v-generation-2-windows-server-2022-standard-vagrant-support)
- - [[Experimental] Hyper-V generation 2 Windows Server 2022 Datacenter Vagrant support](#experimental-hyper-v-generation-2-windows-server-2022-datacenter-vagrant-support)
- - [Templates Windows 2019](#templates-windows-2019)
- - [Hyper-V Generation 2 Windows Server 2019 Standard Image](#hyper-v-generation-2-windows-server-2019-standard-image)
- - [Windows 2019 Standard Generation 2 Prerequisites](#windows-2019-standard-generation-2-prerequisites)
- - [Hyper-V Generation 2 Windows Server 2019 Datacenter Image](#hyper-v-generation-2-windows-server-2019-datacenter-image)
- - [Windows 2019 Datacenter Generation 2 Prerequisites](#windows-2019-datacenter-generation-2-prerequisites)
- - [[Experimental] Hyper-V generation 2 Windows Server 2019 Standard Vagrant support](#experimental-hyper-v-generation-2-windows-server-2019-standard-vagrant-support)
- - [[Experimental] Hyper-V generation 2 Windows Server 2019 Datacenter Vagrant support](#experimental-hyper-v-generation-2-windows-server-2019-datacenter-vagrant-support)
- - [Templates Windows 2016](#templates-windows-2016)
- - [Hyper-V Generation 2 Windows Server 2016 Standard Image](#hyper-v-generation-2-windows-server-2016-standard-image)
- - [Windows 2016 Standard Generation 2 Prerequisites](#windows-2016-standard-generation-2-prerequisites)
- - [Templates Ubuntu](#templates-ubuntu)
- - [Warnings - Ubuntu 20.x](#warnings---ubuntu-20x)
- - [Hyper-V Generation 2 Ubuntu 20.04 Image](#hyper-v-generation-2-ubuntu-2004-image)
- - [Hyper-V Generation 2 Ubuntu 22.04 Image](#hyper-v-generation-2-ubuntu-2204-image)
- - [Templates RockyLinux 8.x](#templates-rockylinux-8x)
- - [Warnings - RockyLinux 8](#warnings---rockylinux-8)
- - [Hyper-V Generation 2 RockyLinux 8.7 Image](#hyper-v-generation-2-rockylinux-87-image)
- - [Hyper-V Generation 2 RockyLinux 8.7 Vagrant support](#hyper-v-generation-2-rockylinux-87-vagrant-support)
- - [Hyper-V Generation 2 RockyLinux 8.6 image with extra docker volume](#hyper-v-generation-2-rockylinux-86-image-with-extra-docker-volume)
- - [Templates Rocky Linux 9](#templates-rocky-linux-9)
- - [Warnings - RockyLinux 9](#warnings---rockylinux-9)
- - [Hyper-V Generation 2 RockyLinux 9.2 Image](#hyper-v-generation-2-rockylinux-92-image)
- - [Hyper-V Generation 2 RockyLinux 9.2 Vagrant support](#hyper-v-generation-2-rockylinux-92-vagrant-support)
- - [Hyper-V Generation 2 RockyLinux 9.0 image with extra docker volume](#hyper-v-generation-2-rockylinux-90-image-with-extra-docker-volume)
- - [Templates OracleLinux 8.x](#templates-oraclelinux-8x)
- - [Warnings - OracleLinux 8](#warnings---oraclelinux-8)
- - [Hyper-V Generation 2 OracleLinux 8.6 Image](#hyper-v-generation-2-oraclelinux-86-image)
- - [Hyper-V Generation 2 OracleLinux 8.6 Vagrant support](#hyper-v-generation-2-oraclelinux-86-vagrant-support)
- - [Hyper-V Generation 2 OracleLinux 8.6 image with extra docker volume](#hyper-v-generation-2-oraclelinux-86-image-with-extra-docker-volume)
- - [Templates OracleLinux 9.x](#templates-oraclelinux-9x)
- - [Warnings - OracleLinux 9](#warnings---oraclelinux-9)
- - [Hyper-V Generation 2 OracleLinux 9.2 Image](#hyper-v-generation-2-oraclelinux-92-image)
- - [Hyper-V Generation 2 OracleLinux 9.2 Vagrant support](#hyper-v-generation-2-oraclelinux-92-vagrant-support)
- - [Hyper-V Generation 2 OracleLinux 9.2 image with extra docker volume](#hyper-v-generation-2-oraclelinux-92-image-with-extra-docker-volume)
- - [Templates AlmaLinux 8.x](#templates-almalinux-8x)
- - [Warnings - AlmaLinux 8](#warnings---almalinux-8)
- - [Hyper-V Generation 2 AlmaLinux 8.6 Image](#hyper-v-generation-2-almalinux-86-image)
- - [Hyper-V Generation 2 AlmaLinux 8.6 Vagrant support](#hyper-v-generation-2-almalinux-86-vagrant-support)
- - [Hyper-V Generation 2 AlmaLinux 8.6 image with extra docker volume](#hyper-v-generation-2-almalinux-86-image-with-extra-docker-volume)
- - [Templates AlmaLinux 9.x](#templates-almalinux-9x)
- - [Warnings - AlmaLinux 9](#warnings---almalinux-9)
- - [Hyper-V Generation 2 AlmaLinux 9.2 Image](#hyper-v-generation-2-almalinux-92-image)
- - [Hyper-V Generation 2 AlmaLinux 9.2 Vagrant support](#hyper-v-generation-2-almalinux-92-vagrant-support)
- - [Hyper-V Generation 2 AlmaLinux 9.2 image with extra docker volume](#hyper-v-generation-2-almalinux-92-image-with-extra-docker-volume)
- - [Templates CentOS 7.x](#templates-centos-7x)
- - [Warnings - CentOS Docker](#warnings---centos-docker)
- - [Hyper-V Generation 2 CentOS 7.9](#hyper-v-generation-2-centos-79)
- - [Hyper-V Generation 2 CentOS 7.9 Image with extra docker volume](#hyper-v-generation-2-centos-79-image-with-extra-docker-volume)
- - [Hyper-V Generation 2 CentOS 7.9 Vagrant support](#hyper-v-generation-2-centos-79-vagrant-support)
+ - [Usage](#usage)
+ - [hv_generic.ps1 parameters](#hv_genericps1-parameters)
+ - [Building Microsoft Windows](#building-microsoft-windows)
+ - [Building iso files needed for provisioning](#building-iso-files-needed-for-provisioning)
+ - [Examples for Windows](#examples-for-windows)
+ - [Building AlmaLinux Machines](#building-almalinux-machines)
+ - [Examples for AlmaLinux](#examples-for-almalinux)
+ - [Building RockyLinux Machines](#building-rockylinux-machines)
+ - [Examples for RockyLinux](#examples-for-rockylinux)
+ - [Building OracleLinux Machines](#building-oraclelinux-machines)
+ - [Examples for OracleLinux](#examples-for-oraclelinux)
+ - [Building Ubuntu Machines](#building-ubuntu-machines)
+ - [Examples for Ubuntu](#examples-for-ubuntu)
- [Known issues](#known-issues)
- [I have general problem not covered here](#i-have-general-problem-not-covered-here)
- [I'd like to contribute](#id-like-to-contribute)
@@ -123,11 +79,11 @@ In root folder of a repository
packer init --upgrade config.pkr.hcl
```
-### Install vagrant from Chocolatey
+
### Use account with Administrator privileges for Hyper-V
@@ -156,23 +112,10 @@ switch_name = "vSwitch"
|OS|username|password|
|--|--------|--------|
|Windows|Administrator|password|
-||vagrant|vagrant|
|CentOS/RHEL|root|password|
-||vagrant|vagrant|
|Ubuntu|ubuntu|password|
-||vagrant|vagrant|
|||
-### Enable Packer debug logging
-
-Soon to be parametrized
-
-In building script set `packet_log` variable to 1
-
-```powershell
-$packer_log=1
-```
-
## Scripts
### Windows Machines
@@ -181,15 +124,12 @@ $packer_log=1
- latest version of chocolatey
- packages from a list below:
- |Package|Version|
- |-------|-------|
- |conemu|latest|
- |dotnetfx|latest|
- |sysinternals|latest|
- |puppet|7.14.0|
- |tabby|latest|
+ |Package|Version|Mandatory/Optional|
+ |-------|-------|------------------|
+ |dotnetfx|latest|Mandatory|
+ |sysinternals|latest|Mandatory|
+ |tabby|latest|Optional|
-- latest Nuget poweshell module
- `phase3.ps1` Puppet agent settings will be customized (`server=foreman.example.com`) with parameters:
- `Version` - puppet chocolatey version, for example "6.26.0"
- `AddPrivateChoco` ($true/$false) - if set to true, private MyGet repository will be added as `public`
@@ -215,20 +155,17 @@ $packer_log=1
- Repositories:
- |Repository|Package|switch|
- |----------|------------|---|
- |Epel 7/8/9|epel-release|can be switched off by setting "install_epel" to `false`|
- |Zabbix 6.0|zabbix-agent|can be switched on by setting "install_zabbix" to `true`|
- |Puppet 7 |puppet-agent|can be switched off by setting "install_puppet" to false|
- |Webmin |webmin|can be switched on by setting "install_webmin" to `false`|
- |Cockpit |cockpit|can be switched on by setting "install_zabbix" to `true`|
- |Hyper-V |SCVMM Agent|can be switched off by setting "install_hyperv" to `false`|
- |Neofetch |neofetch|can be switched off by setting "install_neofetch" to `false`|
+ |Repository|Package|switch|default
+ |----------|------------|---|---|
+ |Epel 7/8/9|epel-release|can be switched off by setting "install_epel" to `false`|true|
+ |Zabbix 6.0|zabbix-agent|can be switched on by setting "install_zabbix" to `true`|false|
+ |Puppet 7 |puppet-agent|can be switched off by setting "install_puppet" to false|false|
+ |Webmin |webmin|can be switched on by setting "install_webmin" to `false`|false|
+ |Cockpit |cockpit|can be switched on by setting "install_zabbix" to `true`|true|
+ |Hyper-V |SCVMM Agent|can be switched off by setting "install_hyperv" to `false`|true|
+ |Neofetch |neofetch|can be switched off by setting "install_neofetch" to `false`|true|
||||
-- [Optional] Linux machine with separated disk for docker
-- [Optional] Linux machine for vagrant
-
Be aware, turning off latest System Center Virtual Machine Agent will cause System Center fail to deploy machines
#### Ansible Playbooks (CentOS/AlmaLinux/RockyLinux/OracleLinux)
@@ -257,18 +194,22 @@ extra_device: "" # prepare mkfs and mount extra block device
install_motd: true # install motd (neofetch run)
```
-## Templates Windows 2022
+## Usage
+
+Building machines is realised through a dedicated script `hv_generic.ps1` with proper parameters.
-### Hyper-V Generation 2 Windows Server 2022 Standard Image
+### `hv_generic.ps1` parameters
-Run `hv_win2022_std.ps1` (Windows)
+### Building Microsoft Windows
-#### Windows 2022 Standard Generation 2 Prerequisites
+#### Building iso files needed for provisioning
For Generation 2 prepare `secondary.iso` with folder structure:
-- ./extra/files/gen2-2022/std/Autounattend.xml => /Autounattend.xml
+```example
+- ./extra/files/windows/2022/std/Autounattend.xml => /Autounattend.xml
- ./extra/scripts/hyper-v/bootstrap.ps1 => /bootstrap.ps1
+```
This template uses this image name in Autounattendes.xml. If youre using different ISO you'll have to adjust that part in proper file and rebuild `secondary.iso` image.
@@ -281,310 +222,96 @@ This template uses this image name in Autounattendes.xml. If youre using differe
```
-### Hyper-V Generation 2 Windows Server 2022 Datacenter Image
-
-Run `hv_win2022_dc.ps1` (Windows)
+|Action|Version|Template|Log|OS|
+|-------|-------|--------|---|-|
+|`build`|windows_server_2019_std|windows|0/1|Microsoft Server 2019 Standard|
+|`build`|windows_server_2019_dc|windows|0/1|Microsoft Server 2019 Datacenter|
+|`build`|windows_server_2022_std|windows|0/1|Microsoft Server 2022 Standard|
+|`build`|windows_server_2022_dc|windows|0/1|Microsoft Server 2022 Datacenter|
-#### Windows 2022 Datacenter Generation 2 Prerequisites
+#### Examples for Windows
-For Generation 2 prepare `secondary.iso` with folder structure:
-
-- ./extra/files/gen2-2022/dc/Autounattend.xml => /Autounattend.xml
-- ./extra/scripts/hyper-v/bootstrap.ps1 => /bootstrap.ps1
+```powershell
-This template uses this image name in Autounattendes.xml. If youre using different ISO you'll have to adjust that part in proper file and rebuild `secondary.iso` image.
+Example for Windows 2019 Standard
-```xml
-
-
- /IMAGE/NAME
- Windows Server 2022 SERVERDATACENTER
-
-
+```powershell
+./hv_generic.ps1 -Action build -Version windows_server_2019_std -Template windows -Log 0
```
-### [Experimental] Hyper-V generation 2 Windows Server 2022 Standard Vagrant support
+Example for Windows 2019 Datacenter
```powershell
-hv_win2022_std_vagrant.ps1
+./hv_generic.ps1 -Action build -Version windows_server_2019_dc -Template windows -Log 0
```
-### [Experimental] Hyper-V generation 2 Windows Server 2022 Datacenter Vagrant support
+Example for Windows 2022 Standard
```powershell
-hv_win2022_dc_vagrant.ps1
+./hv_generic.ps1 -Action build -Version windows_server_2022_std -Template windows -Log 0
```
-## Templates Windows 2019
-
-### Hyper-V Generation 2 Windows Server 2019 Standard Image
+Example for Windows 2022 Datacenter
-Run `hv_win2019_std.ps1` (Windows)
-
-#### Windows 2019 Standard Generation 2 Prerequisites
-
-For Generation 2 prepare `secondary.iso` with folder structure:
-
-- ./extra/files/gen2-2019/std/Autounattend.xml => /Autounattend.xml
-- ./extra/scripts/hyper-v/bootstrap.ps1 => /bootstrap.ps1
-
-This template uses this image name in Autounattendes.xml. If youre using different ISO you'll have to adjust that part in proper file and rebuild `secondary.iso` image.
-
-```xml
-
-
- /IMAGE/NAME
- Windows Server 2019 SERVERSTANDARD
-
-
+```powershell
+./hv_generic.ps1 -Action build -Version windows_server_2022_dc -Template windows -Log 0
```
-### Hyper-V Generation 2 Windows Server 2019 Datacenter Image
-
-Run `hv_win2019_dc.ps1` (Windows)
-
-#### Windows 2019 Datacenter Generation 2 Prerequisites
-
-For Generation 2 prepare `secondary.iso` with folder structure:
+### Building AlmaLinux Machines
-- ./extra/files/gen2-2019/dc/Autounattend.xml => /Autounattend.xml
-- ./extra/scripts/hyper-v/bootstrap.ps1 => /bootstrap.ps1
+|Action|Version|Template|Log|OS|
+|-------|-------|--------|---|-|
+|`build`|almalinux-8.8|rhel|0/1|Alma Linux 8.8|
+|`build`|almalinux-9.2|rhel|0/1|Alma Linux 9.2|
-This template uses this image name in Autounattendes.xml. If youre using different ISO you'll have to adjust that part in proper file and rebuild `secondary.iso` image.
+#### Examples for AlmaLinux
-```xml
-
-
- /IMAGE/NAME
- Windows Server 2019 SERVERDATACENTER
-
-
+```powershell
+.\hv_generic.ps1 -Action build -Version almalinux-8.8 -Template rhel -Log 0
+.\hv_generic.ps1 -Action build -Version almalinux-9.2 -Template rhel -Log 0
```
-### [Experimental] Hyper-V generation 2 Windows Server 2019 Standard Vagrant support
+### Building RockyLinux Machines
-```powershell
-hv_win2019_std_vagrant.ps1
-```
+|Action|Version|Template|Log|OS|
+|-------|-------|--------|---|-|
+|`build`|rockylinux-8.8|rhel|0/1|Rocky Linux 8.8|
+|`build`|rockyinux-9.2|rhel|0/1|Rocky Linux 9.2|
-### [Experimental] Hyper-V generation 2 Windows Server 2019 Datacenter Vagrant support
+#### Examples for RockyLinux
```powershell
-hv_win2019_dc_vagrant.ps1
+.\hv_generic.ps1 -Action build -Version rockylinux-8.8 -Template rhel -Log 0
+.\hv_generic.ps1 -Action build -Version rockylinux-9.2 -Template rhel -Log 0
```
-## Templates Windows 2016
-
-### Hyper-V Generation 2 Windows Server 2016 Standard Image
-
-Run `hv_win2016_std.ps1` (Windows)
+### Building OracleLinux Machines
-#### Windows 2016 Standard Generation 2 Prerequisites
+|Action|Version|Template|Log|OS|
+|-------|-------|--------|---|-|
+|`build`|oraclelinux-8.8|rhel|0/1|Oracle Linux 8.8|
+|`build`|oraclelinux-9.2|rhel|0/1|Oracle Linux 9.2|
-For Generation 2 prepare `secondary.iso` with folder structure:
-
-- ./extra/files/gen2-2016/Autounattend.xml => /Autounattend.xml
-- ./extra/scripts/hyper-v/bootstrap.ps1 => /bootstrap.ps1
-
-This template uses this image name in Autounattendes.xml. If youre using different ISO you'll have to adjust that part in proper file and rebuild `secondary.iso` image.
+#### Examples for OracleLinux
-```xml
-
-
- /IMAGE/NAME
- Windows Server 2016 SERVERSTANDARD
-
-
+```powershell
+.\hv_generic.ps1 -Action build -Version oraclelinux-8.8 -Template rhel -Log 0
+.\hv_generic.ps1 -Action build -Version oraclelinux-9.2 -Template rhel -Log 0
```
-## Templates Ubuntu
-
-### Warnings - Ubuntu 20.x
+### Building Ubuntu Machines
-- if required change `switch_name` parameter to switch's name you're using. In most situations packer manages it fine but there were a cases when it created new 'internal' switches without access to Internet. By design this setup will fail to download and apply updates.
-- if needed - change `iso_url` variable to a proper iso name
-- packer generates v8 machine configuration files (Windows 2016/Hyper-V 2016 as host) and v9 for Windows Server 2019/Windows 10 1809
-- credentials for Windows machines: Administrator/password (removed after sysprep)
-- credentials for Linux machines: root/password
-- for Windows based machines adjust your settings in ./scripts/phase-2.ps1
-- for Linux based machines adjust your settings in ./files/gen2-{{os}}/provision.sh and ./files/gen2-{{os}}/puppet.conf
+|Action|Version|Template|Log|OS|
+|-------|-------|--------|---|-|
+|`build`|ubuntu-20.04|ubuntu|0/1|Ubuntu 20.04|
+|`build`|ubuntu-22.04|ubuntu|0/1|Ubuntu 22.04|
-### Hyper-V Generation 2 Ubuntu 20.04 Image
+#### Examples for Ubuntu
-Run `hv_ubuntu2004.ps1`
-
-### Hyper-V Generation 2 Ubuntu 22.04 Image
-
-Run `hv_ubuntu2204.ps1`
-
-## Templates RockyLinux 8.x
-
-### Warnings - RockyLinux 8
-
-- if required change `switch_name` parameter to switch's name you're using. In most situations packer manages it fine but there were a cases when it created new 'internal' switches without access to Internet. By design this setup will fail to download and apply updates.
-- if needed - change `iso_url` variable to a proper iso name
-- packer generates v8 machine configuration files (Windows 2016/Hyper-V 2016 as host) and v9 for Windows Server 2019/Windows 10 1809
-- credentials for Windows machines: Administrator/password (removed after sysprep)
-- credentials for Linux machines: root/password
-- for Windows based machines adjust your settings in ./scripts/phase-2.ps1
-- for Linux based machines adjust your settings in ./files/gen2-centos/provision.sh and ./files/gen2-centos/puppet.conf
-
-### Hyper-V Generation 2 RockyLinux 8.7 Image
-
-Run `hv_rockylinux87.ps1`
-
-### Hyper-V Generation 2 RockyLinux 8.7 Vagrant support
-
-Run `hv_rockylinux87_vagrant.ps1` for RockyLinux 8.7
-
-### Hyper-V Generation 2 RockyLinux 8.6 image with extra docker volume
-
-Run `hv_rockylinux87_docker.ps1` for RockyLinux 8.7
-
-## Templates Rocky Linux 9
-
-### Warnings - RockyLinux 9
-
-- if required change `switch_name` parameter to switch's name you're using. In most situations packer manages it fine but there were a cases when it created new 'internal' switches without access to Internet. By design this setup will fail to download and apply updates.
-- if needed - change `iso_url` variable to a proper iso name
-- packer generates v8 machine configuration files (Windows 2016/Hyper-V 2016 as host) and v9 for Windows Server 2019/Windows 10 1809
-- credentials for Windows machines: Administrator/password (removed after sysprep)
-- credentials for Linux machines: root/password
-- for Windows based machines adjust your settings in ./scripts/phase-2.ps1
-- for Linux based machines adjust your settings in ./files/gen2-centos/provision.sh and ./files/gen2-centos/puppet.conf
-
-### Hyper-V Generation 2 RockyLinux 9.2 Image
-
-Run `hv_rockylinux92.ps1`
-
-### Hyper-V Generation 2 RockyLinux 9.2 Vagrant support
-
-Run `hv_rockylinux92_vagrant.ps1` for RockyLinux 9.2
-
-### Hyper-V Generation 2 RockyLinux 9.0 image with extra docker volume
-
-Run `hv_rockylinux92_docker.ps1` for RockyLinux 9.2
-
-## Templates OracleLinux 8.x
-
-### Warnings - OracleLinux 8
-
-- if required change `switch_name` parameter to switch's name you're using. In most situations packer manages it fine but there were a cases when it created new 'internal' switches without access to Internet. By design this setup will fail to download and apply updates.
-- if needed - change `iso_url` variable to a proper iso name
-- packer generates v8 machine configuration files (Windows 2016/Hyper-V 2016 as host) and v9 for Windows Server 2019/Windows 10 1809
-- credentials for Windows machines: Administrator/password (removed after sysprep)
-- credentials for Linux machines: root/password
-- for Windows based machines adjust your settings in ./scripts/phase-2.ps1
-- for Linux based machines adjust your settings in ./files/gen2-centos/provision.sh and ./files/gen2-centos/puppet.conf
-
-### Hyper-V Generation 2 OracleLinux 8.6 Image
-
-Run `hv_oraclelinux86.ps1`
-
-### Hyper-V Generation 2 OracleLinux 8.6 Vagrant support
-
-Run `hv_oraclelinux86_vagrant.ps1` for OracleLinux 8.5
-
-### Hyper-V Generation 2 OracleLinux 8.6 image with extra docker volume
-
-Run `hv_oraclelinux86_docker.ps1` for OracleLinux 8.6
-
-## Templates OracleLinux 9.x
-
-### Warnings - OracleLinux 9
-
-- if required change `switch_name` parameter to switch's name you're using. In most situations packer manages it fine but there were a cases when it created new 'internal' switches without access to Internet. By design this setup will fail to download and apply updates.
-- if needed - change `iso_url` variable to a proper iso name
-- packer generates v8 machine configuration files (Windows 2016/Hyper-V 2016 as host) and v9 for Windows Server 2019/Windows 10 1809
-- credentials for Windows machines: Administrator/password (removed after sysprep)
-- credentials for Linux machines: root/password
-- for Windows based machines adjust your settings in ./scripts/phase-2.ps1
-- for Linux based machines adjust your settings in ./files/gen2-centos/provision.sh and ./files/gen2-centos/puppet.conf
-
-### Hyper-V Generation 2 OracleLinux 9.2 Image
-
-Run `hv_oraclelinux92.ps1`
-
-### Hyper-V Generation 2 OracleLinux 9.2 Vagrant support
-
-Run `hv_oraclelinux92_vagrant.ps1` for OracleLinux 9.2
-
-### Hyper-V Generation 2 OracleLinux 9.2 image with extra docker volume
-
-Run `hv_oraclelinux92_docker.ps1` for OracleLinux 9.2
-
-## Templates AlmaLinux 8.x
-
-### Warnings - AlmaLinux 8
-
-- if required change `switch_name` parameter to switch's name you're using. In most situations packer manages it fine but there were a cases when it created new 'internal' switches without access to Internet. By design this setup will fail to download and apply updates.
-- if needed - change `iso_url` variable to a proper iso name
-- packer generates v8 machine configuration files (Windows 2016/Hyper-V 2016 as host) and v9 for Windows Server 2019/Windows 10 1809
-- credentials for Windows machines: Administrator/password (removed after sysprep)
-- credentials for Linux machines: root/password
-- for Windows based machines adjust your settings in ./scripts/phase-2.ps1
-- for Linux based machines adjust your settings in ./files/gen2-centos/provision.sh and ./files/gen2-centos/puppet.conf
-
-### Hyper-V Generation 2 AlmaLinux 8.6 Image
-
-Run `hv_almalinux86.ps1`
-
-### Hyper-V Generation 2 AlmaLinux 8.6 Vagrant support
-
-Run `hv_almalinux86_vagrant.ps1` for AlmaLinux 8.6
-
-### Hyper-V Generation 2 AlmaLinux 8.6 image with extra docker volume
-
-Run `hv_almalinux86_docker.ps1` for AlmaLinux 8.6
-
-## Templates AlmaLinux 9.x
-
-### Warnings - AlmaLinux 9
-
-- if required change `switch_name` parameter to switch's name you're using. In most situations packer manages it fine but there were a cases when it created new 'internal' switches without access to Internet. By design this setup will fail to download and apply updates.
-- if needed - change `iso_url` variable to a proper iso name
-- packer generates v8 machine configuration files (Windows 2016/Hyper-V 2016 as host) and v9 for Windows Server 2019/Windows 10 1809
-- credentials for Windows machines: Administrator/password (removed after sysprep)
-- credentials for Linux machines: root/password
-- for Windows based machines adjust your settings in ./scripts/phase-2.ps1
-- for Linux based machines adjust your settings in ./files/gen2-centos/provision.sh and ./files/gen2-centos/puppet.conf
-
-### Hyper-V Generation 2 AlmaLinux 9.2 Image
-
-Run `hv_almalinux92.ps1`
-
-### Hyper-V Generation 2 AlmaLinux 9.2 Vagrant support
-
-Run `hv_almalinux92_vagrant.ps1` for AlmaLinux 9.2
-
-### Hyper-V Generation 2 AlmaLinux 9.2 image with extra docker volume
-
-Run `hv_almalinux92_docker.ps1` for AlmaLinux 9.2
-
-## Templates CentOS 7.x
-
-### Warnings - CentOS Docker
-
-- if required change `switch_name` parameter to switch's name you're using. In most situations packer manages it fine but there were a cases when it created new 'internal' switches without access to Internet. By design this setup will fail to download and apply updates.
-- if needed - change `iso_url` variable to a proper iso name
-- packer generates v8 machine configuration files (Windows 2016/Hyper-V 2016 as host) and v9 for Windows Server 2019/Windows 10 1809
-- credentials for Windows machines: Administrator/password (removed after sysprep)
-- credentials for Linux machines: root/password
-- for Windows based machines adjust your settings in ./scripts/phase-2.ps1
-- for Linux based machines adjust your settings in ./values/centos7.yml or ./values/centos7_docker.yml
-- no `docker` repo will be added and no `docker-related` packages will be installed - this build only creates and mounts separated volume (size specified by variable) for docker
-
-### Hyper-V Generation 2 CentOS 7.9
-
-Run `hv_centos79.ps1`
-
-### Hyper-V Generation 2 CentOS 7.9 Image with extra docker volume
-
-Run `hv_centos79_docker.ps1`
-
-### Hyper-V Generation 2 CentOS 7.9 Vagrant support
-
-Run `hv_centos79_vagrant.ps1`
+```powershell
+.\hv_generic.ps1 -Action build -Version ubuntu-20.04 -Template ubuntu -Log 0
+.\hv_generic.ps1 -Action build -Version ubuntu-22.04 -Template ubuntu -Log 0
+```
## Known issues
@@ -650,6 +377,12 @@ Increase variable `update_timeout` in `./variables/*.json` file - this will cre
I wish. In short - Windows. These builds should be done with minimum effort (Hyper-V role is enough). Building custom ansible station with lots of checks right now fails in my tryouts.
+## Support me
+
+[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/marcinbojko)
+
+Consider buying me a coffee if you like my work. All donations are appreciated. All donations will be used to pay for pipeline running costs
+
## About
- Marcin Bojko - marcin(at)bojko.com.pl
diff --git a/config.pkr.hcl b/config.pkr.hcl
index 1abac51..eea6e32 100644
--- a/config.pkr.hcl
+++ b/config.pkr.hcl
@@ -1,12 +1,20 @@
packer {
required_plugins {
windows-update = {
- version = "0.14.1"
+ version = ">= 0.14.1"
source = "github.com/rgl/windows-update"
}
hyperv = {
version = ">= 1.1.0"
source = "github.com/hashicorp/hyperv"
}
+ ansible = {
+ source = "github.com/hashicorp/ansible"
+ version = "~> 1"
+ }
+ vagrant = {
+ source = "github.com/hashicorp/vagrant"
+ version = "~> 1"
+ }
}
}
diff --git a/extra/files/almalinux/8/hyperv/ks.cfg b/extra/files/almalinux/8/hyperv/ks.cfg
new file mode 100644
index 0000000..59e9cd1
--- /dev/null
+++ b/extra/files/almalinux/8/hyperv/ks.cfg
@@ -0,0 +1,101 @@
+#version=RHEL8
+# X Window System configuration information
+# License agreement
+eula --agreed
+# Use graphical install
+text
+# SELinux configuration
+selinux --disabled
+# Network information
+network --bootproto=dhcp --noipv6 --activate
+# Use CDROM installation media
+cdrom
+# Run the Setup Agent on first boot
+firstboot --disable
+# System services
+services --enabled="chronyd"
+services --enabled="sshd"
+services --enabled="NetworkManager"
+
+# Keyboard layouts
+keyboard --vckeymap=us --xlayouts='us'
+# System language
+lang en_US --addsupport=en_GB.UTF-8
+
+repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
+# Root password
+rootpw --plaintext password
+# System timezone
+timezone UTC --isUtc --ntpservers=0.rhel.pool.ntp.org
+# System bootloader configuration
+bootloader --location=mbr
+zerombr
+# Partition clearing information
+clearpart --all --initlabel
+# Disk partitioning information
+part /boot/efi --fstype="vfat" --size=400
+part /boot --fstype="ext4" --size=2048
+part swap --fstype="swap" --size=8192
+part / --fstype="ext4" --grow --size=1
+
+%packages
+@guest-agents
+@legacy-unix
+@system-tools
+mc
+curl
+wget
+tar
+bzip2
+kernel-devel
+kernel-headers
+perl
+gcc
+git
+make
+elfutils-libelf-devel
+langpacks-en
+glibc-all-langpacks
+openssh-server
+openssh-clients
+openssh
+tuned
+tuned-profiles-atomic
+qemu-guest-agent
+python3-pip
+python3-setuptools
+spice-vdagent
+qemu-guest-agent
+cloud-init
+cloud-utils-growpart
+%end
+
+%addon com_redhat_subscription_manager
+%end
+%addon ADDON_placeholder --disable --reserve-mb=auto
+%end
+%addon com_redhat_kdump --disable
+%end
+
+%anaconda
+pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
+pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
+pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
+%end
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post_sshd.log
+sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
+systemctl enable sshd --now
+%end
+
+%post --log=/var/log/anaconda/kickstart_post.log
+systemctl enable sshd --now
+#systemctl enable qemu-guest-agent
+systemctl set-default multi-user.target
+%end
+
+#reboot
+reboot
\ No newline at end of file
diff --git a/extra/files/almalinux/8/ks.cfg b/extra/files/almalinux/8/ks.cfg
new file mode 100644
index 0000000..957b36b
--- /dev/null
+++ b/extra/files/almalinux/8/ks.cfg
@@ -0,0 +1,101 @@
+#version=RHEL8
+# X Window System configuration information
+# License agreement
+eula --agreed
+# Use graphical install
+text
+# SELinux configuration
+selinux --disabled
+# Network information
+network --bootproto=dhcp --noipv6 --activate
+# Use CDROM installation media
+cdrom
+# Run the Setup Agent on first boot
+firstboot --disable
+# System services
+services --enabled="chronyd"
+services --enabled="sshd"
+services --enabled="NetworkManager"
+
+# Keyboard layouts
+keyboard --vckeymap=us --xlayouts='us'
+# System language
+lang en_US --addsupport=en_GB.UTF-8
+
+repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
+# Root password
+rootpw --plaintext password
+# System timezone
+timezone UTC --isUtc --ntpservers=0.rhel.pool.ntp.org
+# System bootloader configuration
+bootloader --location=mbr
+zerombr
+# Partition clearing information
+clearpart --all --initlabel
+# Disk partitioning information
+part /boot/efi --fstype="vfat" --size=400
+part /boot --fstype="ext4" --size=2048
+part swap --fstype="swap" --size=8192
+part / --fstype="ext4" --grow --size=1
+
+%packages
+@guest-agents
+@legacy-unix
+@system-tools
+mc
+curl
+wget
+tar
+bzip2
+kernel-devel
+kernel-headers
+perl
+gcc
+git
+make
+elfutils-libelf-devel
+langpacks-en
+glibc-all-langpacks
+openssh-server
+openssh-clients
+openssh
+tuned
+tuned-profiles-atomic
+qemu-guest-agent
+python3-pip
+python3-setuptools
+spice-vdagent
+qemu-guest-agent
+cloud-init
+cloud-utils-growpart
+%end
+
+%addon com_redhat_subscription_manager
+%end
+%addon ADDON_placeholder --disable --reserve-mb=auto
+%end
+%addon com_redhat_kdump --disable
+%end
+
+%anaconda
+pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
+pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
+pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
+%end
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post_sshd.log
+sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
+systemctl enable sshd --now
+%end
+
+%post --log=/var/log/anaconda/kickstart_post.log
+systemctl enable sshd --now
+systemctl enable qemu-guest-agent
+systemctl set-default multi-user.target
+%end
+
+#reboot
+reboot
\ No newline at end of file
diff --git a/extra/files/almalinux/8/kvm/ks-kvm.cfg b/extra/files/almalinux/8/kvm/ks-kvm.cfg
new file mode 100644
index 0000000..81c03ea
--- /dev/null
+++ b/extra/files/almalinux/8/kvm/ks-kvm.cfg
@@ -0,0 +1,103 @@
+#version=RHEL8
+# X Window System configuration information
+# License agreement
+eula --agreed
+# Use graphical install
+text
+# SELinux configuration
+selinux --disabled
+# Network information
+network --bootproto=dhcp --noipv6 --activate
+# firewall
+firewall --disabled
+# Use CDROM installation media
+cdrom
+# Run the Setup Agent on first boot
+firstboot --disable
+# System services
+services --enabled="chronyd"
+services --enabled="sshd"
+services --enabled="NetworkManager"
+
+# Keyboard layouts
+keyboard --vckeymap=us --xlayouts='us'
+# System language
+lang en_US --addsupport=en_GB.UTF-8
+
+repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
+# Root password
+rootpw --plaintext password
+# System timezone
+timezone UTC --isUtc --ntpservers=0.rhel.pool.ntp.org
+# System bootloader configuration
+bootloader
+zerombr
+# Partition clearing information
+clearpart --all --initlabel
+# Disk partitioning information
+part /boot/efi --fstype="vfat" --size=400
+part /boot --fstype="ext4" --size=2048
+part swap --fstype="swap" --size=8192
+part / --fstype="ext4" --grow --size=1
+
+%packages
+@guest-agents
+@legacy-unix
+@system-tools
+bash
+mc
+curl
+wget
+tar
+bzip2
+kernel-devel
+kernel-headers
+perl
+gcc
+git
+make
+elfutils-libelf-devel
+langpacks-en
+glibc-all-langpacks
+openssh-server
+openssh-clients
+openssh
+python3-pip
+python3-setuptools
+tuned
+tuned-profiles-atomic
+tuned-utils
+spice-vdagent
+qemu-guest-agent
+cloud-init
+cloud-utils-growpart
+%end
+
+%addon com_redhat_subscription_manager
+%end
+%addon ADDON_placeholder --disable --reserve-mb=auto
+%end
+%addon com_redhat_kdump --disable
+%end
+
+%anaconda
+pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
+pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
+pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
+%end
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post_sshd.log
+sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
+systemctl enable sshd
+%end
+
+%post --log=/var/log/anaconda/kickstart_post.log
+systemctl enable qemu-guest-agent
+systemctl set-default multi-user.target
+%end
+
+#reboot
+reboot
\ No newline at end of file
diff --git a/extra/files/almalinux/8/proxmox/ks.cfg b/extra/files/almalinux/8/proxmox/ks.cfg
new file mode 100644
index 0000000..957b36b
--- /dev/null
+++ b/extra/files/almalinux/8/proxmox/ks.cfg
@@ -0,0 +1,101 @@
+#version=RHEL8
+# X Window System configuration information
+# License agreement
+eula --agreed
+# Use graphical install
+text
+# SELinux configuration
+selinux --disabled
+# Network information
+network --bootproto=dhcp --noipv6 --activate
+# Use CDROM installation media
+cdrom
+# Run the Setup Agent on first boot
+firstboot --disable
+# System services
+services --enabled="chronyd"
+services --enabled="sshd"
+services --enabled="NetworkManager"
+
+# Keyboard layouts
+keyboard --vckeymap=us --xlayouts='us'
+# System language
+lang en_US --addsupport=en_GB.UTF-8
+
+repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
+# Root password
+rootpw --plaintext password
+# System timezone
+timezone UTC --isUtc --ntpservers=0.rhel.pool.ntp.org
+# System bootloader configuration
+bootloader --location=mbr
+zerombr
+# Partition clearing information
+clearpart --all --initlabel
+# Disk partitioning information
+part /boot/efi --fstype="vfat" --size=400
+part /boot --fstype="ext4" --size=2048
+part swap --fstype="swap" --size=8192
+part / --fstype="ext4" --grow --size=1
+
+%packages
+@guest-agents
+@legacy-unix
+@system-tools
+mc
+curl
+wget
+tar
+bzip2
+kernel-devel
+kernel-headers
+perl
+gcc
+git
+make
+elfutils-libelf-devel
+langpacks-en
+glibc-all-langpacks
+openssh-server
+openssh-clients
+openssh
+tuned
+tuned-profiles-atomic
+qemu-guest-agent
+python3-pip
+python3-setuptools
+spice-vdagent
+qemu-guest-agent
+cloud-init
+cloud-utils-growpart
+%end
+
+%addon com_redhat_subscription_manager
+%end
+%addon ADDON_placeholder --disable --reserve-mb=auto
+%end
+%addon com_redhat_kdump --disable
+%end
+
+%anaconda
+pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
+pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
+pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
+%end
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post_sshd.log
+sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
+systemctl enable sshd --now
+%end
+
+%post --log=/var/log/anaconda/kickstart_post.log
+systemctl enable sshd --now
+systemctl enable qemu-guest-agent
+systemctl set-default multi-user.target
+%end
+
+#reboot
+reboot
\ No newline at end of file
diff --git a/extra/files/gen2-almalinux8/uefi.sh b/extra/files/almalinux/8/uefi.sh
similarity index 100%
rename from extra/files/gen2-almalinux8/uefi.sh
rename to extra/files/almalinux/8/uefi.sh
diff --git a/extra/files/almalinux/9/hyperv/ks.cfg b/extra/files/almalinux/9/hyperv/ks.cfg
new file mode 100644
index 0000000..21b173c
--- /dev/null
+++ b/extra/files/almalinux/9/hyperv/ks.cfg
@@ -0,0 +1,100 @@
+#version=RHEL9
+# X Window System configuration information
+# License agreement
+eula --agreed
+# Use graphical install
+text
+# SELinux configuration
+selinux --disabled
+# Network information
+network --bootproto=dhcp --noipv6 --activate
+# Use CDROM installation media
+cdrom
+# Run the Setup Agent on first boot
+firstboot --disable
+# System services
+services --enabled="chronyd"
+services --enabled="sshd"
+services --enabled="NetworkManager"
+
+# Keyboard layouts
+keyboard --vckeymap=us --xlayouts='us'
+# System language
+lang en_US --addsupport=en_GB.UTF-8
+
+repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
+# Root password
+rootpw --plaintext password
+# System timezone
+timezone UTC --utc
+# System bootloader configuration
+bootloader
+zerombr
+# Partition clearing information
+clearpart --all --initlabel
+# # Disk partitioning information
+part /boot/efi --fstype="vfat" --size=400
+part /boot --fstype="ext4" --size=2048
+part swap --fstype="swap" --size=8192
+part / --fstype="ext4" --grow --size=1
+
+%packages
+@guest-agents
+@legacy-unix
+@system-tools
+bash
+mc
+curl
+wget
+tar
+bzip2
+kernel-devel
+kernel-headers
+perl
+gcc
+git
+make
+elfutils-libelf-devel
+langpacks-en
+glibc-all-langpacks
+openssh-server
+openssh-clients
+openssh
+tuned
+tuned-profiles-atomic
+qemu-guest-agent
+python3-pip
+python3-setuptools
+spice-vdagent
+qemu-guest-agent
+%end
+
+%addon com_redhat_subscription_manager
+%end
+%addon ADDON_placeholder --disable --reserve-mb=auto
+%end
+%addon com_redhat_kdump --disable
+%end
+
+# post part
+# post part
+%post --log=/var/log/anaconda/kickstart_post_sshd.log
+sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
+systemctl enable sshd
+%end
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post.log
+#systemctl enable qemu-guest-agent
+systemctl set-default multi-user.target
+%end
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post_efi.log
+cp -pr /boot/efi/EFI/almalinux/* /boot/efi/EFI/BOOT/
+%end
+
+#reboot
+reboot
diff --git a/extra/files/almalinux/9/ks.cfg b/extra/files/almalinux/9/ks.cfg
new file mode 100644
index 0000000..21b173c
--- /dev/null
+++ b/extra/files/almalinux/9/ks.cfg
@@ -0,0 +1,100 @@
+#version=RHEL9
+# X Window System configuration information
+# License agreement
+eula --agreed
+# Use graphical install
+text
+# SELinux configuration
+selinux --disabled
+# Network information
+network --bootproto=dhcp --noipv6 --activate
+# Use CDROM installation media
+cdrom
+# Run the Setup Agent on first boot
+firstboot --disable
+# System services
+services --enabled="chronyd"
+services --enabled="sshd"
+services --enabled="NetworkManager"
+
+# Keyboard layouts
+keyboard --vckeymap=us --xlayouts='us'
+# System language
+lang en_US --addsupport=en_GB.UTF-8
+
+repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
+# Root password
+rootpw --plaintext password
+# System timezone
+timezone UTC --utc
+# System bootloader configuration
+bootloader
+zerombr
+# Partition clearing information
+clearpart --all --initlabel
+# # Disk partitioning information
+part /boot/efi --fstype="vfat" --size=400
+part /boot --fstype="ext4" --size=2048
+part swap --fstype="swap" --size=8192
+part / --fstype="ext4" --grow --size=1
+
+%packages
+@guest-agents
+@legacy-unix
+@system-tools
+bash
+mc
+curl
+wget
+tar
+bzip2
+kernel-devel
+kernel-headers
+perl
+gcc
+git
+make
+elfutils-libelf-devel
+langpacks-en
+glibc-all-langpacks
+openssh-server
+openssh-clients
+openssh
+tuned
+tuned-profiles-atomic
+qemu-guest-agent
+python3-pip
+python3-setuptools
+spice-vdagent
+qemu-guest-agent
+%end
+
+%addon com_redhat_subscription_manager
+%end
+%addon ADDON_placeholder --disable --reserve-mb=auto
+%end
+%addon com_redhat_kdump --disable
+%end
+
+# post part
+# post part
+%post --log=/var/log/anaconda/kickstart_post_sshd.log
+sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
+systemctl enable sshd
+%end
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post.log
+#systemctl enable qemu-guest-agent
+systemctl set-default multi-user.target
+%end
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post_efi.log
+cp -pr /boot/efi/EFI/almalinux/* /boot/efi/EFI/BOOT/
+%end
+
+#reboot
+reboot
diff --git a/extra/files/gen2-almalinux9/ks.cfg b/extra/files/almalinux/9/kvm/ks.cfg
similarity index 96%
rename from extra/files/gen2-almalinux9/ks.cfg
rename to extra/files/almalinux/9/kvm/ks.cfg
index 7acf159..0d42826 100644
--- a/extra/files/gen2-almalinux9/ks.cfg
+++ b/extra/files/almalinux/9/kvm/ks.cfg
@@ -28,9 +28,7 @@ rootpw --plaintext password
# System timezone
timezone UTC --utc
# System bootloader configuration
-#bootloader --location=mbr --boot-drive=sda
bootloader
-#autopart --type=plain
zerombr
# Partition clearing information
clearpart --all --initlabel
@@ -54,6 +52,7 @@ kernel-devel
kernel-headers
perl
gcc
+git
make
elfutils-libelf-devel
langpacks-en
@@ -63,13 +62,17 @@ openssh-clients
openssh
tuned
tuned-profiles-atomic
+qemu-guest-agent
+python3-pip
+python3-setuptools
+spice-vdagent
+qemu-guest-agent
%end
%addon com_redhat_subscription_manager
%end
%addon ADDON_placeholder --disable --reserve-mb=auto
%end
-
%addon com_redhat_kdump --disable
%end
diff --git a/extra/files/almalinux/9/proxmox/ks.cfg b/extra/files/almalinux/9/proxmox/ks.cfg
new file mode 100644
index 0000000..0d42826
--- /dev/null
+++ b/extra/files/almalinux/9/proxmox/ks.cfg
@@ -0,0 +1,100 @@
+#version=RHEL9
+# X Window System configuration information
+# License agreement
+eula --agreed
+# Use graphical install
+text
+# SELinux configuration
+selinux --disabled
+# Network information
+network --bootproto=dhcp --noipv6 --activate
+# Use CDROM installation media
+cdrom
+# Run the Setup Agent on first boot
+firstboot --disable
+# System services
+services --enabled="chronyd"
+services --enabled="sshd"
+services --enabled="NetworkManager"
+
+# Keyboard layouts
+keyboard --vckeymap=us --xlayouts='us'
+# System language
+lang en_US --addsupport=en_GB.UTF-8
+
+repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
+# Root password
+rootpw --plaintext password
+# System timezone
+timezone UTC --utc
+# System bootloader configuration
+bootloader
+zerombr
+# Partition clearing information
+clearpart --all --initlabel
+# # Disk partitioning information
+part /boot/efi --fstype="vfat" --size=400
+part /boot --fstype="ext4" --size=2048
+part swap --fstype="swap" --size=8192
+part / --fstype="ext4" --grow --size=1
+
+%packages
+@guest-agents
+@legacy-unix
+@system-tools
+bash
+mc
+curl
+wget
+tar
+bzip2
+kernel-devel
+kernel-headers
+perl
+gcc
+git
+make
+elfutils-libelf-devel
+langpacks-en
+glibc-all-langpacks
+openssh-server
+openssh-clients
+openssh
+tuned
+tuned-profiles-atomic
+qemu-guest-agent
+python3-pip
+python3-setuptools
+spice-vdagent
+qemu-guest-agent
+%end
+
+%addon com_redhat_subscription_manager
+%end
+%addon ADDON_placeholder --disable --reserve-mb=auto
+%end
+%addon com_redhat_kdump --disable
+%end
+
+# post part
+# post part
+%post --log=/var/log/anaconda/kickstart_post_sshd.log
+sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
+systemctl enable sshd
+%end
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post.log
+systemctl enable qemu-guest-agent
+systemctl set-default multi-user.target
+%end
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post_efi.log
+cp -pr /boot/efi/EFI/almalinux/* /boot/efi/EFI/BOOT/
+%end
+
+#reboot
+reboot
diff --git a/extra/files/gen2-almalinux9/uefi.sh b/extra/files/almalinux/9/uefi.sh
similarity index 100%
rename from extra/files/gen2-almalinux9/uefi.sh
rename to extra/files/almalinux/9/uefi.sh
diff --git a/extra/files/cloud-init/alicloud/cloud.cfg b/extra/files/cloud-init/rhel/alicloud/cloud.cfg
similarity index 100%
rename from extra/files/cloud-init/alicloud/cloud.cfg
rename to extra/files/cloud-init/rhel/alicloud/cloud.cfg
diff --git a/extra/files/cloud-init/generic/cloud.cfg b/extra/files/cloud-init/rhel/generic/cloud.cfg
similarity index 92%
rename from extra/files/cloud-init/generic/cloud.cfg
rename to extra/files/cloud-init/rhel/generic/cloud.cfg
index 3dd34c8..7907688 100644
--- a/extra/files/cloud-init/generic/cloud.cfg
+++ b/extra/files/cloud-init/rhel/generic/cloud.cfg
@@ -90,13 +90,13 @@ cloud_final_modules:
# System and/or distro specific settings
# (not accessible to handlers/transforms)
system_info:
- default_user:
- name: ecs-user
- lock_passwd: true
- gecos: Cloud User
- groups: [adm, systemd-journal]
- sudo: ["ALL=(ALL) NOPASSWD:ALL"]
- shell: /bin/bash
+ # default_user:
+ # name: ecs-user
+ # lock_passwd: true
+ # gecos: Cloud User
+ # groups: [adm, systemd-journal]
+ # sudo: ["ALL=(ALL) NOPASSWD:ALL"]
+ # shell: /bin/bash
distro: rhel
# Other config here will be given to the distro class and/or path classes
paths:
diff --git a/extra/files/cloud-init/oci/cloud.cfg b/extra/files/cloud-init/rhel/oci/cloud.cfg
similarity index 100%
rename from extra/files/cloud-init/oci/cloud.cfg
rename to extra/files/cloud-init/rhel/oci/cloud.cfg
diff --git a/extra/files/cloud-init/suse/generic/cloud.cfg b/extra/files/cloud-init/suse/generic/cloud.cfg
new file mode 100644
index 0000000..7907688
--- /dev/null
+++ b/extra/files/cloud-init/suse/generic/cloud.cfg
@@ -0,0 +1,105 @@
+# The top level settings are used as module
+# and system configuration.
+# A set of users which may be applied and/or used by various modules
+# when a 'default' entry is found it will reference the 'default_user'
+# from the distro configuration specified below
+users:
+ - default
+#user:
+# name: root
+# lock_passwd: False
+# If this is set, 'root' will not be able to ssh in and they
+# will get a message to login instead as the default $user
+disable_root: True
+mount_default_fields: [~, ~, 'auto', 'defaults,nofail,x-systemd.requires=cloud-init.service,_netdev', '0', '2']
+resize_rootfs_tmp: /dev
+ssh_pwauth: 0
+
+# This will cause the set+update hostname module to not operate (if true)
+preserve_hostname: false
+
+# If you use datasource_list array, keep array items in a single line.
+# If you use multi line array, ds-identify script won't read array items.
+# Example datasource config
+# datasource:
+# Ec2:
+# metadata_urls: [ 'blah.com' ]
+# timeout: 5 # (defaults to 50 seconds)
+# max_wait: 10 # (defaults to 120 seconds)
+
+# Default redhat settings:
+ssh_deletekeys: true
+ssh_genkeytypes: ['rsa', 'ecdsa', 'ed25519']
+disable_vmware_customization: false
+syslog_fix_perms: root:root
+
+# datasource_list: [ AliYun ]
+# Example datasource config
+# datasource:
+# AliYun:
+# support_xen: false
+# timeout: 15 # (defaults to 50 seconds) max_wait: 60 # (defaults to 120 seconds)
+# metadata_urls: ["http://100.100.100.200"]
+
+
+# The modules that run in the 'init' stage
+cloud_init_modules:
+ - migrator
+ - seed_random
+ - bootcmd
+ - write-files
+ - growpart
+ - resizefs
+ - disk_setup
+ - mounts
+ - set_hostname
+ - update_hostname
+ - update_etc_hosts
+ - ca-certs
+ - rsyslog
+ - users-groups
+ - ssh
+
+# The modules that run in the 'config' stage
+cloud_config_modules:
+ - set-passwords
+ - yum-add-repo
+ - timezone
+ - disable-ec2-metadata
+ - runcmd
+
+# The modules that run in the 'final' stage
+cloud_final_modules:
+ - package-update-upgrade-install
+ - puppet
+ - chef
+ - mcollective
+ - salt-minion
+ - rightscale_userdata
+ - scripts-vendor
+ - scripts-per-once
+ - scripts-per-boot
+ - scripts-per-instance
+ - scripts-user
+ - ssh-authkey-fingerprints
+ - keys-to-console
+ - phone-home
+ - final-message
+ - power-state-change
+
+# System and/or distro specific settings
+# (not accessible to handlers/transforms)
+system_info:
+ # default_user:
+ # name: ecs-user
+ # lock_passwd: true
+ # gecos: Cloud User
+ # groups: [adm, systemd-journal]
+ # sudo: ["ALL=(ALL) NOPASSWD:ALL"]
+ # shell: /bin/bash
+ distro: rhel
+ # Other config here will be given to the distro class and/or path classes
+ paths:
+ cloud_dir: /var/lib/cloud/
+ templates_dir: /etc/cloud/templates/
+ ssh_svcname: sshd
diff --git a/extra/files/cloud-init/ubuntu/generic/cloud.cfg b/extra/files/cloud-init/ubuntu/generic/cloud.cfg
new file mode 100644
index 0000000..3a19e84
--- /dev/null
+++ b/extra/files/cloud-init/ubuntu/generic/cloud.cfg
@@ -0,0 +1,105 @@
+# The top level settings are used as module
+# and system configuration.
+# A set of users which may be applied and/or used by various modules
+# when a 'default' entry is found it will reference the 'default_user'
+# from the distro configuration specified below
+users:
+ - default
+#user:
+# name: root
+# lock_passwd: False
+# If this is set, 'root' will not be able to ssh in and they
+# will get a message to login instead as the default $user
+disable_root: True
+mount_default_fields: [~, ~, 'auto', 'defaults,nofail,x-systemd.requires=cloud-init.service,_netdev', '0', '2']
+resize_rootfs_tmp: /dev
+ssh_pwauth: 0
+
+# This will cause the set+update hostname module to not operate (if true)
+preserve_hostname: false
+
+# If you use datasource_list array, keep array items in a single line.
+# If you use multi line array, ds-identify script won't read array items.
+# Example datasource config
+# datasource:
+# Ec2:
+# metadata_urls: [ 'blah.com' ]
+# timeout: 5 # (defaults to 50 seconds)
+# max_wait: 10 # (defaults to 120 seconds)
+
+# Default redhat settings:
+ssh_deletekeys: true
+ssh_genkeytypes: ['rsa', 'ecdsa', 'ed25519']
+disable_vmware_customization: false
+syslog_fix_perms: root:root
+
+# datasource_list: [ AliYun ]
+# Example datasource config
+# datasource:
+# AliYun:
+# support_xen: false
+# timeout: 15 # (defaults to 50 seconds) max_wait: 60 # (defaults to 120 seconds)
+# metadata_urls: ["http://100.100.100.200"]
+
+
+# The modules that run in the 'init' stage
+cloud_init_modules:
+ - migrator
+ - seed_random
+ - bootcmd
+ - write-files
+ - growpart
+ - resizefs
+ - disk_setup
+ - mounts
+ - set_hostname
+ - update_hostname
+ - update_etc_hosts
+ - ca-certs
+ - rsyslog
+ - users-groups
+ - ssh
+
+# The modules that run in the 'config' stage
+cloud_config_modules:
+ - set-passwords
+ - yum-add-repo
+ - timezone
+ - disable-ec2-metadata
+ - runcmd
+
+# The modules that run in the 'final' stage
+cloud_final_modules:
+ - package-update-upgrade-install
+ - puppet
+ - chef
+ - mcollective
+ - salt-minion
+ - rightscale_userdata
+ - scripts-vendor
+ - scripts-per-once
+ - scripts-per-boot
+ - scripts-per-instance
+ - scripts-user
+ - ssh-authkey-fingerprints
+ - keys-to-console
+ - phone-home
+ - final-message
+ - power-state-change
+
+# System and/or distro specific settings
+# (not accessible to handlers/transforms)
+system_info:
+ # default_user:
+ # name: ecs-user
+ # lock_passwd: true
+ # gecos: Cloud User
+ # groups: [adm, systemd-journal]
+ # sudo: ["ALL=(ALL) NOPASSWD:ALL"]
+ # shell: /bin/bash
+ distro: ubuntu
+ # Other config here will be given to the distro class and/or path classes
+ paths:
+ cloud_dir: /var/lib/cloud/
+ templates_dir: /etc/cloud/templates/
+ ssh_svcname: sshd
diff --git a/extra/files/gen1-vb/1909/Autounattend.xml b/extra/files/gen1-vb/1909/Autounattend.xml
deleted file mode 100644
index b471494..0000000
--- a/extra/files/gen1-vb/1909/Autounattend.xml
+++ /dev/null
@@ -1,154 +0,0 @@
-
-
-
-
-
- en-US
-
- en-US
- en-US
- en-US
- en-US
- en-US
-
-
-
-
-
-
- Primary
- 1
- 350
-
-
- 2
- Primary
- true
-
-
-
-
- true
- NTFS
-
- 1
- 1
-
-
- NTFS
-
- C
- 2
- 2
-
-
- 0
- true
-
-
-
-
-
-
- /IMAGE/INDEX
- 1
-
-
-
- 0
- 2
-
-
-
-
-
-
- OnError
-
- true
- Vagrant
- Hashicorp
-
-
-
-
-
-
- false
-
- vagrant-1909
- Pacific Standard Time
-
-
-
- true
-
-
- false
- false
-
-
- true
-
-
-
-
-
-
- vagrant
- true
-
- true
- vagrant
-
-
-
- cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
- Set Execution Policy 64 Bit
- 1
- true
-
-
- C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
- Set Execution Policy 32 Bit
- 2
- true
-
-
- cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\bootstrap.ps1
- Fix public network
- 3
- true
-
-
- cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE
- 4
- Disable password expiration for vagrant user
-
-
-
-
- vagrant
- true
-
-
-
-
- vagrant
- true
-
- Vagrant User
- Administrators
- vagrant
-
-
-
-
-
-
-
- false
-
-
-
-
diff --git a/extra/files/gen1-vb/1909/unattend.xml b/extra/files/gen1-vb/1909/unattend.xml
deleted file mode 100755
index bc9bee3..0000000
--- a/extra/files/gen1-vb/1909/unattend.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
- 1
-
-
- false
- false
-
-
-
-
- en-US
- en-US
- en-US
- en-US
-
-
-
- true
- 1
- true
-
- UTC
-
-
- dgBhAGcAcgBhAG4AdABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=
- false
-
-
-
-
- dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA
- false
-
- administrators
- Vagrant
- vagrant
- Vagrant User
-
-
-
-
-
-
-
-
- vagrant-1909
-
-
-
-
diff --git a/extra/files/gen1-vb/2004/unattend.xml b/extra/files/gen1-vb/2004/unattend.xml
deleted file mode 100755
index f294741..0000000
--- a/extra/files/gen1-vb/2004/unattend.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
- 1
-
-
- false
- false
-
-
-
-
- en-US
- en-US
- en-US
- en-US
-
-
-
- true
- 1
- true
-
- UTC
-
-
- dgBhAGcAcgBhAG4AdABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=
- false
-
-
-
-
- dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA
- false
-
- administrators
- Vagrant
- vagrant
- Vagrant User
-
-
-
-
-
-
-
-
- vagrant-2004
-
-
-
diff --git a/extra/files/gen1-vb/2016-dc/unattend.xml b/extra/files/gen1-vb/2016-dc/unattend.xml
deleted file mode 100755
index 4fefb68..0000000
--- a/extra/files/gen1-vb/2016-dc/unattend.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
- 1
-
-
- false
- false
-
-
-
-
- en-US
- en-US
- en-US
- en-US
-
-
-
- true
- 1
- true
-
- UTC
-
-
- dgBhAGcAcgBhAG4AdABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=
- false
-
-
-
-
- dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA
- false
-
- administrators
- Vagrant
- vagrant
- Vagrant User
-
-
-
-
-
-
-
-
- vagrant-2016
-
-
-
-
diff --git a/extra/files/gen1-vb/2016/unattend.xml b/extra/files/gen1-vb/2016/unattend.xml
deleted file mode 100755
index 4fefb68..0000000
--- a/extra/files/gen1-vb/2016/unattend.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
- 1
-
-
- false
- false
-
-
-
-
- en-US
- en-US
- en-US
- en-US
-
-
-
- true
- 1
- true
-
- UTC
-
-
- dgBhAGcAcgBhAG4AdABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=
- false
-
-
-
-
- dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA
- false
-
- administrators
- Vagrant
- vagrant
- Vagrant User
-
-
-
-
-
-
-
-
- vagrant-2016
-
-
-
-
diff --git a/extra/files/gen1-vb/2022/unattend.xml b/extra/files/gen1-vb/2022/unattend.xml
index 8c00e7e..1da5496 100755
--- a/extra/files/gen1-vb/2022/unattend.xml
+++ b/extra/files/gen1-vb/2022/unattend.xml
@@ -2,7 +2,7 @@
- 1
+ 0
false
diff --git a/extra/files/gen2-2016/secondary.iso b/extra/files/gen2-2016/secondary.iso
deleted file mode 100644
index e31cfec..0000000
Binary files a/extra/files/gen2-2016/secondary.iso and /dev/null differ
diff --git a/extra/files/gen2-almalinux8/ks.cfg b/extra/files/gen2-almalinux8/ks.cfg
deleted file mode 100644
index bfd177a..0000000
--- a/extra/files/gen2-almalinux8/ks.cfg
+++ /dev/null
@@ -1,96 +0,0 @@
-#version=RHEL8
-# X Window System configuration information
-xconfig --startxonboot
-# License agreement
-eula --agreed
-# Use graphical install
-text
-# SELinux configuration
-selinux --disabled
-# Network information
-#network --bootproto=dhcp --noipv6 --activate
-#network --bootproto=dhcp --hostname=localhost.localdomain
-
-ignoredisk --only-use=sda
-# Use CDROM installation media
-cdrom
-# Run the Setup Agent on first boot
-firstboot --disable
-# System services
-services --enabled="chronyd"
-services --enabled="sshd"
-services --enabled="NetworkManager"
-
-# Keyboard layouts
-keyboard --vckeymap=us --xlayouts='us'
-# System language
-lang en_US --addsupport=en_GB.UTF-8
-
-repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
-# Root password
-rootpw --iscrypted $6$kivIgMEEjORaheG3$MTEQUVvZE0744qxUdXrSXfs/ePGYOVNGJv9aXVUyXRCiX3oizj69RF5Rw17npKPiltKgdepk0yO8/gzJQ2Se6/
-# System timezone
-timezone Europe/Warsaw --isUtc --ntpservers=0.rhel.pool.ntp.org
-# System bootloader configuration
-bootloader --location=mbr --boot-drive=sda
-#autopart --type=lvm
-zerombr
-# Partition clearing information
-clearpart --all --initlabel
-# Disk partitioning information
-part /boot/efi --fstype="vfat" --size=200
-part /boot --fstype="ext4" --size=1024
-part swap --fstype="swap" --size=16384
-part / --fstype="ext4" --grow --size=1
-
-%packages
-@guest-agents
-@headless-management
-@legacy-unix
-@system-tools
-bash
-mc
-curl
-wget
-tar
-bzip2
-kernel-devel
-kernel-headers
-perl
-gcc
-make
-elfutils-libelf-devel
-langpacks-en
-glibc-all-langpacks
-openssh-server
-openssh-clients
-openssh
-%end
-
-%addon com_redhat_subscription_manager
-%end
-%addon ADDON_placeholder --disable --reserve-mb=auto
-%end
-
-%anaconda
-pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
-pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
-pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
-%end
-
-# post part
-%post
-systemctl enable sshd
-systemctl set-default multi-user.target
-systemctl disable initial-setup-text
-systemctl disable initial-setup-graphical
-initial_setup/tui/spokes/eula.py
-#
-cp -pr /boot/efi/EFI/almalinux/* /boot/efi/EFI/BOOT/
-# delete libvirt
-systemctl stop libvirtd
-systemctl disable libvirtd
-%end
-
-#reboot
-reboot
\ No newline at end of file
diff --git a/extra/files/gen2-rockylinux8/ks.cfg b/extra/files/gen2-rockylinux8/ks.cfg
deleted file mode 100644
index e778252..0000000
--- a/extra/files/gen2-rockylinux8/ks.cfg
+++ /dev/null
@@ -1,95 +0,0 @@
-#version=RHEL8
-# X Window System configuration information
-xconfig --startxonboot
-# License agreement
-eula --agreed
-# Use graphical install
-text
-# SELinux configuration
-selinux --disabled
-# Network information
-#network --bootproto=dhcp --noipv6 --activate
-#network --bootproto=dhcp --hostname=localhost.localdomain
-
-ignoredisk --only-use=sda
-# Use CDROM installation media
-cdrom
-# Run the Setup Agent on first boot
-firstboot --disable
-# System services
-services --enabled="chronyd"
-services --enabled="sshd"
-services --enabled="NetworkManager"
-
-# Keyboard layouts
-keyboard --vckeymap=us --xlayouts='us'
-# System language
-lang en_US --addsupport=en_GB.UTF-8
-
-repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
-# Root password
-rootpw --iscrypted $6$kivIgMEEjORaheG3$MTEQUVvZE0744qxUdXrSXfs/ePGYOVNGJv9aXVUyXRCiX3oizj69RF5Rw17npKPiltKgdepk0yO8/gzJQ2Se6/
-# System timezone
-timezone Europe/Warsaw --isUtc --ntpservers=0.rhel.pool.ntp.org
-# System bootloader configuration
-bootloader --location=mbr --boot-drive=sda
-#autopart --type=lvm
-zerombr
-# Partition clearing information
-clearpart --all --initlabel
-# Disk partitioning information
-part /boot/efi --fstype="vfat" --size=200
-part /boot --fstype="ext4" --size=1024
-part swap --fstype="swap" --size=16384
-part / --fstype="ext4" --grow --size=1
-
-%packages
-@guest-agents
-@headless-management
-@legacy-unix
-@system-tools
-mc
-curl
-wget
-tar
-bzip2
-kernel-devel
-kernel-headers
-perl
-gcc
-make
-elfutils-libelf-devel
-langpacks-en
-glibc-all-langpacks
-openssh-server
-openssh-clients
-openssh
-%end
-
-%addon com_redhat_subscription_manager
-%end
-%addon ADDON_placeholder --disable --reserve-mb=auto
-%end
-
-%anaconda
-pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
-pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
-pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
-%end
-
-# post part
-%post
-systemctl enable sshd
-systemctl set-default multi-user.target
-systemctl disable initial-setup-text
-systemctl disable initial-setup-graphical
-initial_setup/tui/spokes/eula.py
-#
-cp -pr /boot/efi/EFI/rockylinux/* /boot/efi/EFI/BOOT/
-# delete libvirt
-systemctl stop libvirtd
-systemctl disable libvirtd
-%end
-
-#reboot
-reboot
\ No newline at end of file
diff --git a/extra/files/gen2-ubuntu2004/prepare_neofetch.sh b/extra/files/gen2-ubuntu2004/prepare_neofetch.sh
deleted file mode 100755
index 818735d..0000000
--- a/extra/files/gen2-ubuntu2004/prepare_neofetch.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env bash
-# prepare (comment/uncomment lines according to our needs)
-
-config="/etc/neofetch/config.conf"
-config_dir="/etc/neofetch"
-
-if [ ! -d $config_dir ];then
- echo "No $config_dir exists - creating one"
- mkdir -v $config_dir
-fi
-
-if [ ! -e $config ];then
- if [ -e /root/.config/neofetch/config.conf ];then
- echo "Copying config from root to /etc/neofetch"
- cp -pv /root/.config/neofetch/config.conf $config
- fi
-fi
-
-if [ -e $config ]; then
- echo "Starting Neofetch configuration"
- # comment
- sed -i -e 's/^[[:blank:]]*info "Packages" packages/#info "Packages" packages/g' $config
- sed -i -e 's/^[[:blank:]]*info "Resolution" resolution/#info "Resolution" resolution/g' $config
- sed -i -e 's/^[[:blank:]]*info "DE" de/#info "DE" de/g' $config
- sed -i -e 's/^[[:blank:]]*info "WM" wm/#info "WM" wm/g' $config
- sed -i -e 's/^[[:blank:]]*info "WM Theme" wm_theme/#info "WM Theme" wm_theme/g' $config
- sed -i -e 's/^[[:blank:]]*info "Theme" theme/#info "Theme" theme/g' $config
- sed -i -e 's/^[[:blank:]]*info "Icons" icons/#info "Icons" icons/g' $config
- sed -i -e 's/^[[:blank:]]*info "Terminal" term/#info "Terminal" term/g' $config
- sed -i -e 's/^[[:blank:]]*info "Terminal Font" term_font/#info "Terminal Font" term_font/g' $config
- sed -i -e 's/^[[:blank:]]*info cols/#info cols/g' $config
- # uncomment
- sed -i -e 's/^[[:blank:]]*# info "Disk" disk/info "Disk" disk/g' $config
- sed -i -e 's/^[[:blank:]]*# info "Local IP" local_ip/info "Local IP" local_ip/g' $config
- # disable color block - workaround for HV console
- sed -i -e 's/color_blocks="on"/color_blocks="off"/g' $config
- echo "Finished Neofetch configuration"
-else
- echo "File $config doesn't exist - couldn't configure neofetch"
-fi
diff --git a/extra/files/gen2-ubuntu2004/provision.sh b/extra/files/gen2-ubuntu2004/provision.sh
deleted file mode 100644
index 4ef32be..0000000
--- a/extra/files/gen2-ubuntu2004/provision.sh
+++ /dev/null
@@ -1,199 +0,0 @@
-#!/bin/bash
-# ubuntu version of provision.sh
-INSTALL_UPDATES=true
-INSTALL_PUPPET=true
-INSTALL_HYPERV=false
-INSTALL_COCKPIT=true
-INSTALL_ZABBIX=false
-STAMP_FILE="/etc/packerinfo"
-
-usage() { echo "Usage: $0 [-u INSTALL_UPDATES ] [-p INSTALL_PUPPET] [-w INSTALL_COCKPIT] [-h INSTALL_HYPERV] [-z INSTALL_ZABBIX]" 1>&2; }
-
-while getopts :u:p:h:w:z: option
- do
- case "${option}"
- in
- u)
- INSTALL_UPDATES="${OPTARG}"
- ;;
- p)
- INSTALL_PUPPET="${OPTARG}"
- ;;
- h)
- INSTALL_HYPERV="${OPTARG}"
- ;;
- w)
- INSTALL_COCKPIT="${OPTARG}"
- ;;
- z)
- INSTALL_ZABBIX="${OPTARG}"
- ;;
- *)
- usage
- ;;
- esac
- done
-echo "INSTALL_UPDATES = $INSTALL_UPDATES"
-echo "INSTALL_COCKPIT = $INSTALL_COCKPIT"
-echo "INSTALL_HYPERV = $INSTALL_HYPERV"
-echo "INSTALL_PUPPET = $INSTALL_PUPPET"
-echo "INSTALL_ZABBIX = $INSTALL_ZABBIX"
-
-echo "Provisioning phase 1 - Starting: Mirror, SELinux and basic packages"
-export DEBIAN_FRONTEND=noninteractive
-apt-get clean all -y
-apt-get update -y
-apt-get install pv perl mc net-tools -y
-# set locale
-sudo update-locale LANG=en_US.UTF-8
-
-if [ "$INSTALL_UPDATES" == "true" ]; then
- echo "Provisioning phase 1 - system updates"
- apt-get -y -q upgrade
- apt-get -y -q clean all
-else
- echo "Provisioning phase 1 - skipping system updates"
-fi
-
-# disable selinux
-echo "Provisioning phase 1 - disabling SELinux"
-if [ -f /etc/sysconfig/selinux ]; then
- sed -i /etc/sysconfig/selinux -r -e 's/^SELINUX=.*/SELINUX=disabled/g'||true
-fi
-
-if [ -f /etc/selinux/config ]; then
- sed -i /etc/selinux/config -r -e 's/^SELINUX=.*/SELINUX=disabled/g'||true
-fi
-
-echo "Provisioning phase 1 - all done"
-
-echo "Provisioning phase 2 - Starting: Cockpit, Zabbix, Puppet"
-# cockpit repository
-if [ "$INSTALL_COCKPIT" == "true" ]; then
- echo "Provisioning phase 2 - Cockpit"
- apt-get install cockpit -y -q
- systemctl start cockpit.socket
- systemctl enable --now cockpit.socket
- systemctl status cockpit.socket
-else
- echo "Provisioning phase 2 - skipping Cockpit"
-fi
-
-# zabbix
-if [ "$INSTALL_ZABBIX" == true ]; then
- echo "Provisioning phase 2 - Zabbix"
-# zabbix 5.2 repository
- wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-1+ubuntu20.04_all.deb
- dpkg -i zabbix-release_6.0-1+ubuntu20.04_all.deb
- rm -rfv zabbix-release_6.0-1+ubuntu20.04_all.deb
- apt-get update -y
- apt-get install zabbix-agent -y
- systemctl enable zabbix-agent
-else
- echo "Provisioning phase 2 - skipping Zabbix agent"
-fi
-
-# puppet
-if [ "$INSTALL_PUPPET" == "true" ]; then
-
- echo "Provisioning phase 2 - Puppet Agent"
- # puppet 6.x repository
- wget https://apt.puppet.com/puppet7-release-focal.deb
- dpkg -i puppet7-release-focal.deb
- rm -rfv puppet7-release-focal.deb
- apt-get update -y
-
- apt-get -y install puppet-agent
- echo "Provisioning phase 2 - Puppet Agent cleaning"
- systemctl stop puppet
- systemctl disable puppet
- if [ -d /etc/puppetlabs/puppet/ssl ]; then
- rm -rf /etc/puppetlabs/puppet/ssl
- fi
-
- if [ -f /tmp/puppet.conf ]; then
- mv /tmp/puppet.conf /etc/puppetlabs/puppet/puppet.conf
- fi
-else
- echo "Provisioning phase 2 - Skipping Puppet agent"
-fi
-echo "Provisioning phase 2 - Done"
-
-echo "Provisioning phase 3 - Starting: Extra packages, timezones, neofetch, firewalld, settings"
-# misc
-echo "Provisioning phase 3 - Timezone"
-timedatectl set-timezone Europe/Copenhagen --no-ask-password
-echo "Provisioning phase 3 - Extra Packages or groups"
-apt-get -y install htop atop iftop iotop firewalld nmap realmd samba nmon samba-common oddjob oddjob-mkhomedir sssd adcli libkrb5-dev libkrb5-3 libwbclient-sssd jq firefox gparted pv neofetch screen telnet ncdu tmux multitail rkhunter smartmontools zsh httpie
-# we don't need sssd
-systemctl disable sssd.service||true
-systemctl stop sssd.service||true
-echo "Provisioning phase 3 - RK hunter"
-rkhunter --propupd
-
-echo "Provisioning phase 3 - MOTD"
-
-if [ -f /tmp/motd.sh ]; then
- mv /tmp/motd.sh /etc/profile.d/motd.sh
- chmod +x /etc/profile.d/motd.sh
-fi
-
-if [ "$INSTALL_HYPERV" == "true" ]; then
- echo "Provisioning phase 3 - Hyper-V/SCVMM Daemons"
- # Hyper-v daemons
- apt-get -y install linux-image-virtual linux-tools-virtual linux-cloud-tools-virtual
- systemctl enable hv-fcopy-daemon
- systemctl enable hv-kvp-daemon
- systemctl enable hv-vss-daemon
- if [ -e /tmp/install ]; then
- cd /tmp||exit
- chmod +x /tmp/install
- /tmp/install "$(ls /tmp/scvmm*.x64.tar)"
- fi
-else
- echo "Provisioning phase 3 - Skipping Hyper-V/SCVMM Daemons"
-fi
-
-echo "Provisioning phase 3 - Firewalld"
-# Firewalld basic configuration.
-apt-get install ufw -y
-ufw default deny incoming
-ufw default allow outgoing
-ufw default allow routed
-ufw allow ssh
-if [ "$INSTALL_ZABBIX" == true ]; then
- echo "Phase 3 - firewalld - adding zabbix rules"
- ufw allow 10050:10052/tcp
-fi
-
-if [ "$INSTALL_COCKPIT" == true ]; then
-echo "Phase 3 - firewalld - adding cockpit rules"
- ufw allow 9090/tcp
-fi
-systemctl enable ufw
-ufw enable
-ufw status numbered
-
-
-echo "Provisioning phase 4 - Final updates and cleaning up"
-
-if [ "$INSTALL_UPDATES" == "true" ]; then
- echo "Provisioning phase 4 - system final updates"
- apt-get -y -q upgrade
- apt-get -y -q clean all
-else
- echo "Provisioning phase 4 - skipping system final updates"
-fi
-
-## Clean logs
-truncate -s 0 /var/log/*.*
-truncate -s 0 /var/log/**/*.*
-find /var/log -type f -name '*.[0-99].gz' -exec rm {} +
-# Create STAMP_FILE
-if [ -e $STAMP_FILE ]; then
- rm -rf $STAMP_FILE
- touch $STAMP_FILE
-fi
-echo "creationDate: $(date +%Y-%m-%d_%H:%M)" >>$STAMP_FILE
-echo "Provisioning phase 4 - Done"
-echo "Provisioning done - all phases"
\ No newline at end of file
diff --git a/extra/files/gen2-ubuntu2004/virtualbox.sh b/extra/files/gen2-ubuntu2004/virtualbox.sh
deleted file mode 100644
index 89ea251..0000000
--- a/extra/files/gen2-ubuntu2004/virtualbox.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env bash
-
-echo "Executing scripts/virtualbox.sh"
-
-if [ -f /tmp/VBoxGuestAdditions.iso ]; then
- mount -o loop /tmp/VBoxGuestAdditions.iso /mnt
- sh /mnt/VBoxLinuxAdditions.run
- rc=$?
- umount /mnt
- rm -rf /tmp/VBoxGuestAdditions.iso
-
- if [ $rc -ne 0 ]; then
- cat /var/log/VBoxGuestAdditions.log
- exit $rc
- else
- echo "Virtualbox guest addons have been installed successfully"
- exit 0
- fi
-else
- echo "No VBoxGuestAdditions.iso could be found"
- exit 0
-fi
-exit 0
diff --git a/extra/files/gen2-ubuntu2204/common-password b/extra/files/gen2-ubuntu2204/common-password
deleted file mode 100644
index 4fd0fb8..0000000
--- a/extra/files/gen2-ubuntu2204/common-password
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# /etc/pam.d/common-password - password-related modules common to all services
-#
-# This file is included from other service-specific PAM config files,
-# and should contain a list of modules that define the services to be
-# used to change user passwords. The default is pam_unix.
-
-# Explanation of pam_unix options:
-#
-# The "sha512" option enables salted SHA512 passwords. Without this option,
-# the default is Unix crypt. Prior releases used the option "md5".
-#
-# The "obscure" option replaces the old `OBSCURE_CHECKS_ENAB' option in
-# login.defs.
-#
-# See the pam_unix manpage for other options.
-
-# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
-# To take advantage of this, it is recommended that you configure any
-# local modules either before or after the default block, and use
-# pam-auth-update to manage selection of other modules. See
-# pam-auth-update(8) for details.
-
-# here are the per-package modules (the "Primary" block)
-password [success=1 default=ignore] pam_unix.so sha512 minlen=1
-# here's the fallback if no module succeeds
-password requisite pam_permit.so
-# prime the stack with a positive return value if there isn't one already;
-# this avoids us returning an error just because nothing sets a success code
-# since the modules above will each just jump around
-password required pam_permit.so
-# and here are more per-package modules (the "Additional" block)
-# end of pam-auth-update config
diff --git a/extra/files/gen2-ubuntu2204/motd.sh b/extra/files/gen2-ubuntu2204/motd.sh
deleted file mode 100644
index 38c136d..0000000
--- a/extra/files/gen2-ubuntu2204/motd.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-neofetch --config /etc/neofetch/config.conf
-if [ -f ~/.Xauthority ]; then
- xauth merge ~/.Xauthority
-fi
-export XAUTHORITY=$HOME/.Xauthority
-
diff --git a/extra/files/gen2-ubuntu2204/puppet.conf b/extra/files/gen2-ubuntu2204/puppet.conf
deleted file mode 100644
index e276910..0000000
--- a/extra/files/gen2-ubuntu2204/puppet.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-# This file can be used to override the default puppet settings.
-# See the following links for more details on what settings are available:
-# - https://docs.puppetlabs.com/puppet/latest/reference/config_important_settings.html
-# - https://docs.puppetlabs.com/puppet/latest/reference/config_about_settings.html
-# - https://docs.puppetlabs.com/puppet/latest/reference/config_file_main.html
-# - https://docs.puppetlabs.com/puppet/latest/reference/configuration.html
-runinterval = 1800
-server = foreman.example.com
diff --git a/extra/files/gen2-ubuntu2204/vagrant.sh b/extra/files/gen2-ubuntu2204/vagrant.sh
deleted file mode 100755
index 326cb60..0000000
--- a/extra/files/gen2-ubuntu2204/vagrant.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env bash
-# Script to manipulate vagrant user for Ubuntu distros
-export DEBIAN_FRONTEND=noninteractive
-echo "Executing scripts/vagrant.sh"
-useradd --badnames -m -U -p "$(echo "vagrant" | openssl passwd -1 -stdin)" -s /bin/bash vagrant
-echo "Executing scripts/vagrant.sh - adding password"
-mkdir -p 700 /home/vagrant/.ssh
-curl -sL https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub -o /home/vagrant/.ssh/authorized_keys
-chmod -v 0600 /home/vagrant/.ssh/authorized_keys
-chown -v -R vagrant:vagrant /home/vagrant/.ssh
-cat > /etc/sudoers.d/vagrant << EOF_sudoers_vagrant
-vagrant ALL=(ALL) NOPASSWD: ALL
-Defaults:vagrant !requiretty
-EOF_sudoers_vagrant
-chmod -v 0440 /etc/sudoers.d/vagrant
-/bin/sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
-if [ -f /etc/pam.d/common-password.bak ]; then
- echo "Restoring original common-password"
- mv -fv /etc/pam.d/common-password.bak /etc/pam.d/common-password
- rm -rfv /etc/pam.d/*.bak
-fi
-echo "End of scripts/vagrant.sh"
diff --git a/extra/files/gen2-ubuntu2204/zeroing.sh b/extra/files/gen2-ubuntu2204/zeroing.sh
deleted file mode 100644
index 68365c4..0000000
--- a/extra/files/gen2-ubuntu2204/zeroing.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env bash
-# Zeroing
-echo "Zeroing phase"
- time dd if=/dev/zero|pv -treb|dd of=/file.zero bs=4096;sync;sync;rm -rfv /file.zero;sync;sync
- rm -rfv /file.zero||true
-echo "Zeroing done"
diff --git a/extra/files/opensuse_leap/15/proxmox/autoinst.xml b/extra/files/opensuse_leap/15/proxmox/autoinst.xml
new file mode 100644
index 0000000..e444beb
--- /dev/null
+++ b/extra/files/opensuse_leap/15/proxmox/autoinst.xml
@@ -0,0 +1,1034 @@
+
+
+
+
+
+
+ repo-backports-update
+ http://download.opensuse.org/update/leap/15.5/backports/
+ Update repository of openSUSE Backports
+ 99
+ /
+
+
+ repo-non-oss
+ http://download.opensuse.org/distribution/leap/15.5/repo/non-oss/
+ Non-OSS Repository
+ 99
+ /
+
+
+ repo-openh264
+ http://codecs.opensuse.org/openh264/openSUSE_Leap/
+ Open H.264 Codec (openSUSE Leap)
+ 99
+
+
+
+ repo-sle-update
+ http://download.opensuse.org/update/leap/15.5/sle/
+ Update repository with updates from SUSE Linux Enterprise 15
+ 99
+ /
+
+
+ repo-update
+ http://download.opensuse.org/update/leap/15.5/oss
+ Main Update Repository
+ 99
+ /
+
+
+ repo-update-non-oss
+ http://download.opensuse.org/update/leap/15.5/non-oss/
+ Update Repository (Non-Oss)
+ 99
+ /
+
+
+
+
+
+ splash=silent preempt=full mitigations=auto quiet security=
+ auto
+ auto
+ false
+ true
+ true
+ gfxterm
+ 8
+ true
+ vga=gfx-1024x768x16
+
+ default
+
+
+ public
+ false
+ off
+ false
+
+
+ Unsolicited incoming network packets are rejected. Incoming packets that are related to outgoing network connections are accepted. Outgoing network connections are allowed.
+
+ false
+ block
+
+
+
+ Block
+ %%REJECT%%
+
+
+ For computers in your demilitarized zone that are publicly-accessible with limited access to your internal network. Only selected incoming connections are accepted.
+
+ false
+ dmz
+
+
+
+ ssh
+
+ DMZ
+ default
+
+
+ All network connections are accepted.
+
+ docker0
+
+ false
+ docker
+
+
+
+ docker
+ ACCEPT
+
+
+ Unsolicited incoming network packets are dropped. Incoming packets that are related to outgoing network connections are accepted. Outgoing network connections are allowed.
+
+ false
+ drop
+
+
+
+ Drop
+ DROP
+
+
+ For use on external networks. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.
+
+ true
+ external
+
+
+
+ ssh
+
+ External
+ default
+
+
+ For use in home areas. You mostly trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.
+
+ false
+ home
+
+
+
+ dhcpv6-client
+ mdns
+ samba-client
+ ssh
+
+ Home
+ default
+
+
+ For use on internal networks. You mostly trust the other computers on the networks to not harm your computer. Only selected incoming connections are accepted.
+
+ false
+ internal
+
+
+
+ dhcpv6-client
+ mdns
+ samba-client
+ ssh
+
+ Internal
+ default
+
+
+ For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.
+
+ false
+ public
+
+
+
+ dhcpv6-client
+ ssh
+
+ Public
+ default
+
+
+ All network connections are accepted.
+
+ false
+ trusted
+
+
+
+ Trusted
+ ACCEPT
+
+
+ For use in work areas. You mostly trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.
+
+ false
+ work
+
+
+
+ dhcpv6-client
+ ssh
+
+ Work
+ default
+
+
+
+
+
+ false
+
+
+
+
+ 100
+ users
+
+
+
+ 480
+ audit
+
+
+
+ 476
+ polkitd
+
+
+
+ 5
+ tty
+
+
+
+ 494
+ kmem
+
+
+
+ 42
+ trusted
+
+
+
+ 490
+ dialout
+
+
+
+ 483
+ video
+
+
+
+ 15
+ shadow
+
+
+
+ 485
+ sgx
+
+
+
+ 71
+ ntadmin
+
+
+
+ 482
+ chrony
+
+
+
+ 486
+ render
+
+
+
+ 475
+ vboxguest
+
+
+
+ 499
+ lock
+
+
+
+ 496
+ systemd-network
+
+
+
+ 478
+ sshd
+
+
+
+ 0
+ root
+
+
+
+ 489
+ disk
+
+
+
+ 484
+ tape
+
+
+
+ 36
+ kvm
+
+
+
+ 2
+ daemon
+
+
+
+ 1
+ bin
+ daemon
+
+
+ 488
+ input
+
+
+
+ 65534
+ nobody
+
+
+
+ 492
+ audio
+
+
+
+ 479
+ nscd
+
+
+
+ 481
+ mail
+ postfix
+
+
+ 487
+ lp
+
+
+
+ 65533
+ nogroup
+
+
+
+ 473
+ vboxvideo
+
+
+
+ 491
+ cdrom
+
+
+
+ 493
+ utmp
+
+
+
+ 474
+ vboxsf
+
+
+
+ 477
+ wheel
+
+
+
+ 497
+ systemd-journal
+
+
+
+ 498
+ messagebus
+
+
+
+ 59
+ maildrop
+ postfix
+
+
+ 495
+ systemd-timesync
+
+
+
+ 51
+ postfix
+
+
+
+ 62
+ man
+
+
+
+
+
+
+ 127.0.0.1
+
+ localhost
+
+
+
+ ::1
+
+ localhost ipv6-localhost ipv6-loopback
+
+
+
+ fe00::0
+
+ ipv6-localnet
+
+
+
+ ff00::0
+
+ ipv6-mcastprefix
+
+
+
+ ff02::1
+
+ ipv6-allnodes
+
+
+
+ ff02::2
+
+ ipv6-allrouters
+
+
+
+ ff02::3
+
+ ipv6-allhosts
+
+
+
+
+
+ en_US
+
+
+
+
+ AUTO
+
+
+ true
+ localhost
+ auto
+
+
+
+ dhcp
+ eth0
+ auto
+
+
+ true
+ true
+ false
+
+
+ eth0
+ ATTR{address}
+ 08:00:27:e7:fe:36
+
+
+
+ true
+ true
+
+
+
+ auto
+
+ systemd
+
+
+
+
+ gpt
+ true
+ true
+
+
+
+ true
+ true
+ btrfs
+ true
+ /
+ uuid
+ 131
+ 2
+ true
+ false
+ 51000639488
+
+
+
+ true
+ home
+
+
+ true
+ opt
+
+
+ true
+ root
+
+
+ true
+ srv
+
+
+ true
+ tmp
+
+
+ true
+ usr/local
+
+
+ false
+ var
+
+
+ @
+
+
+ true
+ true
+ swap
+ true
+ swap
+ uuid
+ 130
+ 3
+ false
+ 2148515328
+
+
+ CT_DISK
+
+
+
+
+ false
+
+
+ multi-user
+
+
+ ModemManager
+ YaST2-Firstboot
+ YaST2-Second-Stage
+ apparmor
+ appstream-sync-cache
+ auditd
+ avahi-daemon
+ bluetooth
+ klog
+ chronyd
+ cron
+ cups
+ wickedd-auto4
+ wickedd-dhcp4
+ wickedd-dhcp6
+ wickedd-nanny
+ display-manager
+ irqbalance
+ issue-generator
+ kbdsettings
+ lvm2-monitor
+ mcelog
+ wicked
+ nscd
+ postfix
+ purge-kernels
+ qemu-guest-agent
+ rsyslog
+ smartd
+ sshd
+ systemd-pstore
+ systemd-remount-fs
+ vgauthd
+ vmblock-fuse
+ vmtoolsd
+
+
+ kdump
+
+
+
+
+ true
+
+
+ wicked
+ snapper
+ shim
+ os-prober
+ openssh
+ openSUSE-release
+ numactl
+ mokutil
+ mc
+ kexec-tools
+ irqbalance
+ grub2-x86_64-efi
+ glibc
+ e2fsprogs
+ dosfstools
+ chrony
+ btrfsprogs
+ autoyast2
+ qemu-guest-agent
+
+
+ apparmor
+ base
+ documentation
+ enhanced_base
+ minimal_base
+ sw_management
+ yast2_basis
+
+
+ Leap
+
+
+
+ false
+ false
+
+
+ Etc/UTC
+
+
+
+ 100
+ /home
+ -1
+ /bin/bash
+ 022
+
+
+
+
+ true
+ User for nscd
+ 479
+ /run/nscd
+ false
+
+
+
+
+
+
+
+
+ /sbin/nologin
+ 492
+ !
+ nscd
+
+
+
+ true
+ Mailer daemon
+ 481
+ /var/spool/clientmqueue
+ false
+
+
+
+
+
+
+
+
+ /usr/sbin/nologin
+ 493
+ !
+ mail
+
+
+
+ true
+ nobody
+ 65534
+ /var/lib/nobody
+ false
+
+
+
+
+
+
+
+
+ /bin/bash
+ 65534
+ !
+ nobody
+
+
+
+ true
+ Printing daemon
+ 487
+ /var/spool/lpd
+ false
+
+
+
+
+
+
+
+
+ /usr/sbin/nologin
+ 490
+ !
+ lp
+
+
+
+ true
+ root
+ 0
+ /root
+ false
+
+
+
+
+
+
+
+
+ /bin/bash
+ 0
+ $6$IQNs7QFyLKsukOty$Trg3.mNKYz.Q4LSkHkAg1wFR1POHFACr38XZqZ4QAojUG3PCnqldmn6GUe9qMinEjKw1LZZsCUkYHa8vZUAcb.
+ root
+
+
+
+ true
+ SSH daemon
+ 478
+ /var/lib/sshd
+ false
+
+
+
+
+
+
+
+
+ /usr/sbin/nologin
+ 491
+ !
+ sshd
+
+
+
+ true
+ NFS statd daemon
+ 65533
+ /var/lib/nfs
+ false
+
+
+
+
+
+
+
+
+ /sbin/nologin
+ 487
+ !
+ statd
+
+
+
+ true
+ User for polkitd
+ 476
+ /var/lib/polkit
+ false
+
+
+
+
+
+
+
+
+ /usr/sbin/nologin
+ 488
+ !
+ polkitd
+
+
+
+ true
+ bin
+ 1
+ /bin
+ false
+
+
+
+
+
+
+
+
+ /usr/sbin/nologin
+ 1
+ !
+ bin
+
+
+
+ true
+ Daemon
+ 2
+ /sbin
+ false
+
+
+
+
+
+
+
+
+ /usr/sbin/nologin
+ 2
+ !
+ daemon
+
+
+
+ true
+ User for D-Bus
+ 498
+ /run/dbus
+ false
+
+
+
+
+
+
+
+
+ /usr/bin/false
+ 499
+ !
+ messagebus
+
+
+
+ true
+ systemd Time Synchronization
+ 495
+ /
+ false
+
+
+
+
+
+
+
+
+ /usr/sbin/nologin
+ 495
+ !*
+ systemd-timesync
+
+
+
+ true
+ Postfix Daemon
+ 51
+ /var/spool/postfix
+ false
+
+
+
+
+
+
+
+
+ /usr/sbin/nologin
+ 51
+ !
+ postfix
+
+
+
+ true
+ Manual pages viewer
+ 62
+ /var/lib/empty
+ false
+
+
+
+
+
+
+
+
+ /usr/sbin/nologin
+ 13
+ !
+ man
+
+
+
+ true
+ systemd Network Management
+ 496
+ /
+ false
+
+
+
+
+
+
+
+
+ /usr/sbin/nologin
+ 496
+ !*
+ systemd-network
+
+
+
+ true
+ user for rpcbind
+ 65534
+ /var/lib/empty
+ false
+
+
+
+
+
+
+
+
+ /sbin/nologin
+ 489
+ !
+ rpc
+
+
+
+ true
+ Chrony Daemon
+ 482
+ /var/lib/chrony
+ false
+
+
+
+
+
+
+
+
+ /usr/sbin/nologin
+ 494
+ !
+ chrony
+
+
+
diff --git a/extra/files/gen2-oraclelinux7/ks-kvm.cfg b/extra/files/oraclelinux/7/kvm/ks-kvm.cfg
similarity index 99%
rename from extra/files/gen2-oraclelinux7/ks-kvm.cfg
rename to extra/files/oraclelinux/7/kvm/ks-kvm.cfg
index 10997e5..f922d28 100644
--- a/extra/files/gen2-oraclelinux7/ks-kvm.cfg
+++ b/extra/files/oraclelinux/7/kvm/ks-kvm.cfg
@@ -90,5 +90,6 @@ kernel-headers
make
patch
gcc
+git
spice-vdagent
%end
diff --git a/extra/files/gen2-rockylinux8/ks-kvm.cfg b/extra/files/oraclelinux/8/hyperv/ks.cfg
similarity index 79%
rename from extra/files/gen2-rockylinux8/ks-kvm.cfg
rename to extra/files/oraclelinux/8/hyperv/ks.cfg
index 4b87cb3..e6433db 100644
--- a/extra/files/gen2-rockylinux8/ks-kvm.cfg
+++ b/extra/files/oraclelinux/8/hyperv/ks.cfg
@@ -1,6 +1,5 @@
#version=RHEL8
# X Window System configuration information
-# xconfig --startxonboot
# License agreement
eula --agreed
# Use graphical install
@@ -30,26 +29,29 @@ lang en_US --addsupport=en_GB.UTF-8
repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
# Root password
-rootpw --iscrypted $6$kivIgMEEjORaheG3$MTEQUVvZE0744qxUdXrSXfs/ePGYOVNGJv9aXVUyXRCiX3oizj69RF5Rw17npKPiltKgdepk0yO8/gzJQ2Se6/
+rootpw --plaintext password
# System timezone
timezone UTC --isUtc --ntpservers=0.rhel.pool.ntp.org
# System bootloader configuration
-bootloader --location=mbr
+bootloader
#autopart --type=lvm
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
-part /boot/efi --fstype="vfat" --size=200
-part /boot --fstype="ext4" --size=1024
-part swap --fstype="swap" --size=16384
+
+#Disk partitioning information
+part /boot/efi --fstype="vfat" --size=400
+part /boot --fstype="ext4" --size=2048
+part swap --fstype="swap" --size=8192
part / --fstype="ext4" --grow --size=1
+
%packages
@guest-agents
-@headless-management
@legacy-unix
@system-tools
+bash
mc
curl
wget
@@ -57,8 +59,10 @@ tar
bzip2
kernel-devel
kernel-headers
+kernel-uek-devel
perl
gcc
+git
make
elfutils-libelf-devel
langpacks-en
@@ -68,7 +72,11 @@ openssh-clients
openssh
python3-pip
python3-setuptools
+tuned
+tuned-profiles-atomic
+tuned-utils
spice-vdagent
+qemu-guest-agent
%end
%addon com_redhat_subscription_manager
@@ -89,17 +97,12 @@ pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
-systemctl enable sshd --now
+systemctl enable sshd
%end
%post --log=/var/log/anaconda/kickstart_post.log
-systemctl enable sshd --now
-systemctl enable qemu-guest-agent
+#systemctl enable qemu-guest-agent
systemctl set-default multi-user.target
-#cp -pr /boot/efi/EFI/rockylinux/* /boot/efi/EFI/BOOT/
-# delete libvirt
-systemctl stop libvirtd
-systemctl disable libvirtd
%end
#reboot
diff --git a/extra/files/gen2-oraclelinux8/ks-kvm.cfg b/extra/files/oraclelinux/8/kvm/ks.cfg
similarity index 94%
rename from extra/files/gen2-oraclelinux8/ks-kvm.cfg
rename to extra/files/oraclelinux/8/kvm/ks.cfg
index 16bb357..77d2c7c 100644
--- a/extra/files/gen2-oraclelinux8/ks-kvm.cfg
+++ b/extra/files/oraclelinux/8/kvm/ks.cfg
@@ -1,6 +1,5 @@
#version=RHEL8
# X Window System configuration information
-#xconfig --startxonboot
# License agreement
eula --agreed
# Use graphical install
@@ -34,7 +33,7 @@ rootpw --plaintext password
# System timezone
timezone UTC --isUtc --ntpservers=0.rhel.pool.ntp.org
# System bootloader configuration
-bootloader --location=mbr
+bootloader
#autopart --type=lvm
zerombr
# Partition clearing information
@@ -53,10 +52,9 @@ logvol /var --vgname=vg_root --size=8192 --name=lv_var
%packages
@guest-agents
-qemu-guest-agent
-#@headless-management
@legacy-unix
@system-tools
+bash
mc
curl
wget
@@ -67,6 +65,7 @@ kernel-headers
kernel-uek-devel
perl
gcc
+git
make
elfutils-libelf-devel
langpacks-en
@@ -76,7 +75,11 @@ openssh-clients
openssh
python3-pip
python3-setuptools
+tuned
+tuned-profiles-atomic
+tuned-utils
spice-vdagent
+qemu-guest-agent
%end
%addon com_redhat_subscription_manager
@@ -97,11 +100,10 @@ pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
-systemctl enable sshd --now
+systemctl enable sshd
%end
%post --log=/var/log/anaconda/kickstart_post.log
-systemctl enable sshd --now
systemctl enable qemu-guest-agent
systemctl set-default multi-user.target
%end
diff --git a/extra/files/oraclelinux/8/proxmox/ks.cfg b/extra/files/oraclelinux/8/proxmox/ks.cfg
new file mode 100644
index 0000000..77d2c7c
--- /dev/null
+++ b/extra/files/oraclelinux/8/proxmox/ks.cfg
@@ -0,0 +1,112 @@
+#version=RHEL8
+# X Window System configuration information
+# License agreement
+eula --agreed
+# Use graphical install
+text
+# SELinux configuration
+selinux --disabled
+# Network information
+network --bootproto=dhcp --noipv6 --activate
+#network --bootproto=dhcp --hostname=localhost.localdomain
+# firewall
+firewall --disabled
+
+#ignoredisk --only-use=sda
+# Use CDROM installation media
+cdrom
+# Run the Setup Agent on first boot
+firstboot --disable
+# System services
+services --enabled="chronyd"
+services --enabled="sshd"
+services --enabled="NetworkManager"
+
+# Keyboard layouts
+keyboard --vckeymap=us --xlayouts='us'
+# System language
+lang en_US --addsupport=en_GB.UTF-8
+
+repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
+# Root password
+rootpw --plaintext password
+# System timezone
+timezone UTC --isUtc --ntpservers=0.rhel.pool.ntp.org
+# System bootloader configuration
+bootloader
+#autopart --type=lvm
+zerombr
+# Partition clearing information
+clearpart --all --initlabel
+# Disk partitioning information
+
+#Disk partitioning information
+part /boot --fstype="ext4" --size=2048
+part swap --fstype="swap" --size=8192
+
+part pv.01 --size=1 --grow
+volgroup vg_root pv.01
+logvol / --vgname=vg_root --size=1 --grow --name=lv_root
+logvol /var --vgname=vg_root --size=8192 --name=lv_var
+
+
+%packages
+@guest-agents
+@legacy-unix
+@system-tools
+bash
+mc
+curl
+wget
+tar
+bzip2
+kernel-devel
+kernel-headers
+kernel-uek-devel
+perl
+gcc
+git
+make
+elfutils-libelf-devel
+langpacks-en
+glibc-all-langpacks
+openssh-server
+openssh-clients
+openssh
+python3-pip
+python3-setuptools
+tuned
+tuned-profiles-atomic
+tuned-utils
+spice-vdagent
+qemu-guest-agent
+%end
+
+%addon com_redhat_subscription_manager
+%end
+%addon ADDON_placeholder --disable --reserve-mb=auto
+%end
+%addon com_redhat_kdump --disable
+%end
+
+%anaconda
+pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
+pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
+pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
+%end
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post_sshd.log
+sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
+systemctl enable sshd
+%end
+
+%post --log=/var/log/anaconda/kickstart_post.log
+systemctl enable qemu-guest-agent
+systemctl set-default multi-user.target
+%end
+
+#reboot
+reboot
\ No newline at end of file
diff --git a/extra/files/gen2-oraclelinux8/ks.cfg b/extra/files/oraclelinux/8/proxmox/ks.cfg.bak
similarity index 98%
rename from extra/files/gen2-oraclelinux8/ks.cfg
rename to extra/files/oraclelinux/8/proxmox/ks.cfg.bak
index ee2d247..de1e2d7 100644
--- a/extra/files/gen2-oraclelinux8/ks.cfg
+++ b/extra/files/oraclelinux/8/proxmox/ks.cfg.bak
@@ -58,6 +58,7 @@ kernel-headers
kernel-uek-devel
perl
gcc
+git
make
elfutils-libelf-devel
langpacks-en
@@ -71,6 +72,8 @@ openssh
%end
%addon ADDON_placeholder --disable --reserve-mb=auto
%end
+%addon com_redhat_kdump --disable
+%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
diff --git a/extra/files/gen2-oraclelinux8/uefi.sh b/extra/files/oraclelinux/8/uefi.sh
similarity index 100%
rename from extra/files/gen2-oraclelinux8/uefi.sh
rename to extra/files/oraclelinux/8/uefi.sh
diff --git a/extra/files/oraclelinux/9/hyperv/ks.cfg b/extra/files/oraclelinux/9/hyperv/ks.cfg
new file mode 100644
index 0000000..400798b
--- /dev/null
+++ b/extra/files/oraclelinux/9/hyperv/ks.cfg
@@ -0,0 +1,104 @@
+#version=RHEL9
+# X Window System configuration information
+#xconfig --startxonboot
+# License agreement
+eula --agreed
+# Use graphical install
+text
+# SELinux configuration
+selinux --disabled
+# Network information
+network --bootproto=dhcp --noipv6 --activate
+#network --bootproto=dhcp --hostname=localhost.localdomain
+# firewall
+firewall --disabled
+
+#ignoredisk --only-use=sda
+# Use CDROM installation media
+cdrom
+# Run the Setup Agent on first boot
+firstboot --disable
+# System services
+services --enabled="chronyd"
+services --enabled="sshd"
+services --enabled="NetworkManager"
+
+# Keyboard layouts
+keyboard --vckeymap=us --xlayouts='us'
+# System language
+lang en_US --addsupport=en_GB.UTF-8
+
+repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
+# Root password
+rootpw --plaintext password
+# System timezone
+timezone UTC --utc
+# System bootloader configuration
+bootloader --location=mbr
+#autopart --type=lvm
+zerombr
+# Partition clearing information
+clearpart --all --initlabel
+# Disk partitioning information
+
+#Disk partitioning information
+part /boot/efi --fstype="vfat" --size=400
+part /boot --fstype="ext4" --size=2048
+part swap --fstype="swap" --size=8192
+part / --fstype="ext4" --grow --size=1
+
+
+%packages
+@guest-agents
+@legacy-unix
+@system-tools
+mc
+curl
+wget
+tar
+bzip2
+kernel-devel
+kernel-headers
+kernel-uek-devel
+perl
+gcc
+git
+make
+elfutils-libelf-devel
+langpacks-en
+glibc-all-langpacks
+openssh-server
+openssh-clients
+openssh
+python3-pip
+python3-setuptools
+tuned
+tuned-profiles-atomic
+spice-vdagent
+qemu-guest-agent
+%end
+
+%addon com_redhat_subscription_manager
+%end
+%addon ADDON_placeholder --disable --reserve-mb=auto
+%end
+%addon com_redhat_kdump --disable
+%end
+
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post_sshd.log
+sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
+systemctl enable sshd --now
+%end
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post.log
+#systemctl enable qemu-guest-agent
+systemctl set-default multi-user.target
+%end
+
+#reboot
+reboot
\ No newline at end of file
diff --git a/extra/files/gen2-oraclelinux9/ks-kvm.cfg b/extra/files/oraclelinux/9/kvm/ks-kvm.cfg
similarity index 99%
rename from extra/files/gen2-oraclelinux9/ks-kvm.cfg
rename to extra/files/oraclelinux/9/kvm/ks-kvm.cfg
index 8b038ed..72ad978 100644
--- a/extra/files/gen2-oraclelinux9/ks-kvm.cfg
+++ b/extra/files/oraclelinux/9/kvm/ks-kvm.cfg
@@ -53,7 +53,6 @@ logvol /var --vgname=vg_root --size=8192 --name=lv_var
%packages
@guest-agents
-qemu-guest-agent
@legacy-unix
@system-tools
mc
@@ -66,6 +65,7 @@ kernel-headers
kernel-uek-devel
perl
gcc
+git
make
elfutils-libelf-devel
langpacks-en
@@ -78,6 +78,7 @@ python3-setuptools
tuned
tuned-profiles-atomic
spice-vdagent
+qemu-guest-agent
%end
%addon com_redhat_subscription_manager
diff --git a/extra/files/gen2-oraclelinux9/ks.cfg b/extra/files/oraclelinux/9/proxmox/ks.cfg
similarity index 97%
rename from extra/files/gen2-oraclelinux9/ks.cfg
rename to extra/files/oraclelinux/9/proxmox/ks.cfg
index 45994d4..99faf0b 100644
--- a/extra/files/gen2-oraclelinux9/ks.cfg
+++ b/extra/files/oraclelinux/9/proxmox/ks.cfg
@@ -54,6 +54,7 @@ kernel-headers
kernel-uek-devel
perl
gcc
+git
make
elfutils-libelf-devel
langpacks-en
@@ -69,6 +70,8 @@ tuned-profiles-atomic
%end
%addon ADDON_placeholder --disable --reserve-mb=auto
%end
+%addon com_redhat_kdump --disable
+%end
# post part
%post --log=/var/log/anaconda/kickstart_post_sshd.log
diff --git a/extra/files/gen2-oraclelinux9/uefi.sh b/extra/files/oraclelinux/9/uefi.sh
similarity index 100%
rename from extra/files/gen2-oraclelinux9/uefi.sh
rename to extra/files/oraclelinux/9/uefi.sh
diff --git a/extra/files/rockylinux/8/hyperv/ks.cfg b/extra/files/rockylinux/8/hyperv/ks.cfg
new file mode 100644
index 0000000..6b84210
--- /dev/null
+++ b/extra/files/rockylinux/8/hyperv/ks.cfg
@@ -0,0 +1,101 @@
+#version=RHEL8
+# X Window System configuration information
+# License agreement
+eula --agreed
+# Use graphical install
+text
+# SELinux configuration
+selinux --disabled
+# Network information
+network --bootproto=dhcp --noipv6 --activate
+# firewall
+firewall --disabled
+# Use CDROM installation media
+cdrom
+# Run the Setup Agent on first boot
+firstboot --disable
+# System services
+services --enabled="chronyd"
+services --enabled="sshd"
+services --enabled="NetworkManager"
+
+# Keyboard layouts
+keyboard --vckeymap=us --xlayouts='us'
+# System language
+lang en_US --addsupport=en_GB.UTF-8
+
+repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
+# Root password
+rootpw --plaintext password
+# System timezone
+timezone UTC --isUtc --ntpservers=0.rhel.pool.ntp.org
+# System bootloader configuration
+bootloader
+zerombr
+# Partition clearing information
+clearpart --all --initlabel
+# Disk partitioning information
+part /boot/efi --fstype="vfat" --size=400
+part /boot --fstype="ext4" --size=2048
+part swap --fstype="swap" --size=8192
+part / --fstype="ext4" --grow --size=1
+
+%packages
+@guest-agents
+@legacy-unix
+@system-tools
+bash
+mc
+curl
+wget
+tar
+bzip2
+kernel-devel
+kernel-headers
+perl
+gcc
+git
+make
+elfutils-libelf-devel
+langpacks-en
+glibc-all-langpacks
+openssh-server
+openssh-clients
+openssh
+python3-pip
+python3-setuptools
+tuned
+tuned-profiles-atomic
+tuned-utils
+spice-vdagent
+qemu-guest-agent
+%end
+
+%addon com_redhat_subscription_manager
+%end
+%addon ADDON_placeholder --disable --reserve-mb=auto
+%end
+%addon com_redhat_kdump --disable
+%end
+
+%anaconda
+pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
+pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
+pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
+%end
+
+# post part
+%post --log=/var/log/anaconda/kickstart_post_sshd.log
+sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
+sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
+systemctl enable sshd
+%end
+
+%post --log=/var/log/anaconda/kickstart_post.log
+systemctl enable qemu-guest-agent
+systemctl set-default multi-user.target
+%end
+
+#reboot
+reboot
\ No newline at end of file
diff --git a/extra/files/gen2-rockylinux8/uefi.sh b/extra/files/rockylinux/8/uefi.sh
similarity index 100%
rename from extra/files/gen2-rockylinux8/uefi.sh
rename to extra/files/rockylinux/8/uefi.sh
diff --git a/extra/files/gen2-rockylinux9/ks.cfg b/extra/files/rockylinux/9/hyperv/ks.cfg
similarity index 96%
rename from extra/files/gen2-rockylinux9/ks.cfg
rename to extra/files/rockylinux/9/hyperv/ks.cfg
index 3800581..0cb66fd 100644
--- a/extra/files/gen2-rockylinux9/ks.cfg
+++ b/extra/files/rockylinux/9/hyperv/ks.cfg
@@ -55,6 +55,7 @@ kernel-devel
kernel-headers
perl
gcc
+git
make
elfutils-libelf-devel
langpacks-en
@@ -64,14 +65,17 @@ openssh-clients
openssh
tuned
tuned-profiles-atomic
+tuned-utils
spice-vdagent
+qemu-guest-agent
%end
%addon com_redhat_subscription_manager
%end
%addon ADDON_placeholder --disable --reserve-mb=auto
%end
-
+%addon com_redhat_kdump --disable
+%end
# post part
%post --log=/var/log/anaconda/kickstart_post_sshd.log
sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
diff --git a/extra/files/gen2-rockylinux9/uefi.sh b/extra/files/rockylinux/9/uefi.sh
similarity index 100%
rename from extra/files/gen2-rockylinux9/uefi.sh
rename to extra/files/rockylinux/9/uefi.sh
diff --git a/extra/files/gen2-ubuntu2004/meta-data b/extra/files/ubuntu/20.04/hyperv/meta-data
similarity index 100%
rename from extra/files/gen2-ubuntu2004/meta-data
rename to extra/files/ubuntu/20.04/hyperv/meta-data
diff --git a/extra/files/gen2-ubuntu2204/user-data b/extra/files/ubuntu/20.04/hyperv/user-data
similarity index 91%
rename from extra/files/gen2-ubuntu2204/user-data
rename to extra/files/ubuntu/20.04/hyperv/user-data
index c930d1c..22e73c1 100644
--- a/extra/files/gen2-ubuntu2204/user-data
+++ b/extra/files/ubuntu/20.04/hyperv/user-data
@@ -34,6 +34,7 @@ autoinstall:
- linux-tools-virtual
# - linux-cloud-tools-virtual
- net-tools
+ - qemu-guest-agent
locale: en_US.UTF-8
timezone: Europe/Copenhagen
ssh:
@@ -50,9 +51,12 @@ autoinstall:
#- echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu
- sed -ie 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="net.ifnames=0 ipv6.disable=1 biosdevname=0 elevator=noop"/' /target/etc/default/grub
- sed -ie 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /target/etc/ssh/sshd_config
+ - sed -ie 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /target/etc/ssh/sshd_config
+ - sed -ie 's/#AllowAgentForwarding yes/AllowAgentForwarding yes/' /target/etc/ssh/sshd_config
- curtin in-target -- update-grub2
# virtual package is required for some cloud images. Lack of it causes failure in communication.
- curtin in-target -- apt-get -y install linux-cloud-tools-virtual||true
+ - curtin in-target -- systemctl enable qemu-guest-agent
storage:
config:
- type: disk
diff --git a/extra/files/gen2-ubuntu2004/uefi.sh b/extra/files/ubuntu/20.04/uefi.sh
similarity index 100%
rename from extra/files/gen2-ubuntu2004/uefi.sh
rename to extra/files/ubuntu/20.04/uefi.sh
diff --git a/extra/files/gen2-ubuntu2204/meta-data b/extra/files/ubuntu/22.04/hyperv/meta-data
similarity index 100%
rename from extra/files/gen2-ubuntu2204/meta-data
rename to extra/files/ubuntu/22.04/hyperv/meta-data
diff --git a/extra/files/gen2-ubuntu2004/user-data b/extra/files/ubuntu/22.04/hyperv/user-data
similarity index 82%
rename from extra/files/gen2-ubuntu2004/user-data
rename to extra/files/ubuntu/22.04/hyperv/user-data
index 1f990b0..22e73c1 100644
--- a/extra/files/gen2-ubuntu2004/user-data
+++ b/extra/files/ubuntu/22.04/hyperv/user-data
@@ -3,17 +3,9 @@
autoinstall:
version: 1
indentity:
- hostname: ubuntu2004
+ hostname: ubuntu2204
password: $6$B1yxqMfR$gj5FAxkfd16958twhq6w/IQ14GuTPucLDArz6o/VZftkT41PQi7.hoxpDMonWQdVBbyV/RlpxytLKXnc8MfXG/
username: root
- # users:
- # - name: root
- # lock-passwd: false
- # disable_root: false
- # password: $6$B1yxqMfR$gj5FAxkfd16958twhq6w/IQ14GuTPucLDArz6o/VZftkT41PQi7.hoxpDMonWQdVBbyV/RlpxytLKXnc8MfXG/
- # ssh_pwauth: true
- # runcmd:
- # - echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
early-commands:
- systemctl stop ssh # otherwise packer tries to connect and exceed max attempts
network:
@@ -42,6 +34,7 @@ autoinstall:
- linux-tools-virtual
# - linux-cloud-tools-virtual
- net-tools
+ - qemu-guest-agent
locale: en_US.UTF-8
timezone: Europe/Copenhagen
ssh:
@@ -51,15 +44,19 @@ autoinstall:
disable_root: false
lock-passwd: false
ssh_pwauth: true
- hostname: ubuntu2004
+ hostname: ubuntu2204
password: $6$B1yxqMfR$gj5FAxkfd16958twhq6w/IQ14GuTPucLDArz6o/VZftkT41PQi7.hoxpDMonWQdVBbyV/RlpxytLKXnc8MfXG/
username: root
late-commands:
#- echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu
- sed -ie 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="net.ifnames=0 ipv6.disable=1 biosdevname=0 elevator=noop"/' /target/etc/default/grub
- sed -ie 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /target/etc/ssh/sshd_config
- - curtin in-target --target=/target -- update-grub2
- - curtin in-target --target=/target -- apt-get -y install linux-cloud-tools-virtual||true
+ - sed -ie 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /target/etc/ssh/sshd_config
+ - sed -ie 's/#AllowAgentForwarding yes/AllowAgentForwarding yes/' /target/etc/ssh/sshd_config
+ - curtin in-target -- update-grub2
+ # virtual package is required for some cloud images. Lack of it causes failure in communication.
+ - curtin in-target -- apt-get -y install linux-cloud-tools-virtual||true
+ - curtin in-target -- systemctl enable qemu-guest-agent
storage:
config:
- type: disk
diff --git a/extra/files/ubuntu/22.04/proxmox/meta-data b/extra/files/ubuntu/22.04/proxmox/meta-data
new file mode 100644
index 0000000..e69de29
diff --git a/extra/files/ubuntu/22.04/proxmox/user-data b/extra/files/ubuntu/22.04/proxmox/user-data
new file mode 100644
index 0000000..22e73c1
--- /dev/null
+++ b/extra/files/ubuntu/22.04/proxmox/user-data
@@ -0,0 +1,106 @@
+#cloud-config
+
+autoinstall:
+ version: 1
+ indentity:
+ hostname: ubuntu2204
+ password: $6$B1yxqMfR$gj5FAxkfd16958twhq6w/IQ14GuTPucLDArz6o/VZftkT41PQi7.hoxpDMonWQdVBbyV/RlpxytLKXnc8MfXG/
+ username: root
+ early-commands:
+ - systemctl stop ssh # otherwise packer tries to connect and exceed max attempts
+ network:
+ network:
+ version: 2
+ ethernets:
+ eth0:
+ dhcp4: yes
+ dhcp-identifier: mac
+ update: no
+ apt:
+ geoip: true
+ preserve_sources_list: false
+ primary:
+ - arches: [amd64]
+ uri: "http://archive.ubuntu.com/ubuntu/"
+ packages:
+ - mc
+ - curl
+ - wget
+ - sudo
+ - tar
+ - bzip2
+ - build-essential
+ - linux-image-virtual
+ - linux-tools-virtual
+# - linux-cloud-tools-virtual
+ - net-tools
+ - qemu-guest-agent
+ locale: en_US.UTF-8
+ timezone: Europe/Copenhagen
+ ssh:
+ install-server: true
+ allow-pw: true
+ user-data:
+ disable_root: false
+ lock-passwd: false
+ ssh_pwauth: true
+ hostname: ubuntu2204
+ password: $6$B1yxqMfR$gj5FAxkfd16958twhq6w/IQ14GuTPucLDArz6o/VZftkT41PQi7.hoxpDMonWQdVBbyV/RlpxytLKXnc8MfXG/
+ username: root
+ late-commands:
+ #- echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu
+ - sed -ie 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="net.ifnames=0 ipv6.disable=1 biosdevname=0 elevator=noop"/' /target/etc/default/grub
+ - sed -ie 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /target/etc/ssh/sshd_config
+ - sed -ie 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /target/etc/ssh/sshd_config
+ - sed -ie 's/#AllowAgentForwarding yes/AllowAgentForwarding yes/' /target/etc/ssh/sshd_config
+ - curtin in-target -- update-grub2
+ # virtual package is required for some cloud images. Lack of it causes failure in communication.
+ - curtin in-target -- apt-get -y install linux-cloud-tools-virtual||true
+ - curtin in-target -- systemctl enable qemu-guest-agent
+storage:
+ config:
+ - type: disk
+ id: disk0
+ ptable: gpt
+ wipe: superblock
+ grub_device: true
+ match:
+ size: largest
+ - id: efi-partition # create partitions on disk (like sda1)
+ type: partition
+ device: disk0
+ size: 512MB
+ flag: boot # EFI system partition needs boot flag
+ - type: partition
+ id: boot-partition
+ device: disk0
+ size: 2GB
+ - type: partition
+ device: disk0
+ id: root-partition
+ size: -1
+ - id: efi-partition-fs # format partitions on disk
+ type: format
+ volume: efi-partition
+ fstype: fat32
+ label: EFI
+ - id: boot-partition-fs
+ type: format
+ fstype: ext4
+ volume: boot-partition
+ - id: root-partition-fs
+ type: format
+ fstype: ext4
+ volume: root-partition
+ - id: efi-partition-fs-mount # mount partitions
+ type: mount
+ device: efi-partition-fs
+ path: /boot/efi
+ - id: root-partition-fs-mount
+ type: mount
+ path: /
+ device: root-partition-fs
+ - id: boot-partition-fs-mount
+ type: mount
+ path: /boot
+ device: boot-partition-fs
diff --git a/extra/files/gen2-ubuntu2204/uefi.sh b/extra/files/ubuntu/22.04/uefi.sh
similarity index 100%
rename from extra/files/gen2-ubuntu2204/uefi.sh
rename to extra/files/ubuntu/22.04/uefi.sh
diff --git a/extra/files/gen2-ubuntu2204/virtualbox.sh b/extra/files/ubuntu/22.04/virtualbox/virtualbox.sh
similarity index 100%
rename from extra/files/gen2-ubuntu2204/virtualbox.sh
rename to extra/files/ubuntu/22.04/virtualbox/virtualbox.sh
diff --git a/extra/files/ubuntu/23.04/proxmox/meta-data b/extra/files/ubuntu/23.04/proxmox/meta-data
new file mode 100644
index 0000000..e69de29
diff --git a/extra/files/ubuntu/23.04/proxmox/user-data b/extra/files/ubuntu/23.04/proxmox/user-data
new file mode 100644
index 0000000..ccfcbe8
--- /dev/null
+++ b/extra/files/ubuntu/23.04/proxmox/user-data
@@ -0,0 +1,116 @@
+#cloud-config
+
+autoinstall:
+ version: 1
+ # indentity:
+ # hostname: ubuntu2304
+ # password: $6$B1yxqMfR$gj5FAxkfd16958twhq6w/IQ14GuTPucLDArz6o/VZftkT41PQi7.hoxpDMonWQdVBbyV/RlpxytLKXnc8MfXG/
+ # username: root
+ # lock-passwd: false
+ early-commands:
+ - systemctl stop ssh # otherwise packer tries to connect and exceed max attempts
+ network:
+ network:
+ version: 2
+ ethernets:
+ eth0:
+ dhcp4: yes
+ dhcp-identifier: mac
+ update: no
+ apt:
+ geoip: true
+ preserve_sources_list: false
+ primary:
+ - arches: [amd64]
+ uri: "http://archive.ubuntu.com/ubuntu/"
+ packages:
+ - mc
+ - curl
+ - wget
+ - sudo
+ - tar
+ - bzip2
+ - build-essential
+ - linux-image-virtual
+ - linux-tools-virtual
+# - linux-cloud-tools-virtual
+ - net-tools
+ - qemu-guest-agent
+ locale: en_US.UTF-8
+ timezone: Europe/Copenhagen
+ ssh:
+ install-server: true
+ allow-pw: true
+ user-data:
+ disable_root: false
+ lock-passwd: false
+ ssh_pwauth: true
+ hostname: ubuntu2304
+ # password: $6$B1yxqMfR$gj5FAxkfd16958twhq6w/IQ14GuTPucLDArz6o/VZftkT41PQi7.hoxpDMonWQdVBbyV/RlpxytLKXnc8MfXG/
+ username: root
+ chpasswd:
+ expire: false
+ users:
+ - name: root
+ password: password
+ type: text
+ - name: ubuntu
+ password: password
+ type: text
+ late-commands:
+ #- echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu
+ - sed -ie 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="net.ifnames=0 ipv6.disable=1 biosdevname=0"/' /target/etc/default/grub
+ - sed -ie 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /target/etc/ssh/sshd_config
+ - sed -ie 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /target/etc/ssh/sshd_config
+ - sed -ie 's/#AllowAgentForwarding yes/AllowAgentForwarding yes/' /target/etc/ssh/sshd_config
+ - curtin in-target -- update-grub2
+ # virtual package is required for some cloud images. Lack of it causes failure in communication.
+ - curtin in-target -- apt-get -y install linux-cloud-tools-virtual||true
+ - curtin in-target -- systemctl enable qemu-guest-agent
+storage:
+ config:
+ - type: disk
+ id: disk0
+ ptable: gpt
+ wipe: superblock
+ grub_device: true
+ match:
+ size: largest
+ - id: efi-partition # create partitions on disk (like sda1)
+ type: partition
+ device: disk0
+ size: 512MB
+ flag: boot # EFI system partition needs boot flag
+ - type: partition
+ id: boot-partition
+ device: disk0
+ size: 2GB
+ - type: partition
+ device: disk0
+ id: root-partition
+ size: -1
+ - id: efi-partition-fs # format partitions on disk
+ type: format
+ volume: efi-partition
+ fstype: fat32
+ label: EFI
+ - id: boot-partition-fs
+ type: format
+ fstype: ext4
+ volume: boot-partition
+ - id: root-partition-fs
+ type: format
+ fstype: ext4
+ volume: root-partition
+ - id: efi-partition-fs-mount # mount partitions
+ type: mount
+ device: efi-partition-fs
+ path: /boot/efi
+ - id: root-partition-fs-mount
+ type: mount
+ path: /
+ device: root-partition-fs
+ - id: boot-partition-fs-mount
+ type: mount
+ path: /boot
+ device: boot-partition-fs
diff --git a/extra/files/gen2-ubuntu2004/common-password b/extra/files/ubuntu/shared/common-password
similarity index 100%
rename from extra/files/gen2-ubuntu2004/common-password
rename to extra/files/ubuntu/shared/common-password
diff --git a/extra/files/gen2-ubuntu2004/motd.sh b/extra/files/ubuntu/shared/motd.sh
similarity index 100%
rename from extra/files/gen2-ubuntu2004/motd.sh
rename to extra/files/ubuntu/shared/motd.sh
diff --git a/extra/files/gen2-ubuntu2204/prepare_neofetch.sh b/extra/files/ubuntu/shared/prepare_neofetch.sh
similarity index 98%
rename from extra/files/gen2-ubuntu2204/prepare_neofetch.sh
rename to extra/files/ubuntu/shared/prepare_neofetch.sh
index 818735d..268d14a 100755
--- a/extra/files/gen2-ubuntu2204/prepare_neofetch.sh
+++ b/extra/files/ubuntu/shared/prepare_neofetch.sh
@@ -4,6 +4,8 @@
config="/etc/neofetch/config.conf"
config_dir="/etc/neofetch"
+neofetch || true
+
if [ ! -d $config_dir ];then
echo "No $config_dir exists - creating one"
mkdir -v $config_dir
diff --git a/extra/files/gen2-ubuntu2204/provision.sh b/extra/files/ubuntu/shared/provision.sh
similarity index 83%
rename from extra/files/gen2-ubuntu2204/provision.sh
rename to extra/files/ubuntu/shared/provision.sh
index 3793976..7e7a91c 100644
--- a/extra/files/gen2-ubuntu2204/provision.sh
+++ b/extra/files/ubuntu/shared/provision.sh
@@ -74,10 +74,12 @@ echo "Provisioning phase 2 - Starting: Cockpit, Zabbix, Puppet"
if [ "$INSTALL_COCKPIT" == "true" ]; then
echo "Provisioning phase 2 - Cockpit"
export DEBIAN_FRONTEND=noninteractive
+ systemctl preset cockpit.service
+ systemctl preset cockpit.socket
apt-get install cockpit -y -q
- systemctl start cockpit.socket
- systemctl enable --now cockpit.socket
- systemctl status cockpit.socket
+ systemctl enable cockpit.socket
+ systemctl stop cockpit.socket
+
else
echo "Provisioning phase 2 - skipping Cockpit"
fi
@@ -127,17 +129,18 @@ echo "Provisioning phase 2 - Done"
echo "Provisioning phase 3 - Starting: Extra packages, timezones, neofetch, firewalld, settings"
# misc
echo "Provisioning phase 3 - Timezone"
-timedatectl set-timezone Europe/Copenhagen --no-ask-password
+timedatectl set-timezone UTC --no-ask-password
echo "Provisioning phase 3 - Extra Packages or groups"
export DEBIAN_FRONTEND=noninteractive
apt-get -y update
-apt-get -y install htop atop iftop iotop firewalld nmap realmd samba nmon samba-common oddjob oddjob-mkhomedir sssd adcli libkrb5-dev libkrb5-3 jq firefox gparted pv neofetch screen telnet ncdu tmux multitail rkhunter smartmontools zsh httpie
+apt-get -y install htop atop iftop iotop nmap nmon jq parted pv neofetch screen telnet ncdu multitail smartmontools zsh httpie
apt-get install -y linux-cloud-tools-virtual||true #may fail on arm64, add check for arm64
# we don't need sssd
-systemctl disable sssd.service||true
-systemctl stop sssd.service||true
-echo "Provisioning phase 3 - RK hunter"
-rkhunter --propupd
+# systemctl disable sssd.service||true
+# systemctl stop sssd.service||true
+
+# echo "Provisioning phase 3 - RK hunter"
+# rkhunter --propupd
echo "Provisioning phase 3 - MOTD"
@@ -161,27 +164,30 @@ if [ "$INSTALL_HYPERV" == "true" ]; then
fi
else
echo "Provisioning phase 3 - Skipping Hyper-V/SCVMM Daemons"
+ systemctl disable hv-fcopy-daemon || true
+ systemctl disable hv-kvp-daemon || true
+ systemctl disable hv-vss-daemon || true
fi
echo "Provisioning phase 3 - Firewalld"
# Firewalld basic configuration.
-apt-get install ufw -y
-ufw default deny incoming
-ufw default allow outgoing
-ufw default allow routed
-ufw allow ssh
-if [ "$INSTALL_ZABBIX" == true ]; then
- echo "Phase 3 - firewalld - adding zabbix rules"
- ufw allow 10050:10052/tcp
-fi
-
-if [ "$INSTALL_COCKPIT" == true ]; then
-echo "Phase 3 - firewalld - adding cockpit rules"
- ufw allow 9090/tcp
-fi
-systemctl enable ufw
-ufw enable
-ufw status numbered
+#apt-get install ufw -y
+#ufw default allow incoming
+#ufw default allow outgoing
+#ufw default allow routed
+#ufw allow ssh
+# if [ "$INSTALL_ZABBIX" == true ]; then
+# echo "Phase 3 - firewalld - adding zabbix rules"
+# ufw allow 10050:10052/tcp
+# fi
+
+# if [ "$INSTALL_COCKPIT" == true ]; then
+# echo "Phase 3 - firewalld - adding cockpit rules"
+# ufw allow 9090/tcp
+# fi
+# systemctl disable ufw
+# ufw enable
+# ufw status numbered
echo "Provisioning phase 4 - Final updates and cleaning up"
@@ -204,6 +210,7 @@ if [ -e $STAMP_FILE ]; then
rm -rf $STAMP_FILE
touch $STAMP_FILE
fi
+#neofetch || true
echo "creationDate: $(date +%Y-%m-%d_%H:%M)" >>$STAMP_FILE
echo "Provisioning phase 4 - Done"
echo "Provisioning done - all phases"
\ No newline at end of file
diff --git a/extra/files/gen2-ubuntu2004/puppet.conf b/extra/files/ubuntu/shared/puppet.conf
similarity index 100%
rename from extra/files/gen2-ubuntu2004/puppet.conf
rename to extra/files/ubuntu/shared/puppet.conf
diff --git a/extra/files/gen2-ubuntu2004/vagrant.sh b/extra/files/ubuntu/shared/vagrant.sh
similarity index 100%
rename from extra/files/gen2-ubuntu2004/vagrant.sh
rename to extra/files/ubuntu/shared/vagrant.sh
diff --git a/extra/files/gen2-ubuntu2004/zeroing.sh b/extra/files/ubuntu/shared/zeroing.sh
similarity index 100%
rename from extra/files/gen2-ubuntu2004/zeroing.sh
rename to extra/files/ubuntu/shared/zeroing.sh
diff --git a/extra/files/gen2-2019/dc/Autounattend.xml b/extra/files/windows/2019/hyperv/dc/Autounattend.xml
similarity index 100%
rename from extra/files/gen2-2019/dc/Autounattend.xml
rename to extra/files/windows/2019/hyperv/dc/Autounattend.xml
diff --git a/extra/files/gen2-2019/dc/secondary.iso b/extra/files/windows/2019/hyperv/dc/secondary.iso
similarity index 100%
rename from extra/files/gen2-2019/dc/secondary.iso
rename to extra/files/windows/2019/hyperv/dc/secondary.iso
diff --git a/extra/files/gen2-2019/dc/unattend.xml b/extra/files/windows/2019/hyperv/dc/unattend.xml
similarity index 100%
rename from extra/files/gen2-2019/dc/unattend.xml
rename to extra/files/windows/2019/hyperv/dc/unattend.xml
diff --git a/extra/files/gen2-2019/dc/unattend_vagrant.xml b/extra/files/windows/2019/hyperv/dc/unattend_vagrant.xml
similarity index 100%
rename from extra/files/gen2-2019/dc/unattend_vagrant.xml
rename to extra/files/windows/2019/hyperv/dc/unattend_vagrant.xml
diff --git a/extra/files/gen2-2019/std/Autounattend.xml b/extra/files/windows/2019/hyperv/std/Autounattend.xml
similarity index 100%
rename from extra/files/gen2-2019/std/Autounattend.xml
rename to extra/files/windows/2019/hyperv/std/Autounattend.xml
diff --git a/extra/files/gen2-2019/std/secondary.iso b/extra/files/windows/2019/hyperv/std/secondary.iso
similarity index 100%
rename from extra/files/gen2-2019/std/secondary.iso
rename to extra/files/windows/2019/hyperv/std/secondary.iso
diff --git a/extra/files/gen2-2019/std/unattend.xml b/extra/files/windows/2019/hyperv/std/unattend.xml
similarity index 100%
rename from extra/files/gen2-2019/std/unattend.xml
rename to extra/files/windows/2019/hyperv/std/unattend.xml
diff --git a/extra/files/gen2-2019/std/unattend_vagrant.xml b/extra/files/windows/2019/hyperv/std/unattend_vagrant.xml
similarity index 100%
rename from extra/files/gen2-2019/std/unattend_vagrant.xml
rename to extra/files/windows/2019/hyperv/std/unattend_vagrant.xml
diff --git a/extra/files/windows/2019/proxmox/bootstrap.ps1 b/extra/files/windows/2019/proxmox/bootstrap.ps1
new file mode 100755
index 0000000..7699dd5
--- /dev/null
+++ b/extra/files/windows/2019/proxmox/bootstrap.ps1
@@ -0,0 +1,106 @@
+# This script is called from the answerfile
+
+# You cannot enable Windows PowerShell Remoting on network connections that are set to Public
+# http://msdn.microsoft.com/en-us/library/windows/desktop/aa370750(v=vs.85).aspx
+# http://blogs.msdn.com/b/powershell/archive/2009/04/03/setting-network-location-to-private.aspx
+
+#Write-Host "Copy unattend.xml to C:\Windows\Panther\Unattend\"
+#New-Item C:\Windows\Panther\Unattend -Type Directory
+
+# Get network connections
+$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]'{DCB00C01-570F-4A9B-8D69-199FDBA5723B}'))
+$connections = $networkListManager.GetNetworkConnections()
+
+$connections |ForEach-Object {
+ Write-Host "Setting network config"
+ $_.GetNetwork().GetName() + 'category was previously set to' + $_.GetNetwork().GetCategory() | Out-File c:\windows\temp\logfile.txt
+ $_.GetNetwork().SetCategory(1)
+ $_.GetNetwork().GetName() + 'change to ' + $_.GetNetwork().GetCategory() | Out-File C:\windows\temp\logfile.txt -Append
+}
+
+# Install Virtio Drivers
+
+function Enable-Virtio {
+Write-Host "Installing Virtio Drivers"
+# Search and Install virtio-win-gt-x64.msi Script
+
+# Get all file system drives
+$drives = Get-PSDrive -PSProvider 'FileSystem'
+
+# Loop through each drive to find and run the MSI installer
+foreach ($drive in $drives) {
+ $scriptFile = Join-Path $drive.Root 'virtio-win-gt-x64.msi'
+
+ # Check if the MSI file exists on the current drive
+ if (Test-Path $scriptFile) {
+ # Run the MSI installer with the specified arguments
+ Start-Process msiexec -Wait -ArgumentList '/i', $scriptFile, '/log', 'C:\Windows\Temp\qemu-drivers.log', '/qn', '/passive', '/norestart', 'ADDLOCAL=ALL' -ErrorAction SilentlyContinue
+ }
+}
+# Search and Install virtio-win-gt-x64.msi Script
+Write-Host "Installing QEMU Guest Agent"
+# Get all file system drives
+$drives = Get-PSDrive -PSProvider 'FileSystem'
+
+# Loop through each drive to find and run the MSI installer
+foreach ($drive in $drives) {
+ $scriptFile = Join-Path $drive.Root '/guest-agent/qemu-ga-x86_64.msi'
+
+ # Check if the MSI file exists on the current drive
+ if (Test-Path $scriptFile) {
+ # Run the MSI installer with the specified arguments
+ Start-Process msiexec -Wait -ArgumentList '/i', $scriptFile, '/log', 'C:\Windows\Temp\qemu-guest-agent.log', '/qn', '/passive', '/norestart', 'ADDLOCAL=ALL' -ErrorAction SilentlyContinue
+ }
+ }
+}
+
+# Write-Host "Installing SPICE"
+# # Search and Install virtio-win-guest-tools.exe
+
+# # Get all file system drives
+# $drives = Get-PSDrive -PSProvider 'FileSystem'
+
+# # Loop through each drive to find and run the MSI installer
+# foreach ($drive in $drives) {
+# $scriptFile = Join-Path $drive.Root 'virtio-win-guest-tools.exe'
+
+# # Check if the MSI file exists on the current drive
+# if (Test-Path $scriptFile) {
+# # Run the MSI installer with the specified arguments
+# Start-Process msiexec -Wait -ArgumentList '/i', $scriptFile, '/log', 'C:\Windows\Temp\qemu-drivers.log', '/qn', '/passive', '/norestart', 'ADDLOCAL=ALL' -ErrorAction SilentlyContinue
+# }
+# }
+If (Get-service -Name QEMU-GA -ErrorAction SilentlyContinue) {
+ Write-Host "Starting QEMU Guest Agent"
+ Start-Service -Name QEMU-GA -ErrorAction SilentlyContinue
+}
+
+If (Get-service -Name spice-agent -ErrorAction SilentlyContinue) {
+ Write-Host "Starting SPICE"
+ Start-Service -Name spice-agent -ErrorAction SilentlyContinue
+}
+
+Function Enable-WinRM {
+Write-Host "Enable WinRM"
+netsh advfirewall firewall set rule group="remote administration" new enable=yes
+netsh advfirewall firewall add rule name="WinRM open Port 5985" dir=in action=allow protocol=TCP localport=5985
+
+winrm quickconfig -q
+winrm quickconfig -transport:http
+winrm set winrm/config '@{MaxTimeoutms="7200000"}'
+winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}'
+winrm set winrm/config/winrs '@{MaxProcessesPerShell="0"}'
+winrm set winrm/config/winrs '@{MaxShellsPerUser="0"}'
+winrm set winrm/config/service '@{AllowUnencrypted="true"}'
+winrm set winrm/config/service/auth '@{Basic="true"}'
+winrm set winrm/config/client/auth '@{Basic="true"}'
+
+net stop winrm
+sc.exe config winrm start= auto
+net start winrm
+
+}
+
+Get-WmiObject -Class Win32_UserAccount -Filter "name = 'Administrator'" | Set-WmiInstance -Arguments @{PasswordExpires = 0 }
+Enable-Virtio
+Enable-WinRM
diff --git a/extra/files/gen1-vb/2016-dc/Autounattend.xml b/extra/files/windows/2019/proxmox/dc/Autounattend.xml
old mode 100644
new mode 100755
similarity index 70%
rename from extra/files/gen1-vb/2016-dc/Autounattend.xml
rename to extra/files/windows/2019/proxmox/dc/Autounattend.xml
index 103a50e..7b7dd50
--- a/extra/files/gen1-vb/2016-dc/Autounattend.xml
+++ b/extra/files/windows/2019/proxmox/dc/Autounattend.xml
@@ -16,47 +16,67 @@
- Primary
1
350
+ Primary
2
- Primary
+ 100
+ EFI
+
+
+ 3
+ 128
+ MSR
+
+
+ 4
true
+ Primary
- true
- NTFS
-
1
1
+
+ NTFS
+ de94bba4-06d1-4d40-a16a-bfd50179d6ac
- NTFS
-
- C
2
2
+
+ FAT32
+
+
+ 3
+ 3
+
+
+ 4
+ 4
+
+ NTFS
0
true
+ OnError
/IMAGE/NAME
- Windows Server 2016 SERVERDATACENTER
+ Windows Server 2019 SERVERDATACENTER
0
- 2
+ 4
@@ -66,8 +86,8 @@
OnError
true
- Vagrant
- Hashicorp
+ Administrator
+
@@ -76,8 +96,8 @@
false
- vagrant-2016
- Pacific Standard Time
+ windows-2019
+ Central European Standard Time
@@ -95,53 +115,52 @@
- vagrant
+ password
true
true
- vagrant
+ Administrator
cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
Set Execution Policy 64 Bit
1
- true
+ false
C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
Set Execution Policy 32 Bit
2
- true
+ false
-
- cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\bootstrap.ps1
- Fix public network
+
+ powershell.exe -NoProfile -Command "Get-PSDrive -PSProvider 'FileSystem' | ForEach-Object { $scriptFile = Join-Path $_.Root 'bootstrap.ps1'; if (Test-Path $scriptFile) { & $scriptFile } }"
+ bootstrap
3
- true
+ false
- cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE
+ cmd.exe /c wmic useraccount where "name='Administrator'" set PasswordExpires=FALSE
4
- Disable password expiration for vagrant user
+ Disable password expiration for Administrator user
+ false
+
+ true
+ true
+ true
+ true
+ true
+ Home
+ 1
+
- vagrant
+ password
true
-
-
-
- vagrant
- true
-
- Vagrant User
- Administrators
- vagrant
-
-
@@ -150,5 +169,4 @@
false
-
diff --git a/extra/files/gen2-2016/Autounattend.xml b/extra/files/windows/2019/proxmox/std/Autounattend.xml
similarity index 87%
rename from extra/files/gen2-2016/Autounattend.xml
rename to extra/files/windows/2019/proxmox/std/Autounattend.xml
index 6e972a7..a082c5b 100755
--- a/extra/files/gen2-2016/Autounattend.xml
+++ b/extra/files/windows/2019/proxmox/std/Autounattend.xml
@@ -71,7 +71,7 @@
/IMAGE/NAME
- Windows Server 2016 SERVERSTANDARD
+ Windows Server 2019 SERVERSTANDARD
@@ -96,7 +96,7 @@
false
- windows-2016
+ windows-2019
Central European Standard Time
@@ -126,26 +126,36 @@
cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
Set Execution Policy 64 Bit
1
- true
+ false
C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
Set Execution Policy 32 Bit
2
- true
+ false
-
- cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File e:\bootstrap.ps1
- Fix public network
+
+ powershell.exe -NoProfile -Command "Get-PSDrive -PSProvider 'FileSystem' | ForEach-Object { $scriptFile = Join-Path $_.Root 'bootstrap.ps1'; if (Test-Path $scriptFile) { & $scriptFile } }"
+ bootstrap
3
- true
+ false
cmd.exe /c wmic useraccount where "name='Administrator'" set PasswordExpires=FALSE
4
Disable password expiration for Administrator user
+ false
+
+ true
+ true
+ true
+ true
+ true
+ Home
+ 1
+
password
diff --git a/extra/files/windows/2019/proxmox/unattend.xml b/extra/files/windows/2019/proxmox/unattend.xml
new file mode 100755
index 0000000..41d741c
--- /dev/null
+++ b/extra/files/windows/2019/proxmox/unattend.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+ en-US
+
+ 0409:00000409
+ en-US
+ en-US
+ en-US
+
+
+
+
+ windows-2022
+
+
+
+
+
+ true
+ Work
+ 1
+
+
+
+
diff --git a/extra/files/gen2-2022/dc/Autounattend.xml b/extra/files/windows/2022/hyperv/dc/Autounattend.xml
similarity index 100%
rename from extra/files/gen2-2022/dc/Autounattend.xml
rename to extra/files/windows/2022/hyperv/dc/Autounattend.xml
diff --git a/extra/files/gen2-2022/dc/secondary.iso b/extra/files/windows/2022/hyperv/dc/secondary.iso
similarity index 100%
rename from extra/files/gen2-2022/dc/secondary.iso
rename to extra/files/windows/2022/hyperv/dc/secondary.iso
diff --git a/extra/files/gen2-2022/dc/unattend.xml b/extra/files/windows/2022/hyperv/dc/unattend.xml
similarity index 100%
rename from extra/files/gen2-2022/dc/unattend.xml
rename to extra/files/windows/2022/hyperv/dc/unattend.xml
diff --git a/extra/files/gen2-2022/dc/unattend_vagrant.xml b/extra/files/windows/2022/hyperv/dc/unattend_vagrant.xml
similarity index 100%
rename from extra/files/gen2-2022/dc/unattend_vagrant.xml
rename to extra/files/windows/2022/hyperv/dc/unattend_vagrant.xml
diff --git a/extra/files/gen2-2022/std/Autounattend.xml b/extra/files/windows/2022/hyperv/std/Autounattend.xml
similarity index 100%
rename from extra/files/gen2-2022/std/Autounattend.xml
rename to extra/files/windows/2022/hyperv/std/Autounattend.xml
diff --git a/extra/files/gen2-2022/std/secondary.iso b/extra/files/windows/2022/hyperv/std/secondary.iso
similarity index 100%
rename from extra/files/gen2-2022/std/secondary.iso
rename to extra/files/windows/2022/hyperv/std/secondary.iso
diff --git a/extra/files/gen2-2022/std/unattend.xml b/extra/files/windows/2022/hyperv/std/unattend.xml
similarity index 100%
rename from extra/files/gen2-2022/std/unattend.xml
rename to extra/files/windows/2022/hyperv/std/unattend.xml
diff --git a/extra/files/gen2-2022/std/unattend_vagrant.xml b/extra/files/windows/2022/hyperv/std/unattend_vagrant.xml
similarity index 100%
rename from extra/files/gen2-2022/std/unattend_vagrant.xml
rename to extra/files/windows/2022/hyperv/std/unattend_vagrant.xml
diff --git a/extra/files/windows/2022/proxmox/bootstrap.ps1 b/extra/files/windows/2022/proxmox/bootstrap.ps1
new file mode 100755
index 0000000..7699dd5
--- /dev/null
+++ b/extra/files/windows/2022/proxmox/bootstrap.ps1
@@ -0,0 +1,106 @@
+# This script is called from the answerfile
+
+# You cannot enable Windows PowerShell Remoting on network connections that are set to Public
+# http://msdn.microsoft.com/en-us/library/windows/desktop/aa370750(v=vs.85).aspx
+# http://blogs.msdn.com/b/powershell/archive/2009/04/03/setting-network-location-to-private.aspx
+
+#Write-Host "Copy unattend.xml to C:\Windows\Panther\Unattend\"
+#New-Item C:\Windows\Panther\Unattend -Type Directory
+
+# Get network connections
+$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]'{DCB00C01-570F-4A9B-8D69-199FDBA5723B}'))
+$connections = $networkListManager.GetNetworkConnections()
+
+$connections |ForEach-Object {
+ Write-Host "Setting network config"
+ $_.GetNetwork().GetName() + 'category was previously set to' + $_.GetNetwork().GetCategory() | Out-File c:\windows\temp\logfile.txt
+ $_.GetNetwork().SetCategory(1)
+ $_.GetNetwork().GetName() + 'change to ' + $_.GetNetwork().GetCategory() | Out-File C:\windows\temp\logfile.txt -Append
+}
+
+# Install Virtio Drivers
+
+function Enable-Virtio {
+Write-Host "Installing Virtio Drivers"
+# Search and Install virtio-win-gt-x64.msi Script
+
+# Get all file system drives
+$drives = Get-PSDrive -PSProvider 'FileSystem'
+
+# Loop through each drive to find and run the MSI installer
+foreach ($drive in $drives) {
+ $scriptFile = Join-Path $drive.Root 'virtio-win-gt-x64.msi'
+
+ # Check if the MSI file exists on the current drive
+ if (Test-Path $scriptFile) {
+ # Run the MSI installer with the specified arguments
+ Start-Process msiexec -Wait -ArgumentList '/i', $scriptFile, '/log', 'C:\Windows\Temp\qemu-drivers.log', '/qn', '/passive', '/norestart', 'ADDLOCAL=ALL' -ErrorAction SilentlyContinue
+ }
+}
+# Search and Install virtio-win-gt-x64.msi Script
+Write-Host "Installing QEMU Guest Agent"
+# Get all file system drives
+$drives = Get-PSDrive -PSProvider 'FileSystem'
+
+# Loop through each drive to find and run the MSI installer
+foreach ($drive in $drives) {
+ $scriptFile = Join-Path $drive.Root '/guest-agent/qemu-ga-x86_64.msi'
+
+ # Check if the MSI file exists on the current drive
+ if (Test-Path $scriptFile) {
+ # Run the MSI installer with the specified arguments
+ Start-Process msiexec -Wait -ArgumentList '/i', $scriptFile, '/log', 'C:\Windows\Temp\qemu-guest-agent.log', '/qn', '/passive', '/norestart', 'ADDLOCAL=ALL' -ErrorAction SilentlyContinue
+ }
+ }
+}
+
+# Write-Host "Installing SPICE"
+# # Search and Install virtio-win-guest-tools.exe
+
+# # Get all file system drives
+# $drives = Get-PSDrive -PSProvider 'FileSystem'
+
+# # Loop through each drive to find and run the MSI installer
+# foreach ($drive in $drives) {
+# $scriptFile = Join-Path $drive.Root 'virtio-win-guest-tools.exe'
+
+# # Check if the MSI file exists on the current drive
+# if (Test-Path $scriptFile) {
+# # Run the MSI installer with the specified arguments
+# Start-Process msiexec -Wait -ArgumentList '/i', $scriptFile, '/log', 'C:\Windows\Temp\qemu-drivers.log', '/qn', '/passive', '/norestart', 'ADDLOCAL=ALL' -ErrorAction SilentlyContinue
+# }
+# }
+If (Get-service -Name QEMU-GA -ErrorAction SilentlyContinue) {
+ Write-Host "Starting QEMU Guest Agent"
+ Start-Service -Name QEMU-GA -ErrorAction SilentlyContinue
+}
+
+If (Get-service -Name spice-agent -ErrorAction SilentlyContinue) {
+ Write-Host "Starting SPICE"
+ Start-Service -Name spice-agent -ErrorAction SilentlyContinue
+}
+
+Function Enable-WinRM {
+Write-Host "Enable WinRM"
+netsh advfirewall firewall set rule group="remote administration" new enable=yes
+netsh advfirewall firewall add rule name="WinRM open Port 5985" dir=in action=allow protocol=TCP localport=5985
+
+winrm quickconfig -q
+winrm quickconfig -transport:http
+winrm set winrm/config '@{MaxTimeoutms="7200000"}'
+winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}'
+winrm set winrm/config/winrs '@{MaxProcessesPerShell="0"}'
+winrm set winrm/config/winrs '@{MaxShellsPerUser="0"}'
+winrm set winrm/config/service '@{AllowUnencrypted="true"}'
+winrm set winrm/config/service/auth '@{Basic="true"}'
+winrm set winrm/config/client/auth '@{Basic="true"}'
+
+net stop winrm
+sc.exe config winrm start= auto
+net start winrm
+
+}
+
+Get-WmiObject -Class Win32_UserAccount -Filter "name = 'Administrator'" | Set-WmiInstance -Arguments @{PasswordExpires = 0 }
+Enable-Virtio
+Enable-WinRM
diff --git a/extra/files/gen1-vb/2004/Autounattend.xml b/extra/files/windows/2022/proxmox/dc/Autounattend.xml
old mode 100644
new mode 100755
similarity index 70%
rename from extra/files/gen1-vb/2004/Autounattend.xml
rename to extra/files/windows/2022/proxmox/dc/Autounattend.xml
index c866789..4ac07ec
--- a/extra/files/gen1-vb/2004/Autounattend.xml
+++ b/extra/files/windows/2022/proxmox/dc/Autounattend.xml
@@ -16,47 +16,67 @@
- Primary
1
350
+ Primary
2
- Primary
+ 100
+ EFI
+
+
+ 3
+ 128
+ MSR
+
+
+ 4
true
+ Primary
- true
- NTFS
-
1
1
+
+ NTFS
+ de94bba4-06d1-4d40-a16a-bfd50179d6ac
- NTFS
-
- C
2
2
+
+ FAT32
+
+
+ 3
+ 3
+
+
+ 4
+ 4
+
+ NTFS
0
true
+ OnError
- /IMAGE/INDEX
- 1
+ /IMAGE/NAME
+ Windows Server 2022 SERVERDATACENTER
0
- 2
+ 4
@@ -66,8 +86,8 @@
OnError
true
- Vagrant
- Hashicorp
+ Administrator
+
@@ -76,8 +96,8 @@
false
- vagrant-2004
- UTC
+ windows-2022
+ Central European Standard Time
@@ -95,53 +115,52 @@
- vagrant
+ password
true
true
- vagrant
+ Administrator
cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
Set Execution Policy 64 Bit
1
- true
+ false
C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
Set Execution Policy 32 Bit
2
- true
+ false
-
- cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\bootstrap.ps1
- Fix public network
+
+ powershell.exe -NoProfile -Command "Get-PSDrive -PSProvider 'FileSystem' | ForEach-Object { $scriptFile = Join-Path $_.Root 'bootstrap.ps1'; if (Test-Path $scriptFile) { & $scriptFile } }"
+ bootstrap
3
- true
+ false
- cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE
+ cmd.exe /c wmic useraccount where "name='Administrator'" set PasswordExpires=FALSE
4
- Disable password expiration for vagrant user
+ Disable password expiration for Administrator user
+ false
+
+ true
+ true
+ true
+ true
+ true
+ Home
+ 1
+
- vagrant
+ password
true
-
-
-
- vagrant
- true
-
- Vagrant User
- Administrators
- vagrant
-
-
diff --git a/extra/files/gen1-vb/2016/Autounattend.xml b/extra/files/windows/2022/proxmox/std/Autounattend.xml
old mode 100644
new mode 100755
similarity index 70%
rename from extra/files/gen1-vb/2016/Autounattend.xml
rename to extra/files/windows/2022/proxmox/std/Autounattend.xml
index c483b7d..690fd4b
--- a/extra/files/gen1-vb/2016/Autounattend.xml
+++ b/extra/files/windows/2022/proxmox/std/Autounattend.xml
@@ -16,47 +16,67 @@
- Primary
1
350
+ Primary
2
- Primary
+ 100
+ EFI
+
+
+ 3
+ 128
+ MSR
+
+
+ 4
true
+ Primary
- true
- NTFS
-
1
1
+
+ NTFS
+ de94bba4-06d1-4d40-a16a-bfd50179d6ac
- NTFS
-
- C
2
2
+
+ FAT32
+
+
+ 3
+ 3
+
+
+ 4
+ 4
+
+ NTFS
0
true
+ OnError
/IMAGE/NAME
- Windows Server 2016 SERVERSTANDARD
+ Windows Server 2022 SERVERSTANDARD
0
- 2
+ 4
@@ -66,8 +86,8 @@
OnError
true
- Vagrant
- Hashicorp
+ Administrator
+
@@ -76,8 +96,8 @@
false
- vagrant-2016
- Pacific Standard Time
+ windows-2022
+ Central European Standard Time
@@ -95,53 +115,52 @@
- vagrant
+ password
true
true
- vagrant
+ Administrator
cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
Set Execution Policy 64 Bit
1
- true
+ false
C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
Set Execution Policy 32 Bit
2
- true
+ false
-
- cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\bootstrap.ps1
- Fix public network
+
+ powershell.exe -NoProfile -Command "Get-PSDrive -PSProvider 'FileSystem' | ForEach-Object { $scriptFile = Join-Path $_.Root 'bootstrap.ps1'; if (Test-Path $scriptFile) { & $scriptFile } }"
+ bootstrap
3
- true
+ false
- cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE
+ cmd.exe /c wmic useraccount where "name='Administrator'" set PasswordExpires=FALSE
4
- Disable password expiration for vagrant user
+ Disable password expiration for Administrator user
+ false
+
+ true
+ true
+ true
+ true
+ true
+ Home
+ 1
+
- vagrant
+ password
true
-
-
-
- vagrant
- true
-
- Vagrant User
- Administrators
- vagrant
-
-
@@ -150,5 +169,4 @@
false
-
diff --git a/extra/files/windows/2022/proxmox/unattend.xml b/extra/files/windows/2022/proxmox/unattend.xml
new file mode 100755
index 0000000..41d741c
--- /dev/null
+++ b/extra/files/windows/2022/proxmox/unattend.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+ en-US
+
+ 0409:00000409
+ en-US
+ en-US
+ en-US
+
+
+
+
+ windows-2022
+
+
+
+
+
+ true
+ Work
+ 1
+
+
+
+
diff --git a/extra/files/windows/scagent/1.0.3.1028/install.sh b/extra/files/windows/scagent/1.0.3.1028/install.sh
new file mode 100644
index 0000000..bba7ed9
--- /dev/null
+++ b/extra/files/windows/scagent/1.0.3.1028/install.sh
@@ -0,0 +1,399 @@
+#!/bin/bash
+#
+# Copyright (C) Microsoft Corporation. All rights reserved.
+#
+# Install or remove Microsoft System Center Virtual Machine Manager Agent
+#
+#
+# internal function to create log entry. Timestamps with UTC
+#
+function WriteLog {
+
+ logfile="/var/opt/microsoft/scvmmguestagent/log/scvmm-install.log"
+
+ if [ ! -d `dirname ${logfile}` ]
+ then
+ mkdir -p `dirname ${logfile}`
+ fi
+
+ echo -e `date -u '+%D %T'`" UTC\t$1\t${caller}"
+ echo -e `date -u '+%D %T'`" UTC\t$1\t${caller}">>"${logfile}"
+
+}
+
+function usage {
+ WriteLog "Usage:"
+ WriteLog "Agent installation:"
+ WriteLog "install [-d installation_directory] scvmmguestagent.x.y-z.[x86|x64].tar"
+ WriteLog "Remove agent:"
+ WriteLog "install -r"
+ WriteLog "Upgrade agent:"
+ WriteLog "install -u -v x.y-z"
+ exit 1
+}
+
+function installExec {
+ ERROR=$((eval ${1}) 2>&1)
+ rc=$?
+
+ if [ $rc != 0 ]; then
+ WriteLog ${ERROR}
+ WriteLog "Failed to install SCVMM Guest Agent"
+ exit -1
+ fi
+
+}
+
+function getArch {
+ arch=`uname -p`
+
+ if [ ${arch} = "unknown" ]
+ then
+ arch=`uname -m`
+ fi
+
+ if [ `echo $arch | grep -c '^i[3-6]86$'` -eq 1 ]
+ then
+ archfriendly="x86"
+ elif [ ${arch} = "x86_64" ]
+ then
+ archfriendly="x64"
+ else
+ WriteLog "Failed to identify architecture. Exiting."
+ exit -1
+ fi
+}
+
+function installAgent {
+
+ if [ ! -n "${installdir}" ]
+ then
+ installdir="/opt/microsoft"
+ fi
+
+ installdir="${installdir}/scvmmguestagent"
+
+ #Untar kit
+ if [ ! -d "${installdir}" ]
+ then
+ mkdir -p "${installdir}"
+ else
+ if [ -d "${installdir}" ]
+ then
+ rm -fr "${installdir}/bin"
+ rm -fr "${installdir}/etc"
+ fi
+ fi
+
+ WriteLog "Installing SCVMM Guest Agent to ${installdir}"
+ installExec 'tar -xf "${agentkit}" -C ${installdir} --overwrite'
+
+ #Create default guest agent log dir
+ if [ ! -d "/var/opt/microsoft/scvmmguestagent/log" ]
+ then
+ mkdir -p "/var/opt/microsoft/scvmmguestagent/log"
+ fi
+
+ #Move init.d script to /etc/init.d
+ sed -i".bak" 's,,'$installdir',g' ${installdir}/bin/${servicename}
+ installExec "mv ${installdir}/bin/${servicename} /etc/init.d/"
+ chmod 744 "/etc/init.d/${servicename}"
+
+
+ if [ ! "${nomount}" = "true" ]
+ then
+ if [ -n "$(uname -v | awk '/(Debian|Ubuntu)/')" ]
+ then
+ sed -i".bak" 's/^# Default-Start:.*/# Default-Start: 2 3 4 5/g' /etc/init.d/${servicename}
+ sed -i".bak" 's/^# Default-Stop:.*/# Default-Stop: 0 1 6/g' /etc/init.d/${servicename}
+ rm -f /etc/init.d/${servicename}.bak
+ fi
+
+ #Daemon registration
+ if [ -x /usr/sbin/update-rc.d ]
+ then
+ update-rc.d ${servicename} defaults
+ elif [ -x /usr/lib/lsb/install_initd ]
+ then
+ /usr/lib/lsb/install_initd /etc/init.d/${servicename}
+ else
+ if [ -x /sbin/chkconfig ]
+ then
+ /sbin/chkconfig --add ${servicename}
+ /sbin/chkconfig --level 3 ${servicename} on
+ else
+ WriteLog "Unable to find service control mechanism. Exiting."
+ exit -1
+ fi
+ fi
+ else
+ #Start agent
+ WriteLog "Starting daemon"
+ installExec '/etc/init.d/${servicename} startnomount "${mntpath}"'
+ fi
+
+ WriteLog "Successfully installed SCVMM Guest Agent"
+
+}
+
+function removeAgent {
+ WriteLog "Removing SCVMM Guest Agent"
+
+ if [ -e /etc/init.d/${servicename} ]
+ then
+ #Remove daemon
+ if [ -x /usr/sbin/update-rc.d ]
+ then
+ update-rc.d -f ${servicename} remove > /dev/null
+ elif [ -x /usr/lib/lsb/install_initd ]
+ then
+ /usr/lib/lsb/remove_initd /etc/init.d/${servicename}
+ else
+ if [ -x /sbin/chkconfig ]
+ then
+ /sbin/chkconfig --del ${servicename}
+ fi
+ fi
+
+ rm -f /etc/init.d/${servicename}
+ fi
+
+
+ #Disable waagent daemon
+ WriteLog "Disabling waagent daemon"
+
+ #SystemD
+ if [ -x /bin/systemctl -o -x /usr/bin/systemctl ]
+ then
+ if [ `systemctl is-enabled walinuxagent 2>/dev/null|grep enabled|wc -l` -eq 1 ]
+ then
+ systemctl disable walinuxagent
+ systemctl stop walinuxagent
+ fi
+ fi
+
+ if [ -x /sbin/insserv ]
+ then
+ /sbin/insserv -r waagent
+ elif [ -x /sbin/chkconfig ]
+ then
+ /sbin/chkconfig waagent off
+ fi
+
+ if [ -e /etc/init/waagent.conf -o -e /etc/init/walinuxagent.conf ]
+ then
+ if [ -e /etc/init/waagent.conf ];then mv /etc/init/waagent.conf /etc/init/waagent.conf.disabled;fi
+ if [ -e /etc/init/walinuxagent.conf ];then mv /etc/init/walinuxagent.conf /etc/init/walinuxagent.conf.disabled;fi
+ elif [ -x /usr/sbin/update-rc.d ]
+ then
+ /usr/sbin/update-rc.d -f waagent remove
+ fi
+
+ if [ -d "${SCVMM_HOME}" ]
+ then
+ #Uninstall agent
+ rm -rf "${SCVMM_HOME}"
+ fi
+}
+
+function upgradeAgent {
+
+ #Check for upgrade viability
+ doUpgrade=0
+
+ currentversion=`cat ${SCVMM_HOME}/etc/version`
+ WriteLog "Current version: ${currentversion}"
+
+ if [ `echo $currentversion |grep -c .` -eq 1 ]
+ then
+ currentmajor=`echo ${currentversion}|cut -f1 -d.`
+ currentminor=`echo ${currentversion}|cut -f2 -d.`
+ currentpatch=`echo ${currentversion}|cut -f3 -d.`
+ currentbuild=`echo ${currentversion}|cut -f4 -d.`
+ newmajor=`echo ${version}|cut -f1 -d.`
+ newminor=`echo ${version}|cut -f2 -d.`
+ newpatch=`echo ${version}|cut -f3 -d.`
+ newbuild=`echo ${version}|cut -f4 -d.`
+
+ if [ ${newmajor} -gt ${currentmajor} ]
+ then
+ doUpgrade=1
+ elif [ ${newmajor} -eq ${currentmajor} -a ${newminor} -gt ${currentminor} ]
+ then
+ doUpgrade=1
+ elif [ ${newmajor} -eq ${currentmajor} -a ${newminor} -eq ${currentminor} -a ${newpatch} -gt ${currentpatch} ]
+ then
+ doUpgrade=1
+ elif [ ${newmajor} -eq ${currentmajor} -a ${newminor} -eq ${currentminor} -a ${newpatch} -eq ${currentpatch} -a ${newbuild} -gt ${currentbuild} ]
+ then
+ doUpgrade=1
+ fi
+ else
+ WriteLog "Unable to parse installed agent version. Exiting"
+ exit -1
+ fi
+
+
+ if [ ${doUpgrade} -eq 1 ]
+ then
+
+ WriteLog "Agent requires upgrade"
+
+ #Back up customizations
+ configfile="${SCVMM_HOME}/etc/scvmm.conf"
+ if [ -e "${configfile}" ]
+ then
+ customconf=`cat ${configfile}`
+ fi
+
+ WriteLog "Stopping service"
+ proc=`ps -aef |grep -v grep | grep ${servicename}`
+
+ if [ $? -eq 0 ]
+ then
+ WriteLog "Stopping service ${servicename}"
+ installExec "/etc/init.d/${servicename} stop"
+ else
+ WriteLog "Nothing to stop"
+ fi
+
+ #Remove
+ WriteLog "Removing agent"
+ removeAgent
+
+ #Install
+ WriteLog "Starting install"
+ installdir=`echo ${SCVMM_HOME} |sed 's/\/scvmmguestagent//g'`
+ installAgent
+
+ #Start daemon
+ WriteLog "Starting daemon"
+ installExec "/etc/init.d/${servicename} start"
+
+ #Rewrite config file
+ echo -e "${customconf}" > ${configfile}
+
+ else
+ WriteLog "Current agent version is the latest."
+ exit 0
+ fi
+
+ exit 1
+}
+
+#Main
+
+archfriendly=""
+agentkit=""
+installdir=""
+remove=0
+upgrade=0
+servicename="scvmmguestagent"
+whoami=`whoami`
+
+# Check root privelege
+if [ "$whoami" != "root" ]; then
+ WriteLog "You must be root to install this product."
+ exit 2
+fi
+
+while getopts d:v:p:ur opt
+do
+ case "$opt" in
+ d) installdir=${OPTARG};;
+ v) version=${OPTARG};;
+ r) remove=1;;
+ u) upgrade=1;;
+ p) mntpath=${OPTARG};;
+ [?]) usage;;
+ esac
+done
+shift $(($OPTIND - 1))
+
+#Main
+getArch
+
+#Check for SCVMM_HOME
+if [[ -z "${SCVMM_HOME}" && -f /etc/init.d/${servicename} ]]
+then
+ SCVMM_HOME=`cat /etc/init.d/${servicename}|grep -e '^SCVMM_HOME='|cut -f2 -d=`
+fi
+
+if [ `echo ${mntpath}|grep /|wc -l` -ge 1 ]
+then
+ WriteLog "Install called with mount path provided"
+ nomount="true"
+ agentkit=`ls $(dirname ${0})/${servicename}.*.${archfriendly}.tar|head -n 1`
+else
+ if [ ${upgrade} -eq 0 -a ${remove} -eq 0 ]
+ then
+ if [ $# -lt 1 ]
+ then
+ usage
+ fi
+ fi
+fi
+
+if [ ${remove} -eq 1 ]
+then
+
+ removeAgent
+
+
+elif [ ${upgrade} -eq 1 ]
+then
+
+ if [ ! ${version} ]
+ then
+ WriteLog "Upgrade specified but no supplied version. Exiting."
+ usage
+ fi
+
+ agentkit="$(dirname ${0})/${servicename}.${version}.${archfriendly}.tar"
+
+ if [ -f "${agentkit}" ]
+ then
+ upgradeAgent
+ else
+ WriteLog "Agent tar file ${agentkit} not found. Exiting."
+ exit -1
+ fi
+
+else
+
+ #Use specified agent kit
+
+ if [ "${nomount}" = "true" ]
+ then
+ agentkit=`ls $(dirname ${0})/${servicename}.*.${archfriendly}.tar|head -n 1`
+ else
+ #Check for existing SCVMM guest agent and exit if found, unless mntpath provided
+ if [ -n "${SCVMM_HOME}" ]
+ then
+ if [ -d "${SCVMM_HOME}" ]
+ then
+ WriteLog "Found existing SCVMM guest agent, nothing to do."
+ exit 1
+ fi
+ fi
+
+ agentkit="${1}"
+ fi
+
+ if [ -f "${agentkit}" ]
+ then
+ archtest=`tar -O -f ${agentkit} -x etc/buildarch |grep -c ${archfriendly}`
+ if [ ${archtest} -eq 1 ]
+ then
+ installAgent
+ else
+ WriteLog "Specified agent tar file does not match machine architecture. Exiting."
+ exit -1
+ fi
+
+ else
+ WriteLog "Agent tar file ${agentkit} not found. Exiting."
+ exit -1
+ fi
+
+fi
diff --git a/extra/files/windows/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar b/extra/files/windows/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar
new file mode 100644
index 0000000..a56b191
Binary files /dev/null and b/extra/files/windows/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar differ
diff --git a/extra/files/windows/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x86.tar b/extra/files/windows/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x86.tar
new file mode 100644
index 0000000..9d5bd15
Binary files /dev/null and b/extra/files/windows/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x86.tar differ
diff --git a/extra/playbooks/provision_alma8_variables.yml b/extra/playbooks/provision_alma8_variables.yml
index 8146dd5..090bd7a 100644
--- a/extra/playbooks/provision_alma8_variables.yml
+++ b/extra/playbooks/provision_alma8_variables.yml
@@ -14,6 +14,8 @@ initial_packages:
- glibc-all-langpacks
- ca-certificates
- yum-utils
+ - sendmail
+ - cockpit-pcp
yum_extra_groups:
- "@base"
- "@core"
@@ -140,6 +142,12 @@ services:
- name: sshd
state: started
enabled: true
+ - name: cockpit.socket
+ state: started
+ enabled: true
+ - name: pmlogger.service
+ state: started
+ enabled: true
sysctl:
- key: net.ipv4.ip_forward
value: 1
diff --git a/extra/playbooks/provision_alma9_variables.yml b/extra/playbooks/provision_alma9_variables.yml
index 42d4e69..9fc7663 100644
--- a/extra/playbooks/provision_alma9_variables.yml
+++ b/extra/playbooks/provision_alma9_variables.yml
@@ -14,6 +14,8 @@ initial_packages:
- glibc-all-langpacks
- ca-certificates
- yum-utils
+ - sendmail
+ - cockpit-pcp
yum_extra_groups:
- "@base"
- "@core"
@@ -106,9 +108,9 @@ puppet:
- key: server
value: foreman.example.com
neofetch:
- repository:
- - url: https://copr.fedorainfracloud.org/coprs/konimex/neofetch/repo/epel-8/konimex-neofetch-epel-8.repo
- dest: /etc/yum.repos.d/konimex-neofetch.repo
+ # repository:
+ # - url: https://copr.fedorainfracloud.org/coprs/konimex/neofetch/repo/epel-8/konimex-neofetch-epel-8.repo
+ # dest: /etc/yum.repos.d/konimex-neofetch.repo
package:
name: neofetch
options:
@@ -141,6 +143,12 @@ services:
- name: sshd
state: started
enabled: true
+ - name: cockpit.socket
+ state: started
+ enabled: true
+ - name: pmlogger.service
+ state: started
+ enabled: true
sysctl:
- key: net.ipv4.ip_forward
value: 1
diff --git a/extra/playbooks/provision_centos8_variables.yml b/extra/playbooks/provision_centos8_variables.yml
index 71c3cf7..9503e1f 100644
--- a/extra/playbooks/provision_centos8_variables.yml
+++ b/extra/playbooks/provision_centos8_variables.yml
@@ -14,6 +14,8 @@ initial_packages:
- glibc-all-langpacks
- ca-certificates
- yum-utils
+ - sendmail
+ - cockpit-pcp
yum_extra_groups:
- "@base"
- "@core"
@@ -140,6 +142,12 @@ services:
- name: sshd
state: started
enabled: true
+ - name: cockpit.socket
+ state: started
+ enabled: true
+ - name: pmlogger.service
+ state: started
+ enabled: true
sysctl:
- key: net.ipv4.ip_forward
value: 1
diff --git a/extra/playbooks/provision_oracle8_variables.yml b/extra/playbooks/provision_oracle8_variables.yml
index 27a5bf1..fc0b7f6 100644
--- a/extra/playbooks/provision_oracle8_variables.yml
+++ b/extra/playbooks/provision_oracle8_variables.yml
@@ -14,6 +14,8 @@ initial_packages:
- glibc-all-langpacks
- ca-certificates
- yum-utils
+ - sendmail
+ - cockpit-pcp
yum_extra_groups:
- "@base"
- "@core"
@@ -105,9 +107,9 @@ puppet:
- key: server
value: foreman.example.com
neofetch:
- repository:
- - url: https://copr.fedorainfracloud.org/coprs/konimex/neofetch/repo/epel-8/konimex-neofetch-epel-8.repo
- dest: /etc/yum.repos.d/konimex-neofetch.repo
+ # repository:
+ # - url: https://copr.fedorainfracloud.org/coprs/konimex/neofetch/repo/epel-8/konimex-neofetch-epel-8.repo
+ # dest: /etc/yum.repos.d/konimex-neofetch.repo
package:
name: neofetch
options:
@@ -140,6 +142,12 @@ services:
- name: sshd
state: started
enabled: true
+ - name: cockpit.socket
+ state: started
+ enabled: true
+ - name: pmlogger.service
+ state: started
+ enabled: true
sysctl:
- key: net.ipv4.ip_forward
value: 1
diff --git a/extra/playbooks/provision_oracle9_variables.yml b/extra/playbooks/provision_oracle9_variables.yml
index 903c668..5d056bf 100644
--- a/extra/playbooks/provision_oracle9_variables.yml
+++ b/extra/playbooks/provision_oracle9_variables.yml
@@ -14,6 +14,8 @@ initial_packages:
- glibc-all-langpacks
- ca-certificates
- yum-utils
+ - sendmail
+ - cockpit-pcp
yum_extra_groups:
- "@base"
- "@core"
@@ -106,9 +108,9 @@ puppet:
- key: server
value: foreman.example.com
neofetch:
- repository:
- - url: https://copr.fedorainfracloud.org/coprs/konimex/neofetch/repo/epel-8/konimex-neofetch-epel-9.repo
- dest: /etc/yum.repos.d/konimex-neofetch.repo
+ # repository:
+ # - url: https://copr.fedorainfracloud.org/coprs/konimex/neofetch/repo/epel-8/konimex-neofetch-epel-9.repo
+ # dest: /etc/yum.repos.d/konimex-neofetch.repo
package:
name: neofetch
options:
@@ -141,6 +143,12 @@ services:
- name: sshd
state: started
enabled: true
+ - name: cockpit.socket
+ state: started
+ enabled: true
+ - name: pmlogger.service
+ state: started
+ enabled: true
sysctl:
- key: net.ipv4.ip_forward
value: 1
diff --git a/extra/playbooks/provision_centos.yaml b/extra/playbooks/provision_rhel.yaml
similarity index 96%
rename from extra/playbooks/provision_centos.yaml
rename to extra/playbooks/provision_rhel.yaml
index 550d8b6..135dc0e 100644
--- a/extra/playbooks/provision_centos.yaml
+++ b/extra/playbooks/provision_rhel.yaml
@@ -60,22 +60,22 @@
- name: display_initial_values
ansible.builtin.debug:
msg:
- - "Ansible package manager :{{ ansible_pkg_mgr }}"
+ - "Ansible package manager :{{ ansible_pkg_mgr | lower }}"
- "Extra volume name :{{ extra_device }}"
- - "Extra volume prepare :{{ docker_prepare }}"
- - "Install Cockpit :{{ install_cockpit }}"
- - "Install EPEL :{{ install_epel }}"
- - "Change EPEL priority :{{ change_epel_priority }}"
- - "Install extra groups :{{ install_extra_groups }}"
- - "Install Hyperv :{{ install_hyperv }}"
- - "Install MOTD :{{ install_motd }}"
- - "Install Neofetch :{{ install_neofetch }}"
- - "Install Puppet :{{ install_puppet }}"
- - "Install updates :{{ install_updates }}"
- - "Install Webmin :{{ install_webmin }}"
- - "Install Zabbix :{{ install_zabbix }}"
- - "Install Zabbix Agent as root :{{ install_zabbix_as_root }}"
- - "Reboot server :{{ reboot_server }}"
+ - "Extra volume prepare :{{ docker_prepare | lower }}"
+ - "Install Cockpit :{{ install_cockpit | lower }}"
+ - "Install EPEL :{{ install_epel | lower }}"
+ - "Change EPEL priority :{{ change_epel_priority | lower }}"
+ - "Install extra groups :{{ install_extra_groups | lower }}"
+ - "Install Hyperv :{{ install_hyperv | lower }}"
+ - "Install MOTD :{{ install_motd | lower }}"
+ - "Install Neofetch :{{ install_neofetch | lower }}"
+ - "Install Puppet :{{ install_puppet | lower }}"
+ - "Install updates :{{ install_updates | lower }}"
+ - "Install Webmin :{{ install_webmin | lower }}"
+ - "Install Zabbix :{{ install_zabbix | lower }}"
+ - "Install Zabbix Agent as root :{{ install_zabbix_as_root | lower }}"
+ - "Reboot server :{{ reboot_server | lower }}"
# initial cleaning and refreshing metadata for packages
- name: initial_clean
ansible.builtin.debug:
@@ -794,6 +794,24 @@
until: r_set_tuned is success
when: machine_type != "guest" and machine_type is defined
changed_when: false
+ - name: Enable synchronize system clock
+ ansible.builtin.shell: timedatectl set-ntp true
+ retries: "{{ retries_count }}"
+ delay: "{{ delay_time }}"
+ register: r_set_ntp
+ until: r_set_ntp is success
+ failed_when: false
+ changed_when: false
+ - name: Restart chronyd service
+ ansible.builtin.systemd:
+ name: chronyd
+ state: restarted
+ enabled: true
+ retries: "{{ retries_count }}"
+ delay: "{{ delay_time }}"
+ register: r_restart_chronyd
+ until: r_restart_chronyd is success
+ changed_when: false
- name: update_rkhunter
ansible.builtin.command: rkhunter --propupd
failed_when: false
diff --git a/extra/playbooks/provision_rocky8_variables.yml b/extra/playbooks/provision_rocky8_variables.yml
index 8146dd5..090bd7a 100644
--- a/extra/playbooks/provision_rocky8_variables.yml
+++ b/extra/playbooks/provision_rocky8_variables.yml
@@ -14,6 +14,8 @@ initial_packages:
- glibc-all-langpacks
- ca-certificates
- yum-utils
+ - sendmail
+ - cockpit-pcp
yum_extra_groups:
- "@base"
- "@core"
@@ -140,6 +142,12 @@ services:
- name: sshd
state: started
enabled: true
+ - name: cockpit.socket
+ state: started
+ enabled: true
+ - name: pmlogger.service
+ state: started
+ enabled: true
sysctl:
- key: net.ipv4.ip_forward
value: 1
diff --git a/extra/playbooks/provision_rocky9_variables.yml b/extra/playbooks/provision_rocky9_variables.yml
index 8abc970..70f46c8 100644
--- a/extra/playbooks/provision_rocky9_variables.yml
+++ b/extra/playbooks/provision_rocky9_variables.yml
@@ -14,6 +14,8 @@ initial_packages:
- glibc-all-langpacks
- ca-certificates
- yum-utils
+ - sendmail
+ - cockpit-pcp
yum_extra_groups:
- "@base"
- "@core"
@@ -141,6 +143,12 @@ services:
- name: sshd
state: started
enabled: true
+ - name: cockpit.socket
+ state: started
+ enabled: true
+ - name: pmlogger.service
+ state: started
+ enabled: true
sysctl:
- key: net.ipv4.ip_forward
value: 1
diff --git a/extra/scripts/virtualbox/extend-trial.cmd b/extra/scripts/windows/shared/extend-trial.cmd
similarity index 100%
rename from extra/scripts/virtualbox/extend-trial.cmd
rename to extra/scripts/windows/shared/extend-trial.cmd
diff --git a/extra/scripts/phase-1.ps1 b/extra/scripts/windows/shared/phase-1.ps1
similarity index 78%
rename from extra/scripts/phase-1.ps1
rename to extra/scripts/windows/shared/phase-1.ps1
index 001daa0..ad81836 100755
--- a/extra/scripts/phase-1.ps1
+++ b/extra/scripts/windows/shared/phase-1.ps1
@@ -154,10 +154,25 @@ do {
try {
Write-Output "Phase 1 [INFO] - installing Chocolatey, attempt $choco_install_count of $choco_install_count_max"
Get-ExecutionPolicy
- Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force -Verbose;
- [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
- Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -ErrorAction Stop
- Write-Output "Phase 1 [INFO] - installing Chocolatey exit code is: $LASTEXITCODE"
+ if ($global:os -eq '2019') {
+ try {
+ # Install Chocolatey in version pre 2.0.0
+ Write-Output "Phase 1 [INFO] - installing Chocolatey, Windows 2019 found, locking to version 1.4.0"
+ $env:chocolateyVersion = '1.4.0';Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iwr https://community.chocolatey.org/install.ps1 -UseBasicParsing| iex
+ }
+ catch {
+ Write-Output "Phase 1 [WARN] - Chocolatey install problem, attempt $choco_install_count of $choco_install_count_max"
+ Sleep 1
+ }
+ }
+ else {
+ # Install Chocolatey in version 2.0.0 or later
+ Write-Output "Phase 1 [INFO] - installing Chocolatey, Windows later han 2019 found, enabling latest"
+ Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force -Verbose;
+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+ Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -ErrorAction Stop
+ Write-Output "Phase 1 [INFO] - installing Chocolatey exit code is: $LASTEXITCODE"
+ }
if ($LASTEXITCODE -eq 0) {
$choco_install_success=$true
Write-Output "Phase 1 [INFO] - Chocolatey install succesful"
@@ -177,15 +192,15 @@ if (-not $choco_install_success) {
}
# Install PSWindowsUpdate
-Write-Output "Phase 1 [INFO] - Installing Nuget"
-Get-PackageProvider -Name "Nuget" -ForceBootstrap -Verbose -ErrorAction Stop
-Write-Output "Phase 1 [INFO] - Installing PSWindowsUpdate"
-Install-Module PSWindowsUpdate -Force -Confirm:$false -Verbose -ErrorAction Stop
-Import-Module PSWindowsUpdate
-Get-WUServiceManager
-if ($global:os -ne '2022') {
- Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d -Confirm:$false
-}
+# Write-Output "Phase 1 [INFO] - Installing Nuget"
+# Get-PackageProvider -Name "Nuget" -ForceBootstrap -Verbose -ErrorAction Stop
+# Write-Output "Phase 1 [INFO] - Installing PSWindowsUpdate"
+# Install-Module PSWindowsUpdate -Force -Confirm:$false -Verbose -ErrorAction Stop
+# Import-Module PSWindowsUpdate
+# Get-WUServiceManager
+# if ($global:os -ne '2022') {
+# Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d -Confirm:$false
+# }
#Remove 260 Character Path Limit
if (Test-Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem') {
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -name "LongPathsEnabled" -Value 1 -Verbose -Force
diff --git a/extra/scripts/phase-2.ps1 b/extra/scripts/windows/shared/phase-2.ps1
similarity index 100%
rename from extra/scripts/phase-2.ps1
rename to extra/scripts/windows/shared/phase-2.ps1
diff --git a/extra/scripts/phase-3.ps1 b/extra/scripts/windows/shared/phase-3.ps1
similarity index 100%
rename from extra/scripts/phase-3.ps1
rename to extra/scripts/windows/shared/phase-3.ps1
diff --git a/extra/scripts/phase-4.windows-updates.ps1 b/extra/scripts/windows/shared/phase-4.windows-updates.ps1
similarity index 100%
rename from extra/scripts/phase-4.windows-updates.ps1
rename to extra/scripts/windows/shared/phase-4.windows-updates.ps1
diff --git a/extra/scripts/phase-5a.software.ps1 b/extra/scripts/windows/shared/phase-5a.software.ps1
similarity index 96%
rename from extra/scripts/phase-5a.software.ps1
rename to extra/scripts/windows/shared/phase-5a.software.ps1
index 5e95606..dcca116 100644
--- a/extra/scripts/phase-5a.software.ps1
+++ b/extra/scripts/windows/shared/phase-5a.software.ps1
@@ -7,5 +7,6 @@ if (Test-Path ("$Env:ProgramFiles\Tabby")) {
Write-Output "Phase 5a - adding paths for Tabby"
[Environment]::SetEnvironmentVariable("Path",[Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine) + ";$Env:ProgramFiles\Tabby",[EnvironmentVariableTarget]::Machine)
}
+choco upgrade all -y
Write-Output "Phase 5a [END]- Software"
diff --git a/extra/scripts/phase-5b.docker.ps1 b/extra/scripts/windows/shared/phase-5b.docker.ps1
similarity index 100%
rename from extra/scripts/phase-5b.docker.ps1
rename to extra/scripts/windows/shared/phase-5b.docker.ps1
diff --git a/extra/scripts/phase-5c.vagrant.ps1 b/extra/scripts/windows/shared/phase-5c.vagrant.ps1
similarity index 100%
rename from extra/scripts/phase-5c.vagrant.ps1
rename to extra/scripts/windows/shared/phase-5c.vagrant.ps1
diff --git a/extra/scripts/phase-5d.windows-compress.ps1 b/extra/scripts/windows/shared/phase-5d.windows-compress.ps1
similarity index 100%
rename from extra/scripts/phase-5d.windows-compress.ps1
rename to extra/scripts/windows/shared/phase-5d.windows-compress.ps1
diff --git a/hv_almalinux86.ps1 b/hv_almalinux86.ps1
deleted file mode 100644
index ef13f76..0000000
--- a/hv_almalinux86.ps1
+++ /dev/null
@@ -1,39 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_almalinux8_g2.pkr.hcl"
-$var_file="./variables/variables_almalinux86.pkvars.hcl"
-$machine="AlmaLinux 8.6"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_almalinux86_docker.ps1 b/hv_almalinux86_docker.ps1
deleted file mode 100644
index 87e2579..0000000
--- a/hv_almalinux86_docker.ps1
+++ /dev/null
@@ -1,40 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_almalinux8_g2_docker.pkr.hcl"
-$var_file="./variables/variables_almalinux86.pkvars.hcl"
-$override="./variables/almalinux8_docker.yml"
-$machine="AlmaLinux 8.6"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_almalinux86_vagrant.ps1 b/hv_almalinux86_vagrant.ps1
deleted file mode 100644
index 70904f2..0000000
--- a/hv_almalinux86_vagrant.ps1
+++ /dev/null
@@ -1,44 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_almalinux8_g2_vagrant.pkr.hcl"
-$var_file="./variables/variables_almalinux86.pkvars.hcl"
-$vbox_file="./vbox/packer-almalinux86-g2.box"
-$machine="AlmaLinux 8.6"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- if ($?) {
- Write-Output "Calculating checksums"
- Get-FileHash -Algorithm SHA256 -Path "$vbox_file"|Out-File "$vbox_file.sha256" -Verbose
- }
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_almalinux92.ps1 b/hv_almalinux92.ps1
deleted file mode 100644
index a1958d7..0000000
--- a/hv_almalinux92.ps1
+++ /dev/null
@@ -1,39 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_almalinux9_g2.pkr.hcl"
-$var_file="./variables/variables_almalinux92.pkvars.hcl"
-$machine="AlmaLinux 9.2"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_almalinux92_docker.ps1 b/hv_almalinux92_docker.ps1
deleted file mode 100644
index d2c6069..0000000
--- a/hv_almalinux92_docker.ps1
+++ /dev/null
@@ -1,40 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_almalinux9_g2_docker.pkr.hcl"
-$var_file="./variables/variables_almalinux92.pkvars.hcl"
-$override="./variables/almalinux9_docker.yml"
-$machine="AlmaLinux 9.2"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_almalinux92_vagrant.ps1 b/hv_almalinux92_vagrant.ps1
deleted file mode 100644
index 5fcef4a..0000000
--- a/hv_almalinux92_vagrant.ps1
+++ /dev/null
@@ -1,44 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_almalinux9_g2_vagrant.pkr.hcl"
-$var_file="./variables/variables_almalinux92.pkvars.hcl"
-$vbox_file="./vbox/packer-almalinux92-g2.box"
-$machine="AlmaLinux 9.2"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- if ($?) {
- Write-Output "Calculating checksums"
- Get-FileHash -Algorithm SHA256 -Path "$vbox_file"|Out-File "$vbox_file.sha256" -Verbose
- }
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_centos79.ps1 b/hv_centos79.ps1
deleted file mode 100644
index f9bb56f..0000000
--- a/hv_centos79.ps1
+++ /dev/null
@@ -1,39 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_centos7_g2.pkr.hcl"
-$var_file="./variables/variables_centos79.pkvars.hcl"
-$machine="CentOS 7.9 2009"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_centos79_docker.ps1 b/hv_centos79_docker.ps1
deleted file mode 100644
index a4a8b7b..0000000
--- a/hv_centos79_docker.ps1
+++ /dev/null
@@ -1,40 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_centos7_g2_docker.pkr.hcl"
-$var_file="./variables/variables_centos79.pkvars.hcl"
-$override="./variables/centos7_docker.yml"
-$machine="CentOS 7.9 2009 Docker"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_centos79_vagrant.ps1 b/hv_centos79_vagrant.ps1
deleted file mode 100644
index b680a07..0000000
--- a/hv_centos79_vagrant.ps1
+++ /dev/null
@@ -1,44 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_centos7_g2_vagrant.pkr.hcl"
-$var_file="./variables/variables_centos79.pkvars.hcl"
-$vbox_file="./vbox/packer-centos-79-g2.box"
-$machine="CentOS 7.9 2009 Vagrant"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- if ($?) {
- Write-Output "Calculating checksums"
- Get-FileHash -Algorithm SHA256 -Path "$vbox_file"|Out-File "$vbox_file.sha256" -Verbose
- }
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_generic.ps1 b/hv_generic.ps1
new file mode 100644
index 0000000..b1b8e23
--- /dev/null
+++ b/hv_generic.ps1
@@ -0,0 +1,142 @@
+<#
+.SYNOPSIS
+This script validates and builds Packer templates based on the specified parameters.
+
+.DESCRIPTION
+The script accepts three parameters: Action, Log, and Version. Based on these parameters, it performs actions like validating and building Packer templates. It also sets the PACKER_LOG environment variable to control Packer's logging behavior.
+
+.PARAMETER Action
+Specifies the action to be performed. It can be:
+- "verify": Only validates the Packer template.
+- "build": Validates and then builds the Packer template (default action).
+
+.PARAMETER Log
+Controls the logging behavior of Packer. It can be:
+- 0: Disables logging (default).
+- 1: Enables logging.
+
+.PARAMETER Version
+Specifies the version of the template to be used. If not specified, it defaults to "rockylinux-8.8".
+
+.PARAMETER Template
+Specifies the path to the Packer template to be used. If not specified, it defaults to "templates/hv_rhel.pkr.hcl".
+#>
+
+param(
+ [ValidateSet("verify", "build", "")]
+ [string]$Action = "",
+
+ [ValidateSet(0, 1)]
+ [int]$Log = 0,
+
+ [string]$Version = "",
+
+ [string]$Template = ""
+)
+
+# Set default values if parameters are not specified
+if ($Action -eq "") {
+ $Action = "build"
+}
+
+if ($Log -eq 1) {
+ $PACKER_LOG = 1
+} else {
+ $PACKER_LOG = 0
+}
+
+if ($Version -eq "") {
+ $Version = "rockylinux-8.8"
+}
+
+if ($Template -eq "") {
+ $Template = "rhel"
+}
+
+# Define colors for console output
+$RED = [ConsoleColor]::Red
+$GREEN = [ConsoleColor]::Green
+$YELLOW = [ConsoleColor]::Yellow
+$BLUE = [ConsoleColor]::Blue
+$NC = [ConsoleColor]::White
+
+
+# Define other variables
+$var_file = "variables/variables_$Version.pkvars.hcl"
+$template = "templates/hv_$Template.pkr.hcl"
+
+
+if (!(Test-Path $var_file)) {
+ Write-Host "Variable file '$var_file' does not exist. Exiting now." -ForegroundColor $RED
+ exit 1
+} else {
+ Write-Host "Variable file '$var_file' exists." -ForegroundColor $GREEN
+}
+
+if (!(Test-Path $template)) {
+ Write-Host "Template file '$template' does not exist. Exiting now." -ForegroundColor $RED
+ exit 1
+} else {
+ Write-Host "Template file '$template' exists." -ForegroundColor $GREEN
+}
+
+
+# Set PACKER_LOG environment variable
+[Environment]::SetEnvironmentVariable('PACKER_LOG', $PACKER_LOG, [System.EnvironmentVariableTarget]::Process)
+
+# Display variable values
+Write-Host "--- Variable Values ---" -ForegroundColor $BLUE
+Write-Host "PACKER_LOG: $PACKER_LOG" -ForegroundColor $YELLOW
+Write-Host "Version: $Version" -ForegroundColor $YELLOW
+Write-Host "Var File: $var_file" -ForegroundColor $YELLOW
+Write-Host "Template: $template" -ForegroundColor $YELLOW
+Write-Host "-----------------------" -ForegroundColor $BLUE
+Write-Host "Action: $Action" -ForegroundColor $YELLOW
+
+# Start message
+Write-Host "Starting the Packer script..." -ForegroundColor $YELLOW
+
+# Validate the existence of the var file and template before proceeding
+if (-not (Test-Path $var_file)) {
+ Write-Host "Var file '$var_file' does not exist. Exiting now." -ForegroundColor $RED
+ exit 1
+}
+
+if (-not (Test-Path $template)) {
+ Write-Host "Template file '$template' does not exist. Exiting now." -ForegroundColor $RED
+ exit 1
+}
+
+# Validate packer template
+Write-Host "Validating Packer template..." -ForegroundColor $YELLOW
+try {
+ packer validate --var-file="$var_file" "$template"
+} catch {
+ Write-Host "Packer validate failed - exiting now!" -ForegroundColor $RED
+ exit 1
+}
+
+if ($LASTEXITCODE -ne 0) {
+ Write-Host "Packer validate failed with exit code $LASTEXITCODE - exiting now" -ForegroundColor $RED
+ exit 1
+} else {
+ Write-Host "Packer template validation successful!" -ForegroundColor $GREEN
+}
+
+# Build packer template if Action is not 'verify'
+if ($Action -ne "verify") {
+ Write-Host "Building Packer template..." -ForegroundColor $YELLOW
+ try {
+ packer build --force --var-file="$var_file" "$template"
+ }
+ catch {
+ Write-Host "Packer build failed - exiting now!" -ForegroundColor $RED
+ exit 1
+ }
+ if ($LASTEXITCODE -ne 0) {
+ Write-Host "Packer build failed with exit code $LASTEXITCODE - exiting now" -ForegroundColor $RED
+ exit 1
+ } else {
+ Write-Host "Packer build completed successfully!" -ForegroundColor $GREEN
+ }
+}
diff --git a/hv_oraclelinux86.ps1 b/hv_oraclelinux86.ps1
deleted file mode 100644
index a37b933..0000000
--- a/hv_oraclelinux86.ps1
+++ /dev/null
@@ -1,39 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_oraclelinux8_g2.pkr.hcl"
-$var_file="./variables/variables_oraclelinux86.pkvars.hcl"
-$machine="OracleLinux 8.6"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_oraclelinux86_docker.ps1 b/hv_oraclelinux86_docker.ps1
deleted file mode 100644
index bbddaee..0000000
--- a/hv_oraclelinux86_docker.ps1
+++ /dev/null
@@ -1,40 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_oraclelinux8_g2_docker.pkr.hcl"
-$var_file="./variables/variables_oraclelinux86.pkvars.hcl"
-$override="./variables/oraclelinux8_docker.yml"
-$machine="OracleLinux 8.6"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_oraclelinux86_vagrant.ps1 b/hv_oraclelinux86_vagrant.ps1
deleted file mode 100644
index 0e014f7..0000000
--- a/hv_oraclelinux86_vagrant.ps1
+++ /dev/null
@@ -1,44 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_oraclelinux8_g2_vagrant.pkr.hcl"
-$var_file="./variables/variables_oraclelinux86.pkvars.hcl"
-$vbox_file="./vbox/packer-oraclelinux86-g2.box"
-$machine="OracleLinux 8.6"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- if ($?) {
- Write-Output "Calculating checksums"
- Get-FileHash -Algorithm SHA256 -Path "$vbox_file"|Out-File "$vbox_file.sha256" -Verbose
- }
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_oraclelinux92.ps1 b/hv_oraclelinux92.ps1
deleted file mode 100644
index 784bb3e..0000000
--- a/hv_oraclelinux92.ps1
+++ /dev/null
@@ -1,39 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_oraclelinux9_g2.pkr.hcl"
-$var_file="./variables/variables_oraclelinux92.pkvars.hcl"
-$machine="OracleLinux 9.2"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_oraclelinux92_docker.ps1 b/hv_oraclelinux92_docker.ps1
deleted file mode 100644
index 7faff81..0000000
--- a/hv_oraclelinux92_docker.ps1
+++ /dev/null
@@ -1,40 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_oraclelinux9_g2_docker.pkr.hcl"
-$var_file="./variables/variables_oraclelinux92.pkvars.hcl"
-$override="./variables/oraclelinux9_docker.yml"
-$machine="OracleLinux 9.2"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_oraclelinux92_vagrant.ps1 b/hv_oraclelinux92_vagrant.ps1
deleted file mode 100644
index ef76448..0000000
--- a/hv_oraclelinux92_vagrant.ps1
+++ /dev/null
@@ -1,44 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_oraclelinux9_g2_vagrant.pkr.hcl"
-$var_file="./variables/variables_oraclelinux92.pkvars.hcl"
-$vbox_file="./vbox/packer-oraclelinux92-g2.box"
-$machine="OracleLinux 9.2"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- if ($?) {
- Write-Output "Calculating checksums"
- Get-FileHash -Algorithm SHA256 -Path "$vbox_file"|Out-File "$vbox_file.sha256" -Verbose
- }
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_rockylinux87.ps1 b/hv_rockylinux87.ps1
deleted file mode 100644
index 71f0a1b..0000000
--- a/hv_rockylinux87.ps1
+++ /dev/null
@@ -1,39 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_rockylinux8_g2.pkr.hcl"
-$var_file="./variables/variables_rockylinux87.pkvars.hcl"
-$machine="RockyLinux 8.7"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_rockylinux87_docker.ps1 b/hv_rockylinux87_docker.ps1
deleted file mode 100644
index 8b79cea..0000000
--- a/hv_rockylinux87_docker.ps1
+++ /dev/null
@@ -1,40 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_rockylinux8_g2_docker.pkr.hcl"
-$var_file="./variables/variables_rockylinux87.pkvars.hcl"
-$override="./variables/rockylinux8_docker.yml"
-$machine="RockyLinux 8.7"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_rockylinux87_vagrant.ps1 b/hv_rockylinux87_vagrant.ps1
deleted file mode 100644
index d220253..0000000
--- a/hv_rockylinux87_vagrant.ps1
+++ /dev/null
@@ -1,44 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_rockylinux8_g2_vagrant.pkr.hcl"
-$var_file="./variables/variables_rockylinux87.pkvars.hcl"
-$vbox_file="./vbox/packer-rockylinux87-g2.box"
-$machine="RockyLinux 8.7"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- if ($?) {
- Write-Output "Calculating checksums"
- Get-FileHash -Algorithm SHA256 -Path "$vbox_file"|Out-File "$vbox_file.sha256" -Verbose
- }
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_rockylinux92.ps1 b/hv_rockylinux92.ps1
deleted file mode 100644
index 0ce8f34..0000000
--- a/hv_rockylinux92.ps1
+++ /dev/null
@@ -1,39 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_rockylinux9_g2.pkr.hcl"
-$var_file="./variables/variables_rockylinux92.pkvars.hcl"
-$machine="RockyLinux 9.2"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_rockylinux92_docker.ps1 b/hv_rockylinux92_docker.ps1
deleted file mode 100644
index 7204679..0000000
--- a/hv_rockylinux92_docker.ps1
+++ /dev/null
@@ -1,40 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_rockylinux9_g2_docker.pkr.hcl"
-$var_file="./variables/variables_rockylinux92.pkvars.hcl"
-$override="./variables/rockylinux9_docker.yml"
-$machine="RockyLinux 9.1"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" -var "ansible_override=$override" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_rockylinux92_vagrant.ps1 b/hv_rockylinux92_vagrant.ps1
deleted file mode 100644
index 5b01686..0000000
--- a/hv_rockylinux92_vagrant.ps1
+++ /dev/null
@@ -1,44 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_rockylinux9_g2_vagrant.pkr.hcl"
-$var_file="./variables/variables_rockylinux92.pkvars.hcl"
-$vbox_file="./vbox/packer-rockylinux92-g2.box"
-$machine="RockyLinux 9.1"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- if ($?) {
- Write-Output "Calculating checksums"
- Get-FileHash -Algorithm SHA256 -Path "$vbox_file"|Out-File "$vbox_file.sha256" -Verbose
- }
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_ubuntu2004.ps1 b/hv_ubuntu2004.ps1
deleted file mode 100644
index 2832b22..0000000
--- a/hv_ubuntu2004.ps1
+++ /dev/null
@@ -1,39 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_ubuntu2004_g2.pkr.hcl"
-$var_file="./variables/variables_ubuntu2004.pkvars.hcl"
-$machine="Ubuntu 20.04"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_ubuntu2204.ps1 b/hv_ubuntu2204.ps1
deleted file mode 100644
index 662efcc..0000000
--- a/hv_ubuntu2204.ps1
+++ /dev/null
@@ -1,39 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_ubuntu2204_g2.pkr.hcl"
-$var_file="./variables/variables_ubuntu2204.pkvars.hcl"
-$machine="Ubuntu 22.04"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_win2016_std.ps1 b/hv_win2016_std.ps1
deleted file mode 100644
index c6a8e89..0000000
--- a/hv_win2016_std.ps1
+++ /dev/null
@@ -1,39 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_win2016_g2.pkr.hcl"
-$var_file="./variables/variables_win2016_std.pkvars.hcl"
-$machine="Windows Server 2016 Standard Gen-2"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_win2019_dc.ps1 b/hv_win2019_dc.ps1
deleted file mode 100644
index 2c62916..0000000
--- a/hv_win2019_dc.ps1
+++ /dev/null
@@ -1,33 +0,0 @@
-# Build images
-
-$template_file="./templates/hv_win2019_g2.pkr.hcl"
-$var_file="./variables/variables_win2019_dc.pkvars.hcl"
-$machine="Windows Server 2019 Datacenter Gen-2"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
diff --git a/hv_win2019_dc_vagrant.ps1 b/hv_win2019_dc_vagrant.ps1
deleted file mode 100644
index 296d845..0000000
--- a/hv_win2019_dc_vagrant.ps1
+++ /dev/null
@@ -1,37 +0,0 @@
-# Build images
-
-$template_file="./templates/hv_win2019_g2_vagrant.pkr.hcl"
-$var_file="./variables/variables_win2019_dc.pkvars.hcl"
-$machine="Windows Server 2019 Datacenter Gen-2 Vagrant"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- if ($?) {
- Write-Output "Calculating checksums"
- Get-FileHash -Algorithm SHA256 -Path "./vbox/packer-windows-2019-dc-g2.box"|Out-File "./vbox/packer-windows-2019-dc-g2.box.sha256" -Verbose
- }
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
diff --git a/hv_win2019_std.ps1 b/hv_win2019_std.ps1
deleted file mode 100644
index 45caa4b..0000000
--- a/hv_win2019_std.ps1
+++ /dev/null
@@ -1,39 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_win2019_g2.pkr.hcl"
-$var_file="./variables/variables_win2019_std.pkvars.hcl"
-$machine="Windows Server 2019 Standard Gen-2"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_win2019_std_vagrant.ps1 b/hv_win2019_std_vagrant.ps1
deleted file mode 100644
index 729156b..0000000
--- a/hv_win2019_std_vagrant.ps1
+++ /dev/null
@@ -1,43 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_win2019_g2_vagrant.pkr.hcl"
-$var_file="./variables/variables_win2019_std.pkvars.hcl"
-$machine="Windows Server 2019 Standard Gen-2 Vagrant"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- if ($?) {
- Write-Output "Calculating checksums"
- Get-FileHash -Algorithm SHA256 -Path "./vbox/packer-windows-2019-std-g2.box"|Out-File "./vbox/packer-windows-2019-std-g2.box.sha256" -Verbose
- }
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_win2022_dc.ps1 b/hv_win2022_dc.ps1
deleted file mode 100644
index 549c37e..0000000
--- a/hv_win2022_dc.ps1
+++ /dev/null
@@ -1,39 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_win2022_g2.pkr.hcl"
-$var_file="./variables/variables_win2022_dc.pkvars.hcl"
-$machine="Windows Server 2022 Datacenter Gen-2"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_win2022_dc_vagrant.ps1 b/hv_win2022_dc_vagrant.ps1
deleted file mode 100644
index 87cb97b..0000000
--- a/hv_win2022_dc_vagrant.ps1
+++ /dev/null
@@ -1,46 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_win2022_g2_vagrant.pkr.hcl"
-$var_file="./variables/variables_win2022_dc.pkvars.hcl"
-$machine="Windows Server 2022 Datacenter Gen-2 Vagrant"
-$vbox="./vbox/packer-windows-2022-dc-g2.box"
-$vbox_checksum="./vbox/packer-windows-2022-dc-g2.box.sha256"
-
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- if ($?) {
- Write-Output "Calculating checksums"
- Get-FileHash -Algorithm SHA256 -Path "$vbox"|Out-File "$vbox_checksum" -Verbose
- }
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_win2022_std.ps1 b/hv_win2022_std.ps1
deleted file mode 100644
index 16d7a6b..0000000
--- a/hv_win2022_std.ps1
+++ /dev/null
@@ -1,39 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_win2022_g2.pkr.hcl"
-$var_file="./variables/variables_win2022_std.pkvars.hcl"
-$machine="Windows Server 2022 Standard Gen-2"
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/hv_win2022_std_vagrant.ps1 b/hv_win2022_std_vagrant.ps1
deleted file mode 100644
index bf45436..0000000
--- a/hv_win2022_std_vagrant.ps1
+++ /dev/null
@@ -1,46 +0,0 @@
-# Build images
-
-# Get Start Time
-$startDTM = (Get-Date)
-
-# Variables
-$template_file="./templates/hv_win2022_g2_vagrant.pkr.hcl"
-$var_file="./variables/variables_win2022_std.pkvars.hcl"
-$machine="Windows Server 2022 Standard Gen-2 Vagrant"
-$vbox="./vbox/packer-windows-2022-std-g2.box"
-$vbox_checksum="./vbox/packer-windows-2022-std-g2.box.sha256"
-
-$packer_log=0
-
-if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) {
- Write-Output "Template and var file found"
- Write-Output "Building: $machine"
- try {
- $env:PACKER_LOG=$packer_log
- packer validate -var-file="$var_file" "$template_file"
- }
- catch {
- Write-Output "Packer validation failed, exiting."
- exit (-1)
- }
- try {
- $env:PACKER_LOG=$packer_log
- packer version
- packer build --force -var-file="$var_file" "$template_file"
- if ($?) {
- Write-Output "Calculating checksums"
- Get-FileHash -Algorithm SHA256 -Path "$vbox"|Out-File "$vbox_checksum" -Verbose
- }
- }
- catch {
- Write-Output "Packer build failed, exiting."
- exit (-1)
- }
-}
-else {
- Write-Output "Template or Var file not found - exiting"
- exit (-1)
-}
-
-$endDTM = (Get-Date)
-Write-Host "[INFO] - Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds" -ForegroundColor Yellow
diff --git a/templates/hv_almalinux8_g2.pkr.hcl b/templates/hv_almalinux8_g2.pkr.hcl
deleted file mode 100644
index bcbeea2..0000000
--- a/templates/hv_almalinux8_g2.pkr.hcl
+++ /dev/null
@@ -1,186 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_alma8_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-almalinux8/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
-}
diff --git a/templates/hv_almalinux8_g2_docker.pkr.hcl b/templates/hv_almalinux8_g2_docker.pkr.hcl
deleted file mode 100644
index d0226c4..0000000
--- a/templates/hv_almalinux8_g2_docker.pkr.hcl
+++ /dev/null
@@ -1,184 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_additional_size = "${var.disk_additional_size}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-dck"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-dck"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_alma8_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-almalinux8/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-}
diff --git a/templates/hv_almalinux8_g2_vagrant.pkr.hcl b/templates/hv_almalinux8_g2_vagrant.pkr.hcl
deleted file mode 100644
index db917eb..0000000
--- a/templates/hv_almalinux8_g2_vagrant.pkr.hcl
+++ /dev/null
@@ -1,193 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-vgr"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-vgr"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_alma8_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "ansible-local" {
- playbook_file = "extra/playbooks/provision_vagrant.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-almalinux8/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
- post-processor "vagrant" {
- keep_input_artifact = true
- output = "${var.output_vagrant}"
- vagrantfile_template = "${var.vagrantfile_template}"
- }
-}
diff --git a/templates/hv_almalinux9_g2.pkr.hcl b/templates/hv_almalinux9_g2.pkr.hcl
deleted file mode 100644
index e30d5bd..0000000
--- a/templates/hv_almalinux9_g2.pkr.hcl
+++ /dev/null
@@ -1,186 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_alma9_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-almalinux9/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
-}
diff --git a/templates/hv_almalinux9_g2_docker.pkr.hcl b/templates/hv_almalinux9_g2_docker.pkr.hcl
deleted file mode 100644
index 54c15c3..0000000
--- a/templates/hv_almalinux9_g2_docker.pkr.hcl
+++ /dev/null
@@ -1,184 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_additional_size = "${var.disk_additional_size}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-dck"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-dck"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_alma9_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-almalinux9/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-}
diff --git a/templates/hv_almalinux9_g2_vagrant.pkr.hcl b/templates/hv_almalinux9_g2_vagrant.pkr.hcl
deleted file mode 100644
index 677fe42..0000000
--- a/templates/hv_almalinux9_g2_vagrant.pkr.hcl
+++ /dev/null
@@ -1,193 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-vgr"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-vgr"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_alma9_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "ansible-local" {
- playbook_file = "extra/playbooks/provision_vagrant.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-almalinux9/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
- post-processor "vagrant" {
- keep_input_artifact = true
- output = "${var.output_vagrant}"
- vagrantfile_template = "${var.vagrantfile_template}"
- }
-}
diff --git a/templates/hv_centos7_g2_docker.pkr.hcl b/templates/hv_centos7_g2_docker.pkr.hcl
deleted file mode 100644
index 4e98e89..0000000
--- a/templates/hv_centos7_g2_docker.pkr.hcl
+++ /dev/null
@@ -1,189 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_additional_size = "${var.disk_additional_size}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-dck"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-dck"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_centos7_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-centos/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
-}
diff --git a/templates/hv_centos7_g2_vagrant.pkr.hcl b/templates/hv_centos7_g2_vagrant.pkr.hcl
deleted file mode 100644
index b6e86db..0000000
--- a/templates/hv_centos7_g2_vagrant.pkr.hcl
+++ /dev/null
@@ -1,197 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
- }
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-vgr"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-vgr"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_centos7_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "ansible-local" {
- playbook_file = "extra/playbooks/provision_vagrant.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-centos/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
- post-processor "vagrant" {
- keep_input_artifact = true
- output = "${var.output_vagrant}"
- vagrantfile_template = "${var.vagrantfile_template}"
- }
-}
diff --git a/templates/hv_oraclelinux8_g2.pkr.hcl b/templates/hv_oraclelinux8_g2.pkr.hcl
deleted file mode 100644
index 8a76794..0000000
--- a/templates/hv_oraclelinux8_g2.pkr.hcl
+++ /dev/null
@@ -1,186 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_oracle8_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-oraclelinux8/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
-}
diff --git a/templates/hv_oraclelinux8_g2_docker.pkr.hcl b/templates/hv_oraclelinux8_g2_docker.pkr.hcl
deleted file mode 100644
index f798388..0000000
--- a/templates/hv_oraclelinux8_g2_docker.pkr.hcl
+++ /dev/null
@@ -1,184 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_additional_size = "${var.disk_additional_size}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-dck"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-dck"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_oracle8_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-oraclelinux8/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-}
diff --git a/templates/hv_oraclelinux8_g2_vagrant.pkr.hcl b/templates/hv_oraclelinux8_g2_vagrant.pkr.hcl
deleted file mode 100644
index 4b27adb..0000000
--- a/templates/hv_oraclelinux8_g2_vagrant.pkr.hcl
+++ /dev/null
@@ -1,193 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-vgr"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-vgr"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_oracle8_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "ansible-local" {
- playbook_file = "extra/playbooks/provision_vagrant.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-oraclelinux8/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
- post-processor "vagrant" {
- keep_input_artifact = true
- output = "${var.output_vagrant}"
- vagrantfile_template = "${var.vagrantfile_template}"
- }
-}
diff --git a/templates/hv_oraclelinux9_g2.pkr.hcl b/templates/hv_oraclelinux9_g2.pkr.hcl
deleted file mode 100644
index 35e95e3..0000000
--- a/templates/hv_oraclelinux9_g2.pkr.hcl
+++ /dev/null
@@ -1,186 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_oracle9_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-oraclelinux9/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
-}
diff --git a/templates/hv_oraclelinux9_g2_docker.pkr.hcl b/templates/hv_oraclelinux9_g2_docker.pkr.hcl
deleted file mode 100644
index 8941f34..0000000
--- a/templates/hv_oraclelinux9_g2_docker.pkr.hcl
+++ /dev/null
@@ -1,187 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_additional_size = "${var.disk_additional_size}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-dck"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-dck"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_oracle9_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-oraclelinux9/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
-}
diff --git a/templates/hv_oraclelinux9_g2_vagrant.pkr.hcl b/templates/hv_oraclelinux9_g2_vagrant.pkr.hcl
deleted file mode 100644
index 727dff7..0000000
--- a/templates/hv_oraclelinux9_g2_vagrant.pkr.hcl
+++ /dev/null
@@ -1,195 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-vgr"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-vgr"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_oracle9_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "ansible-local" {
- playbook_file = "extra/playbooks/provision_vagrant.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-oraclelinux9/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
- post-processor "vagrant" {
- keep_input_artifact = true
- output = "${var.output_vagrant}"
- vagrantfile_template = "${var.vagrantfile_template}"
- }
-}
diff --git a/templates/hv_centos7_g2.pkr.hcl b/templates/hv_rhel.pkr.hcl
similarity index 90%
rename from templates/hv_centos7_g2.pkr.hcl
rename to templates/hv_rhel.pkr.hcl
index 4f63a74..c18b890 100644
--- a/templates/hv_centos7_g2.pkr.hcl
+++ b/templates/hv_rhel.pkr.hcl
@@ -48,7 +48,6 @@ variable "output_directory" {
type = string
default = ""
}
-
variable "provision_script_options" {
type = string
default = ""
@@ -57,7 +56,6 @@ variable "output_vagrant" {
type = string
default = ""
}
-
variable "ssh_password" {
type = string
default = ""
@@ -84,6 +82,26 @@ variable "vm_name" {
default = ""
}
+variable "ansible_variables" {
+ type = string
+ default = ""
+}
+
+variable "ansible_playbook" {
+ type = string
+ default = ""
+}
+
+variable "uefi_file" {
+ type = string
+ default = ""
+}
+
+variable "neofetch_file" {
+ type = string
+ default = ""
+}
+
source "hyperv-iso" "vm" {
boot_command = ["${var.boot_command}"]
boot_wait = "5s"
@@ -109,6 +127,7 @@ source "hyperv-iso" "vm" {
temp_path = "."
vlan_id = "${var.vlan_id}"
vm_name = "${var.vm_name}"
+
}
build {
@@ -127,7 +146,7 @@ build {
provisioner "file" {
destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_centos7_variables.yml"
+ source = "${var.ansible_variables}"
}
provisioner "file" {
@@ -137,12 +156,12 @@ build {
provisioner "file" {
destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
+ source = "${var.neofetch_file}"
}
provisioner "ansible-local" {
extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
+ playbook_file = "${var.ansible_playbook}"
}
provisioner "shell" {
@@ -153,7 +172,7 @@ build {
provisioner "file" {
destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-centos/uefi.sh"
+ source = "${var.uefi_file}"
}
provisioner "file" {
diff --git a/templates/hv_rockylinux8_g2.pkr.hcl b/templates/hv_rockylinux8_g2.pkr.hcl
deleted file mode 100644
index 0beebae..0000000
--- a/templates/hv_rockylinux8_g2.pkr.hcl
+++ /dev/null
@@ -1,186 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_rocky8_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-rockylinux8/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
-}
diff --git a/templates/hv_rockylinux8_g2_docker.pkr.hcl b/templates/hv_rockylinux8_g2_docker.pkr.hcl
deleted file mode 100644
index 7abb1cf..0000000
--- a/templates/hv_rockylinux8_g2_docker.pkr.hcl
+++ /dev/null
@@ -1,184 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_additional_size = "${var.disk_additional_size}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-dck"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-dck"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_rocky8_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-rockylinux8/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-}
diff --git a/templates/hv_rockylinux8_g2_vagrant.pkr.hcl b/templates/hv_rockylinux8_g2_vagrant.pkr.hcl
deleted file mode 100644
index e94b82e..0000000
--- a/templates/hv_rockylinux8_g2_vagrant.pkr.hcl
+++ /dev/null
@@ -1,193 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-vgr"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-vgr"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_rocky8_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "ansible-local" {
- playbook_file = "extra/playbooks/provision_vagrant.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-rockylinux8/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
- post-processor "vagrant" {
- keep_input_artifact = true
- output = "${var.output_vagrant}"
- vagrantfile_template = "${var.vagrantfile_template}"
- }
-}
diff --git a/templates/hv_rockylinux9_g2.pkr.hcl b/templates/hv_rockylinux9_g2.pkr.hcl
deleted file mode 100644
index 421c1ea..0000000
--- a/templates/hv_rockylinux9_g2.pkr.hcl
+++ /dev/null
@@ -1,186 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_rocky9_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-rockylinux9/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
-}
diff --git a/templates/hv_rockylinux9_g2_docker.pkr.hcl b/templates/hv_rockylinux9_g2_docker.pkr.hcl
deleted file mode 100644
index 5e3dd71..0000000
--- a/templates/hv_rockylinux9_g2_docker.pkr.hcl
+++ /dev/null
@@ -1,184 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_additional_size = "${var.disk_additional_size}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-dck"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-dck"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_rocky9_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-rockylinux9/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-}
diff --git a/templates/hv_rockylinux9_g2_vagrant.pkr.hcl b/templates/hv_rockylinux9_g2_vagrant.pkr.hcl
deleted file mode 100644
index 3f76fe8..0000000
--- a/templates/hv_rockylinux9_g2_vagrant.pkr.hcl
+++ /dev/null
@@ -1,193 +0,0 @@
-
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
- type = string
- default = ""
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-variable "provision_script_options" {
- type = string
- default = ""
-}
-variable "output_vagrant" {
- type = string
- default = ""
-}
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["${var.boot_command}"]
- boot_wait = "5s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "./extra/files"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}-vgr"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "root"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}-vgr"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/ansible.sh"
- source = "extra/files/gen2-linux/ansible.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i true"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/variables.yml"
- source = "extra/playbooks/provision_rocky9_variables.yml"
- }
-
- provisioner "file" {
- destination = "/tmp/override.yml"
- source = "${var.ansible_override}"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-linux/prepare_neofetch.sh"
- }
-
- provisioner "ansible-local" {
- extra_arguments = ["-e", "@/tmp/variables.yml", "-e", "@/tmp/override.yml"]
- playbook_file = "extra/playbooks/provision_centos.yaml"
- }
-
- provisioner "ansible-local" {
- playbook_file = "extra/playbooks/provision_vagrant.yaml"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["chmod +x /tmp/ansible.sh", "/tmp/ansible.sh -i false"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/usr/local/bin/uefi.sh"
- source = "extra/files/gen2-rockylinux9/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/install", "sh /tmp/install \"$(ls /tmp/scvmm*.x64.tar)\"", "reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-linux/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase", "chmod +x /usr/local/bin/uefi.sh", "systemctl set-default multi-user.target", "/bin/rm -f /etc/ssh/*key*", "chmod +x /tmp/zeroing.sh", "/tmp/zeroing.sh", "/bin/rm -rfv /tmp/*"]
- inline_shebang = "/bin/sh -x"
- pause_before = "30s"
- }
-
- post-processor "vagrant" {
- keep_input_artifact = true
- output = "${var.output_vagrant}"
- vagrantfile_template = "${var.vagrantfile_template}"
- }
-}
diff --git a/templates/hv_ubuntu2204_g2.pkr.hcl b/templates/hv_ubuntu.pkr.hcl
similarity index 88%
rename from templates/hv_ubuntu2204_g2.pkr.hcl
rename to templates/hv_ubuntu.pkr.hcl
index 38be561..623643d 100644
--- a/templates/hv_ubuntu2204_g2.pkr.hcl
+++ b/templates/hv_ubuntu.pkr.hcl
@@ -92,6 +92,31 @@ variable "ssh_username" {
default = "ubuntu"
}
+variable "uefi_file" {
+ type = string
+ default = ""
+}
+
+variable "provision_file" {
+ type = string
+ default = ""
+}
+
+variable "motd_file" {
+ type = string
+ default = ""
+}
+
+variable "neofetch_file" {
+ type = string
+ default = ""
+}
+
+variable "zeroing_file" {
+ type = string
+ default = ""
+}
+
source "hyperv-iso" "vm" {
boot_command = "${var.boot_command}"
boot_wait = "1s"
@@ -124,12 +149,12 @@ build {
provisioner "file" {
destination = "/tmp/uefi.sh"
- source = "extra/files/gen2-ubuntu2204/uefi.sh"
+ source = "${var.uefi_file}"
}
provisioner "file" {
destination = "/tmp/provision.sh"
- source = "extra/files/gen2-ubuntu2204/provision.sh"
+ source = "${var.provision_file}"
}
provisioner "file" {
@@ -149,24 +174,19 @@ build {
inline_shebang = "/bin/sh -x"
}
- provisioner "file" {
- destination = "/tmp/puppet.conf"
- source = "extra/files/gen2-ubuntu2204/puppet.conf"
- }
-
provisioner "file" {
destination = "/tmp/motd.sh"
- source = "extra/files/gen2-ubuntu2204/motd.sh"
+ source = "${var.motd_file}"
}
provisioner "file" {
destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-ubuntu2204/prepare_neofetch.sh"
+ source = "${var.neofetch_file}"
}
provisioner "file" {
destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-ubuntu2204/zeroing.sh"
+ source = "${var.zeroing_file}"
}
provisioner "shell" {
diff --git a/templates/hv_ubuntu2004_g2.pkr.hcl b/templates/hv_ubuntu2004_g2.pkr.hcl
deleted file mode 100644
index 338677c..0000000
--- a/templates/hv_ubuntu2004_g2.pkr.hcl
+++ /dev/null
@@ -1,187 +0,0 @@
-variable "ansible_override" {
- type = string
- default = ""
-}
-
-variable "boot_command" {
-}
-
-variable "disk_size" {
- type = string
- default = "70000"
-}
-
-variable "disk_additional_size" {
- type = list(number)
- default = ["1024"]
-}
-
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = "none"
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-
-variable "provision_script_options" {
- type = string
- default = ""
-}
-
-variable "output_vagrant" {
- type = string
- default = ""
-}
-
-variable "ssh_password" {
- type = string
- default = ""
- sensitive = true
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-variable "http_directory" {
- type = string
- default = ""
-}
-
-variable "ssh_username" {
- type = string
- default = "ubuntu"
-}
-
-source "hyperv-iso" "vm" {
- boot_command = "${var.boot_command}"
- boot_wait = "1s"
- communicator = "ssh"
- cpus = "${var.cpus}"
- disk_block_size = "1"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- http_directory = "${var.http_directory}"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}"
- shutdown_command = "echo 'password' | sudo -S shutdown -P now"
- shutdown_timeout = "30m"
- ssh_password = "${var.ssh_password}"
- ssh_timeout = "4h"
- ssh_username = "${var.ssh_username}"
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "file" {
- destination = "/tmp/uefi.sh"
- source = "extra/files/gen2-ubuntu2004/uefi.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/provision.sh"
- source = "extra/files/gen2-ubuntu2004/provision.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/scvmmguestagent.1.0.3.1028.x64.tar"
- source = "extra/files/scagent/1.0.3.1028/scvmmguestagent.1.0.3.1028.x64.tar"
- }
-
- provisioner "file" {
- destination = "/tmp/install"
- source = "extra/files/scagent/1.0.3.1028/install.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- expect_disconnect = true
- inline = ["chmod +x /tmp/provision.sh", "chmod +x /tmp/uefi.sh", "mv /tmp/uefi.sh /usr/local/bin/uefi.sh", "/tmp/provision.sh ${var.provision_script_options}", "sync;sync;reboot"]
- inline_shebang = "/bin/sh -x"
- }
-
- provisioner "file" {
- destination = "/tmp/puppet.conf"
- source = "extra/files/gen2-ubuntu2004/puppet.conf"
- }
-
- provisioner "file" {
- destination = "/tmp/motd.sh"
- source = "extra/files/gen2-ubuntu2004/motd.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/prepare_neofetch.sh"
- source = "extra/files/gen2-ubuntu2004/prepare_neofetch.sh"
- }
-
- provisioner "file" {
- destination = "/tmp/zeroing.sh"
- source = "extra/files/gen2-ubuntu2004/zeroing.sh"
- }
-
- provisioner "shell" {
- execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
- inline = ["echo Last Phase",
- "chmod +x /tmp/prepare_neofetch.sh",
- "chmod +x /usr/local/bin/uefi.sh",
- "chmod +x /tmp/zeroing.sh",
- "/tmp/prepare_neofetch.sh",
- "/tmp/zeroing.sh",
- "/bin/rm -rfv /tmp/*",
- "/bin/rm -f /etc/ssh/*key*",
- "/usr/bin/ssh-keygen -A",
- "echo 'packerVersion: ${packer.version}' >>/etc/packerinfo"]
- inline_shebang = "/bin/sh -x"
- }
-
-}
diff --git a/templates/hv_win2016_g2.pkr.hcl b/templates/hv_win2016_g2.pkr.hcl
deleted file mode 100644
index 7b25286..0000000
--- a/templates/hv_win2016_g2.pkr.hcl
+++ /dev/null
@@ -1,201 +0,0 @@
-
-variable "disk_size" {
- type = string
- default = ""
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-
-variable "output_vagrant" {
- type = string
- default = ""
-}
-
-variable "secondary_iso_image" {
- type = string
- default = ""
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "sysprep_unattended" {
- type = string
- default = ""
-}
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "upgrade_timeout" {
- type = string
- default = ""
-}
-
-variable "vagrant_sysprep_unattended" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["aaaa"]
- boot_wait = "1s"
- communicator = "winrm"
- cpus = 4
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = 4096
- output_directory = "${var.output_directory}"
- secondary_iso_images = ["${var.secondary_iso_image}"]
- shutdown_timeout = "30m"
- skip_export = true
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}"
- winrm_password = "password"
- winrm_timeout = "8h"
- winrm_username = "Administrator"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-1.ps1"
- }
-
- provisioner "windows-restart" {
- restart_timeout = "1h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-2.ps1"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-3.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- pause_before = "30s"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- pause_before = "30s"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-5a.software.ps1"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-5d.windows-compress.ps1"
- }
-
- provisioner "powershell" {
- inline = ["Write-Output Phase-5-Deprovisioning", "if( Test-Path $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml ){ rm $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml -Force}", "& $Env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /shutdown /quiet"]
- }
-
-}
diff --git a/templates/hv_win2019_g2.pkr.hcl b/templates/hv_win2019_g2.pkr.hcl
deleted file mode 100644
index 28c0004..0000000
--- a/templates/hv_win2019_g2.pkr.hcl
+++ /dev/null
@@ -1,226 +0,0 @@
-
-variable "disk_size" {
- type = string
- default = ""
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-
-variable "output_vagrant" {
- type = string
- default = ""
-}
-
-variable "secondary_iso_image" {
- type = string
- default = ""
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "sysprep_unattended" {
- type = string
- default = ""
-}
-
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "upgrade_timeout" {
- type = string
- default = ""
-}
-
-variable "vagrant_sysprep_unattended" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["aaaa"]
- boot_wait = "1s"
- communicator = "winrm"
- cpus = 4
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = 4096
- output_directory = "${var.output_directory}"
- secondary_iso_images = ["${var.secondary_iso_image}"]
- shutdown_timeout = "30m"
- skip_export = true
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}"
- winrm_password = "password"
- winrm_timeout = "8h"
- winrm_username = "Administrator"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-1.ps1"
- }
-
- provisioner "windows-restart" {
- restart_timeout = "1h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-2.ps1"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-3.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "1m0s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- pause_before = "30s"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
-provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- pause_before = "30s"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- pause_before = "30s"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-5a.software.ps1"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-5d.windows-compress.ps1"
- }
-
- provisioner "file" {
- destination = "C:\\Windows\\System32\\Sysprep\\unattend.xml"
- source = "${var.sysprep_unattended}"
- }
-
- provisioner "powershell" {
- inline = ["Write-Output Phase-5-Deprovisioning", "if (!(Test-Path -Path $Env:SystemRoot\\system32\\Sysprep\\unattend.xml)){ Write-Output 'No file';exit (10)}", "& $Env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /shutdown /quiet /unattend:C:\\Windows\\system32\\sysprep\\unattend.xml"]
- }
-
-}
diff --git a/templates/hv_win2019_g2_vagrant.pkr.hcl b/templates/hv_win2019_g2_vagrant.pkr.hcl
deleted file mode 100644
index 5b93086..0000000
--- a/templates/hv_win2019_g2_vagrant.pkr.hcl
+++ /dev/null
@@ -1,211 +0,0 @@
-
-variable "disk_size" {
- type = string
- default = ""
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-
-variable "output_vagrant" {
- type = string
- default = ""
-}
-
-variable "secondary_iso_image" {
- type = string
- default = ""
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "sysprep_unattended" {
- type = string
- default = ""
-}
-
-variable "upgrade_timeout" {
- type = string
- default = ""
-}
-
-variable "vagrant_sysprep_unattended" {
- type = string
- default = ""
-}
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["aaaa"]
- boot_wait = "1s"
- communicator = "winrm"
- cpus = 4
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = 4096
- output_directory = "${var.output_directory}"
- secondary_iso_images = ["${var.secondary_iso_image}"]
- shutdown_timeout = "30m"
- skip_export = false
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}"
- winrm_password = "password"
- winrm_timeout = "8h"
- winrm_username = "Administrator"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-1.ps1"
- }
-
- provisioner "windows-restart" {
- restart_timeout = "1h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-2.ps1"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-3.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "1m0s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- pause_before = "30s"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- pause_before = "30s"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-5a.software.ps1"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-5d.windows-compress.ps1"
- }
-
- provisioner "file" {
- destination = "C:\\Windows\\System32\\Sysprep\\unattend.xml"
- source = "${var.vagrant_sysprep_unattended}"
- }
-
- provisioner "powershell" {
- inline = ["Write-Output Phase-5-Deprovisioning", "if (!(Test-Path -Path $Env:SystemRoot\\system32\\Sysprep\\unattend.xml)){ Write-Output 'No file';exit (10)}", "& $Env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /shutdown /quiet /unattend:C:\\Windows\\system32\\sysprep\\unattend.xml"]
- }
-
- post-processor "vagrant" {
- keep_input_artifact = true
- output = "${var.output_vagrant}"
- vagrantfile_template = "${var.vagrantfile_template}"
- }
-}
diff --git a/templates/hv_win2022_g2.pkr.hcl b/templates/hv_win2022_g2.pkr.hcl
deleted file mode 100644
index f00da28..0000000
--- a/templates/hv_win2022_g2.pkr.hcl
+++ /dev/null
@@ -1,235 +0,0 @@
-variable "memory" {
- type = string
- default = "1024"
-}
-
-variable "cpus" {
- type = string
- default = "1"
-}
-
-variable "disk_size" {
- type = string
- default = ""
-}
-
-variable "iso_checksum" {
- type = string
- default = ""
-}
-
-variable "iso_checksum_type" {
- type = string
- default = ""
-}
-
-variable "iso_url" {
- type = string
- default = ""
-}
-
-variable "output_directory" {
- type = string
- default = ""
-}
-
-variable "output_vagrant" {
- type = string
- default = ""
-}
-
-variable "secondary_iso_image" {
- type = string
- default = ""
-}
-
-variable "switch_name" {
- type = string
- default = ""
-}
-
-variable "sysprep_unattended" {
- type = string
- default = ""
-}
-
-
-variable "vagrantfile_template" {
- type = string
- default = ""
-}
-
-variable "upgrade_timeout" {
- type = string
- default = ""
-}
-
-variable "vagrant_sysprep_unattended" {
- type = string
- default = ""
-}
-
-variable "vlan_id" {
- type = string
- default = ""
-}
-
-variable "vm_name" {
- type = string
- default = ""
-}
-
-source "hyperv-iso" "vm" {
- boot_command = ["aaaa"]
- boot_wait = "1s"
- communicator = "winrm"
- cpus = "${var.cpus}"
- disk_size = "${var.disk_size}"
- enable_dynamic_memory = "true"
- enable_secure_boot = false
- generation = 2
- guest_additions_mode = "disable"
- iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
- iso_url = "${var.iso_url}"
- memory = "${var.memory}"
- output_directory = "${var.output_directory}"
- secondary_iso_images = ["${var.secondary_iso_image}"]
- shutdown_timeout = "30m"
- skip_export = true
- switch_name = "${var.switch_name}"
- temp_path = "."
- vlan_id = "${var.vlan_id}"
- vm_name = "${var.vm_name}"
- winrm_password = "password"
- winrm_timeout = "8h"
- winrm_username = "Administrator"
-}
-
-build {
- sources = ["source.hyperv-iso.vm"]
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-1.ps1"
- }
-
- provisioner "windows-restart" {
- restart_timeout = "1h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-2.ps1"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-3.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "1m0s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- pause_before = "30s"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
-provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- pause_before = "30s"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- pause_before = "30s"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-5a.software.ps1"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-5d.windows-compress.ps1"
- }
-
- provisioner "file" {
- destination = "C:\\Windows\\System32\\Sysprep\\unattend.xml"
- source = "${var.sysprep_unattended}"
- }
-
- provisioner "powershell" {
- inline = ["Write-Output Phase-5-Deprovisioning", "if (!(Test-Path -Path $Env:SystemRoot\\system32\\Sysprep\\unattend.xml)){ Write-Output 'No file';exit (10)}", "& $Env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /shutdown /quiet /unattend:C:\\Windows\\system32\\sysprep\\unattend.xml"]
- }
-
-}
diff --git a/templates/hv_win2022_g2_vagrant.pkr.hcl b/templates/hv_windows.pkr.hcl
similarity index 53%
rename from templates/hv_win2022_g2_vagrant.pkr.hcl
rename to templates/hv_windows.pkr.hcl
index d8db375..6d89f8f 100644
--- a/templates/hv_win2022_g2_vagrant.pkr.hcl
+++ b/templates/hv_windows.pkr.hcl
@@ -8,7 +8,6 @@ variable "cpus" {
default = "1"
}
-
variable "disk_size" {
type = string
default = ""
@@ -34,10 +33,10 @@ variable "output_directory" {
default = ""
}
-variable "output_vagrant" {
- type = string
- default = ""
-}
+// variable "output_vagrant" {
+// type = string
+// default = ""
+// }
variable "secondary_iso_image" {
type = string
@@ -54,21 +53,22 @@ variable "sysprep_unattended" {
default = ""
}
-variable "upgrade_timeout" {
- type = string
- default = ""
-}
-variable "vagrant_sysprep_unattended" {
- type = string
- default = ""
-}
+// variable "vagrantfile_template" {
+// type = string
+// default = ""
+// }
-variable "vagrantfile_template" {
+variable "upgrade_timeout" {
type = string
default = ""
}
+// variable "vagrant_sysprep_unattended" {
+// type = string
+// default = ""
+// }
+
variable "vlan_id" {
type = string
default = ""
@@ -83,7 +83,7 @@ source "hyperv-iso" "vm" {
boot_command = ["aaaa"]
boot_wait = "1s"
communicator = "winrm"
- cpus ="${var.cpus}"
+ cpus = "${var.cpus}"
disk_size = "${var.disk_size}"
enable_dynamic_memory = "true"
enable_secure_boot = false
@@ -95,7 +95,7 @@ source "hyperv-iso" "vm" {
output_directory = "${var.output_directory}"
secondary_iso_images = ["${var.secondary_iso_image}"]
shutdown_timeout = "30m"
- skip_export = false
+ skip_export = true
switch_name = "${var.switch_name}"
temp_path = "."
vlan_id = "${var.vlan_id}"
@@ -111,7 +111,7 @@ build {
provisioner "powershell" {
elevated_password = "password"
elevated_user = "Administrator"
- script = "./extra/scripts/phase-1.ps1"
+ script = "./extra/scripts/windows/shared/phase-1.ps1"
}
provisioner "windows-restart" {
@@ -121,13 +121,7 @@ build {
provisioner "powershell" {
elevated_password = "password"
elevated_user = "Administrator"
- script = "./extra/scripts/phase-2.ps1"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-3.ps1"
+ script = "./extra/scripts/windows/shared/phase-2.ps1"
}
provisioner "windows-restart" {
@@ -136,86 +130,44 @@ build {
restart_timeout = "2h"
}
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
+ provisioner "windows-update" {
+ search_criteria = "IsInstalled=0"
+ update_limit = 10
}
provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- pause_before = "30s"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
- }
-
- provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
- }
-
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
+ restart_timeout = "1h"
}
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- pause_before = "30s"
- script = "./extra/scripts/phase-4.windows-updates.ps1"
+ provisioner "windows-update" {
+ search_criteria = "IsInstalled=0"
+ update_limit = 10
}
provisioner "windows-restart" {
- pause_before = "30s"
- restart_check_command = "powershell -command \"& {Write-Output 'restarted.'}\""
- restart_timeout = "2h"
+ restart_timeout = "1h"
}
- provisioner "powershell" {
- elevated_password = "password"
- elevated_user = "Administrator"
- inline = ["Write-Host \"Pausing before next stage\";Start-Sleep -Seconds ${var.upgrade_timeout}"]
- }
provisioner "powershell" {
elevated_password = "password"
elevated_user = "Administrator"
- script = "./extra/scripts/phase-5a.software.ps1"
+ script = "./extra/scripts/windows/shared/phase-5a.software.ps1"
}
provisioner "powershell" {
elevated_password = "password"
elevated_user = "Administrator"
- script = "./extra/scripts/phase-5d.windows-compress.ps1"
+ script = "./extra/scripts/windows/shared/phase-5d.windows-compress.ps1"
}
provisioner "file" {
destination = "C:\\Windows\\System32\\Sysprep\\unattend.xml"
- source = "${var.vagrant_sysprep_unattended}"
+ source = "${var.sysprep_unattended}"
}
provisioner "powershell" {
inline = ["Write-Output Phase-5-Deprovisioning", "if (!(Test-Path -Path $Env:SystemRoot\\system32\\Sysprep\\unattend.xml)){ Write-Output 'No file';exit (10)}", "& $Env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /shutdown /quiet /unattend:C:\\Windows\\system32\\sysprep\\unattend.xml"]
}
- post-processor "vagrant" {
- keep_input_artifact = true
- output = "${var.output_vagrant}"
- vagrantfile_template = "${var.vagrantfile_template}"
- }
}
diff --git a/vagrant/hv_rockylinux87_g2.template b/vagrant/hv_rockylinux88_g2.template
similarity index 100%
rename from vagrant/hv_rockylinux87_g2.template
rename to vagrant/hv_rockylinux88_g2.template
diff --git a/variables/almalinux8.yml b/variables/ansible/almalinux8.yml
similarity index 100%
rename from variables/almalinux8.yml
rename to variables/ansible/almalinux8.yml
diff --git a/variables/almalinux8_docker.yml b/variables/ansible/almalinux8_docker.yml
similarity index 100%
rename from variables/almalinux8_docker.yml
rename to variables/ansible/almalinux8_docker.yml
diff --git a/variables/almalinux9.yml b/variables/ansible/almalinux9.yml
similarity index 100%
rename from variables/almalinux9.yml
rename to variables/ansible/almalinux9.yml
diff --git a/variables/almalinux9_docker.yml b/variables/ansible/almalinux9_docker.yml
similarity index 100%
rename from variables/almalinux9_docker.yml
rename to variables/ansible/almalinux9_docker.yml
diff --git a/variables/centos7.yml b/variables/ansible/centos7.yml
similarity index 100%
rename from variables/centos7.yml
rename to variables/ansible/centos7.yml
diff --git a/variables/centos7_docker.yml b/variables/ansible/centos7_docker.yml
similarity index 100%
rename from variables/centos7_docker.yml
rename to variables/ansible/centos7_docker.yml
diff --git a/variables/oraclelinux8.yml b/variables/ansible/oraclelinux8.yml
similarity index 100%
rename from variables/oraclelinux8.yml
rename to variables/ansible/oraclelinux8.yml
diff --git a/variables/oraclelinux8_docker.yml b/variables/ansible/oraclelinux8_docker.yml
similarity index 100%
rename from variables/oraclelinux8_docker.yml
rename to variables/ansible/oraclelinux8_docker.yml
diff --git a/variables/oraclelinux9.yml b/variables/ansible/oraclelinux9.yml
similarity index 100%
rename from variables/oraclelinux9.yml
rename to variables/ansible/oraclelinux9.yml
diff --git a/variables/oraclelinux9_docker.yml b/variables/ansible/oraclelinux9_docker.yml
similarity index 100%
rename from variables/oraclelinux9_docker.yml
rename to variables/ansible/oraclelinux9_docker.yml
diff --git a/variables/rockylinux8.yml b/variables/ansible/rockylinux8.yml
similarity index 100%
rename from variables/rockylinux8.yml
rename to variables/ansible/rockylinux8.yml
diff --git a/variables/rockylinux8_docker.yml b/variables/ansible/rockylinux8_docker.yml
similarity index 100%
rename from variables/rockylinux8_docker.yml
rename to variables/ansible/rockylinux8_docker.yml
diff --git a/variables/rockylinux9.yml b/variables/ansible/rockylinux9.yml
similarity index 99%
rename from variables/rockylinux9.yml
rename to variables/ansible/rockylinux9.yml
index f4b6bdf..89ffc37 100644
--- a/variables/rockylinux9.yml
+++ b/variables/ansible/rockylinux9.yml
@@ -14,4 +14,3 @@ install_extra_groups: true
docker_prepare: false
extra_device: ""
install_motd: true
-
diff --git a/variables/rockylinux9_docker.yml b/variables/ansible/rockylinux9_docker.yml
similarity index 100%
rename from variables/rockylinux9_docker.yml
rename to variables/ansible/rockylinux9_docker.yml
diff --git a/variables/variables_almalinux-8.8.pkvars.hcl b/variables/variables_almalinux-8.8.pkvars.hcl
new file mode 100644
index 0000000..7040643
--- /dev/null
+++ b/variables/variables_almalinux-8.8.pkvars.hcl
@@ -0,0 +1,21 @@
+iso_url = "https://ftp.psnc.pl/linux/almalinux/8.8/isos/x86_64/AlmaLinux-8.8-x86_64-dvd.iso"
+iso_checksum_type = "sha256"
+iso_checksum = "635b30b967b509a32a1a3d81401db9861922acb396d065922b39405a43a04a31"
+vm_name = "packer-almalinux88-g2"
+disk_size = "70000"
+disk_additional_size = ["150000"]
+switch_name = "vSwitch"
+output_directory = "output-almalinux88"
+output_vagrant = "./vbox/packer-almalinux88-g2.box"
+vlan_id = ""
+memory = "4096"
+cpus = "4"
+vagrantfile_template = "./vagrant/hv_almalinux88_g2.template"
+ssh_password = "password"
+provision_script_options = "-z false"
+boot_command = "c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=AlmaLinux-8-8-x86_64-dvd inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux/8/hyperv/ks.cfg initrdefi /images/pxeboot/initrd.img boot"
+ansible_override = "variables/ansible/almalinux8.yml"
+ansible_playbook = "extra/playbooks/provision_rhel.yaml"
+ansible_variables= "extra/playbooks/provision_alma8_variables.yml"
+neofetch_file="extra/files/gen2-linux/prepare_neofetch.sh"
+uefi_file="extra/files/almalinux/8/uefi.sh"
diff --git a/variables/variables_almalinux92.pkvars.hcl b/variables/variables_almalinux-9.2.pkvars.hcl
similarity index 54%
rename from variables/variables_almalinux92.pkvars.hcl
rename to variables/variables_almalinux-9.2.pkvars.hcl
index 70fc9ce..e3d14c9 100644
--- a/variables/variables_almalinux92.pkvars.hcl
+++ b/variables/variables_almalinux-9.2.pkvars.hcl
@@ -1,4 +1,4 @@
-iso_url = "https://almalinux.slaskdatacenter.com/9.2/isos/x86_64/AlmaLinux-9.2-x86_64-dvd.iso"
+iso_url = "https://ftp.psnc.pl/linux/almalinux/9.2/isos/x86_64/AlmaLinux-9.2-x86_64-dvd.iso"
iso_checksum_type = "sha256"
iso_checksum = "00c91b923997c44822595998deb0cebcfaa53e93c2bed8745b04516badff431f"
vm_name = "packer-almalinux92-g2"
@@ -13,5 +13,9 @@ cpus = "4"
vagrantfile_template = "./vagrant/hv_almalinux92_g2.template"
ssh_password = "password"
provision_script_options = "-z false"
-boot_command = "c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=AlmaLinux-9-2-x86_64-dvd inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/gen2-almalinux9/ks.cfg initrdefi /images/pxeboot/initrd.img boot"
-ansible_override = "variables/almalinux9.yml"
+boot_command = "c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=AlmaLinux-9-2-x86_64-dvd inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux/9/hyperv/ks.cfg initrdefi /images/pxeboot/initrd.img boot"
+ansible_override = "variables/ansible/almalinux9.yml"
+ansible_variables= "extra/playbooks/provision_alma9_variables.yml"
+ansible_playbook = "extra/playbooks/provision_rhel.yaml"
+neofetch_file="extra/files/gen2-linux/prepare_neofetch.sh"
+uefi_file="extra/files/almalinux/9/uefi.sh"
\ No newline at end of file
diff --git a/variables/variables_almalinux86.pkvars.hcl b/variables/variables_almalinux86.pkvars.hcl
deleted file mode 100644
index f4a6f2b..0000000
--- a/variables/variables_almalinux86.pkvars.hcl
+++ /dev/null
@@ -1,17 +0,0 @@
-iso_url = "http://almalinux.slaskdatacenter.com/8.6/isos/x86_64/AlmaLinux-8.6-x86_64-dvd.iso"
-iso_checksum_type = "sha256"
-iso_checksum = "8c3bd1ff3d88b5599147626fa2616d85edcc861ec00edd6863b81dbfb135874c"
-vm_name = "packer-almalinux86-g2"
-disk_size = "70000"
-disk_additional_size = ["150000"]
-switch_name = "vSwitch"
-output_directory = "output-almalinux86"
-output_vagrant = "./vbox/packer-almalinux86-g2.box"
-vlan_id = ""
-memory = "4096"
-cpus = "4"
-vagrantfile_template = "./vagrant/hv_almalinux86_g2.template"
-ssh_password = "password"
-provision_script_options = "-z false"
-boot_command = "c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=AlmaLinux-8-6-x86_64-dvd inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/gen2-almalinux8/ks.cfg initrdefi /images/pxeboot/initrd.img boot"
-ansible_override = "variables/almalinux8.yml"
diff --git a/variables/variables_centos79.pkvars.hcl b/variables/variables_centos79.pkvars.hcl
deleted file mode 100644
index df20326..0000000
--- a/variables/variables_centos79.pkvars.hcl
+++ /dev/null
@@ -1,14 +0,0 @@
-iso_url="http://centos.slaskdatacenter.com/7.9.2009/isos/x86_64/CentOS-7-x86_64-Everything-2009.iso"
-iso_checksum_type="sha256"
-iso_checksum="689531cce9cf484378481ae762fae362791a9be078fda10e4f6977bf8fa71350"
-vm_name="packer-centos79-g2"
-disk_size="70000"
-disk_additional_size=["150000"]
-switch_name="vSwitch"
-output_directory="output-centos79"
-output_vagrant="./vbox/packer-centos-79-g2.box"
-vlan_id=""
-vagrantfile_template="./vagrant/hv_centos79_g2.template"
-ssh_password="password"
-boot_command="c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=CentOS\\x207\\x20x\\86_64 inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/gen2-centos/ks.cfg initrdefi /images/pxeboot/initrd.img boot"
-ansible_override="variables/centos7.yml"
\ No newline at end of file
diff --git a/variables/variables_oraclelinux-8.8.pkvars.hcl b/variables/variables_oraclelinux-8.8.pkvars.hcl
new file mode 100644
index 0000000..ca36461
--- /dev/null
+++ b/variables/variables_oraclelinux-8.8.pkvars.hcl
@@ -0,0 +1,21 @@
+iso_checksum_type = "sha256"
+iso_checksum = "cae39116245ff7c3c86d5305d9c11430ce5c4e512987563435ac59c37a082d7e"
+iso_url = "https://yum.oracle.com/ISOS/OracleLinux/OL8/u8/x86_64/OracleLinux-R8-U8-x86_64-dvd.iso"
+vm_name = "packer-oraclelinux88-g2"
+disk_size = "70000"
+disk_additional_size = ["150000"]
+switch_name = "vSwitch"
+output_directory = "output-oraclelinux88"
+output_vagrant = "./vbox/packer-oraclelinux88-g2.box"
+vlan_id = ""
+memory = "4096"
+cpus = "4"
+vagrantfile_template = "./vagrant/hv_oraclelinux88_g2.template"
+ssh_password = "password"
+provision_script_options = "-z false"
+boot_command = "c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=OL-8-8-0-BaseOS-x86_64 inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/oraclelinux/8/hyperv/ks.cfg initrdefi /images/pxeboot/initrd.img boot"
+ansible_override = "variables/ansible/oraclelinux8.yml"
+ansible_variables = "extra/playbooks/provision_oracle8_variables.yml"
+ansible_playbook = "extra/playbooks/provision_rhel.yaml"
+neofetch_file = "extra/files/gen2-linux/prepare_neofetch.sh"
+uefi_file = "extra/files/oraclelinux/8/uefi.sh"
\ No newline at end of file
diff --git a/variables/variables_oraclelinux92.pkvars.hcl b/variables/variables_oraclelinux-9.2.pkvars.hcl
similarity index 62%
rename from variables/variables_oraclelinux92.pkvars.hcl
rename to variables/variables_oraclelinux-9.2.pkvars.hcl
index 0a8e983..addf390 100644
--- a/variables/variables_oraclelinux92.pkvars.hcl
+++ b/variables/variables_oraclelinux-9.2.pkvars.hcl
@@ -13,5 +13,9 @@ cpus = "4"
vagrantfile_template = "./vagrant/hv_oraclelinux92_g2.template"
ssh_password = "password"
provision_script_options = "-z false"
-boot_command = "c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=OL-9-2-0-BaseOS-x86_64 inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/gen2-oraclelinux9/ks.cfg initrdefi /images/pxeboot/initrd.img boot"
-ansible_override = "variables/oraclelinux9.yml"
+boot_command = "c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=OL-9-2-0-BaseOS-x86_64 inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/oraclelinux/9/hyperv/ks.cfg initrdefi /images/pxeboot/initrd.img boot"
+ansible_override = "variables/ansible/oraclelinux9.yml"
+ansible_variables= "extra/playbooks/provision_oracle9_variables.yml"
+ansible_playbook = "extra/playbooks/provision_rhel.yaml"
+neofetch_file="extra/files/gen2-linux/prepare_neofetch.sh"
+uefi_file="extra/files/oraclelinux/9/uefi.sh"
\ No newline at end of file
diff --git a/variables/variables_oraclelinux86.pkvars.hcl b/variables/variables_oraclelinux86.pkvars.hcl
deleted file mode 100644
index d11eccd..0000000
--- a/variables/variables_oraclelinux86.pkvars.hcl
+++ /dev/null
@@ -1,17 +0,0 @@
-iso_url = "https://yum.oracle.com/ISOS/OracleLinux/OL8/u6/x86_64/OracleLinux-R8-U6-x86_64-dvd.iso"
-iso_checksum_type = "sha256"
-iso_checksum = "988969accaddd7fbf4f7ddced16c1b69d3e5c097435fcb2474426936a9c52aeb"
-vm_name = "packer-oraclelinux86-g2"
-disk_size = "70000"
-disk_additional_size = ["150000"]
-switch_name = "vSwitch"
-output_directory = "output-oraclelinux86"
-output_vagrant = "./vbox/packer-oraclelinux86-g2.box"
-vlan_id = ""
-memory = "4096"
-cpus = "4"
-vagrantfile_template = "./vagrant/hv_oraclelinux86_g2.template"
-ssh_password = "password"
-provision_script_options = "-z false"
-boot_command = "c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=OL-8-6-0-BaseOS-x86_64 inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/gen2-oraclelinux8/ks.cfg initrdefi /images/pxeboot/initrd.img boot"
-ansible_override = "variables/oraclelinux8.yml"
diff --git a/variables/variables_rockylinux-8.8.pkvars.hcl b/variables/variables_rockylinux-8.8.pkvars.hcl
new file mode 100644
index 0000000..dbca511
--- /dev/null
+++ b/variables/variables_rockylinux-8.8.pkvars.hcl
@@ -0,0 +1,21 @@
+iso_url = "https://ftp.psnc.pl/linux/rockylinux/8.8/isos/x86_64/Rocky-x86_64-dvd1.iso"
+iso_checksum_type = "sha256"
+iso_checksum = "7b8bdfe189cf24ae5c2d6a88f7a0b5f3012d23f9332c47943d538b4bc03a3704"
+vm_name = "packer-rockylinux88-g2"
+disk_size = "70000"
+disk_additional_size = ["150000"]
+switch_name = "vSwitch"
+output_directory = "output-rockylinux88"
+output_vagrant = "./vbox/packer-rockylinux88-g2.box"
+vlan_id = ""
+memory = "4096"
+cpus = "4"
+vagrantfile_template = "./vagrant/hv_rockylinux88_g2.template"
+ssh_password = "password"
+provision_script_options = "-z false"
+boot_command = "c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Rocky-8-8-x86_64-dvd inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rockylinux/8/hyperv/ks.cfg initrdefi /images/pxeboot/initrd.img boot"
+ansible_override = "variables/ansible/rockylinux8.yml"
+ansible_variables= "extra/playbooks/provision_rocky8_variables.yml"
+ansible_playbook = "extra/playbooks/provision_rhel.yaml"
+neofetch_file="extra/files/gen2-linux/prepare_neofetch.sh"
+uefi_file="extra/files/rockylinux/8/uefi.sh"
diff --git a/variables/variables_rockylinux92.pkvars.hcl b/variables/variables_rockylinux-9.2.pkvars.hcl
similarity index 62%
rename from variables/variables_rockylinux92.pkvars.hcl
rename to variables/variables_rockylinux-9.2.pkvars.hcl
index f48e53b..330b991 100644
--- a/variables/variables_rockylinux92.pkvars.hcl
+++ b/variables/variables_rockylinux-9.2.pkvars.hcl
@@ -13,5 +13,9 @@ cpus = "4"
vagrantfile_template = "./vagrant/hv_rockylinux92_g2.template"
ssh_password = "password"
provision_script_options = "-z false"
-boot_command = "c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Rocky-9-2-x86_64-dvd inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/gen2-rockylinux9/ks.cfg initrdefi /images/pxeboot/initrd.img boot"
-ansible_override = "variables/rockylinux9.yml"
+boot_command = "c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Rocky-9-2-x86_64-dvd inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rockylinux/9/hyperv/ks.cfg initrdefi /images/pxeboot/initrd.img boot"
+ansible_override = "variables/ansible/rockylinux9.yml"
+ansible_variables= "extra/playbooks/provision_rocky9_variables.yml"
+ansible_playbook = "extra/playbooks/provision_rhel.yaml"
+neofetch_file="extra/files/gen2-linux/prepare_neofetch.sh"
+uefi_file="extra/files/rockylinux/9/uefi.sh"
\ No newline at end of file
diff --git a/variables/variables_rockylinux87.pkvars.hcl b/variables/variables_rockylinux87.pkvars.hcl
deleted file mode 100644
index d160aa6..0000000
--- a/variables/variables_rockylinux87.pkvars.hcl
+++ /dev/null
@@ -1,17 +0,0 @@
-iso_url = "https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.7-x86_64-dvd1.iso"
-iso_checksum_type = "sha256"
-iso_checksum = "4827dce1c58560d3ca470a5053e8d86ba059cbb77cfca3b5f6a5863d2aac5b84"
-vm_name = "packer-rockylinux87-g2"
-disk_size = "70000"
-disk_additional_size = ["150000"]
-switch_name = "vSwitch"
-output_directory = "output-rockylinux87"
-output_vagrant = "./vbox/packer-rockylinux87-g2.box"
-vlan_id = ""
-memory = "4096"
-cpus = "4"
-vagrantfile_template = "./vagrant/hv_rockylinux87_g2.template"
-ssh_password = "password"
-provision_script_options = "-z false"
-boot_command = "c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Rocky-8-7-x86_64-dvd inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/gen2-rockylinux8/ks.cfg initrdefi /images/pxeboot/initrd.img boot"
-ansible_override = "variables/rockylinux8.yml"
diff --git a/variables/variables_ubuntu-20.04.pkvars.hcl b/variables/variables_ubuntu-20.04.pkvars.hcl
new file mode 100644
index 0000000..bfd5532
--- /dev/null
+++ b/variables/variables_ubuntu-20.04.pkvars.hcl
@@ -0,0 +1,21 @@
+boot_command=["","linux /casper/vmlinuz quiet autoinstall net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1 ds=nocloud-net\\;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ ","initrd /casper/initrd ","boot "]
+disk_additional_size=["150000"]
+disk_size="70000"
+http_directory="./extra/files/ubuntu/22.04/hyperv"
+iso_checksum_type="sha256"
+iso_checksum="b8f31413336b9393ad5d8ef0282717b2ab19f007df2e9ed5196c13d8f9153c8b"
+iso_url="https://releases.ubuntu.com/focal/ubuntu-20.04.6-live-server-amd64.iso"
+output_directory="output-ubuntu2004"
+#output_vagrant="./vbox/packer-ubuntu2004-g2.box"
+provision_script_options="-z false -h true -p false"
+ssh_password="password"
+ssh_username="ubuntu"
+switch_name="vSwitch"
+#vagrantfile_template="./vagrant/hv_ubuntu2004_g2.template"
+vlan_id=""
+vm_name="packer-ubuntu2004-g2"
+uefi_file="extra/files/ubuntu/20.04/uefi.sh"
+provision_file="extra/files/ubuntu/shared/provision.sh"
+motd_file="extra/files/ubuntu/shared/motd.sh"
+zeroing_file="extra/files/ubuntu/shared/zeroing.sh"
+neofetch_file="extra/files/ubuntu/shared/prepare_neofetch.sh"
\ No newline at end of file
diff --git a/variables/variables_ubuntu-22.04.pkvars.hcl b/variables/variables_ubuntu-22.04.pkvars.hcl
new file mode 100644
index 0000000..6f28a62
--- /dev/null
+++ b/variables/variables_ubuntu-22.04.pkvars.hcl
@@ -0,0 +1,21 @@
+boot_command=["c","linux /casper/vmlinuz quiet autoinstall net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1 ds=nocloud-net\\;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ ","initrd /casper/initrd ","boot "]
+disk_additional_size=["150000"]
+disk_size="70000"
+http_directory="./extra/files/ubuntu/22.04/hyperv"
+iso_checksum_type="sha256"
+iso_checksum="a4acfda10b18da50e2ec50ccaf860d7f20b389df8765611142305c0e911d16fd"
+iso_url="https://releases.ubuntu.com/jammy/ubuntu-22.04.3-live-server-amd64.iso"
+output_directory="output-ubuntu2204"
+#output_vagrant="./vbox/packer-ubuntu2204-g2.box"
+provision_script_options="-z false -h true -p false"
+ssh_password="password"
+ssh_username="ubuntu"
+switch_name="vSwitch"
+#vagrantfile_template="./vagrant/hv_ubuntu2204_g2.template"
+vlan_id=""
+vm_name="packer-ubuntu2204-g2"
+uefi_file="extra/files/ubuntu/22.04/uefi.sh"
+provision_file="extra/files/ubuntu/shared/provision.sh"
+motd_file="extra/files/ubuntu/shared/motd.sh"
+zeroing_file="extra/files/ubuntu/shared/zeroing.sh"
+neofetch_file="extra/files/ubuntu/shared/prepare_neofetch.sh"
\ No newline at end of file
diff --git a/variables/variables_ubuntu2004.pkvars.hcl b/variables/variables_ubuntu2004.pkvars.hcl
deleted file mode 100644
index 8948d58..0000000
--- a/variables/variables_ubuntu2004.pkvars.hcl
+++ /dev/null
@@ -1,16 +0,0 @@
-boot_command=["","linux /casper/vmlinuz quiet autoinstall net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1 ds=nocloud-net\\;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ ","initrd /casper/initrd ","boot "]
-disk_additional_size=["150000"]
-disk_size="70000"
-http_directory="./extra/files/gen2-ubuntu2004"
-iso_checksum_type="sha256"
-iso_checksum="28ccdb56450e643bad03bb7bcf7507ce3d8d90e8bf09e38f6bd9ac298a98eaad"
-iso_url="https://ubuntu.man.lodz.pl/ubuntu-releases/focal/ubuntu-20.04.4-live-server-amd64.iso"
-output_directory="output-ubuntu2004"
-output_vagrant="./vbox/packer-ubuntu2004-g2.box"
-provision_script_options="-z false -h true"
-ssh_password="password"
-ssh_username="ubuntu"
-switch_name="vSwitch"
-vagrantfile_template="./vagrant/hv_ubuntu2004_g2.template"
-vlan_id=""
-vm_name="packer-ubuntu2004-g2"
diff --git a/variables/variables_ubuntu2204.pkvars.hcl b/variables/variables_ubuntu2204.pkvars.hcl
deleted file mode 100644
index 8cc8dc9..0000000
--- a/variables/variables_ubuntu2204.pkvars.hcl
+++ /dev/null
@@ -1,16 +0,0 @@
-boot_command=["c","linux /casper/vmlinuz quiet autoinstall net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1 ds=nocloud-net\\;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ ","initrd /casper/initrd ","boot "]
-disk_additional_size=["150000"]
-disk_size="70000"
-http_directory="./extra/files/gen2-ubuntu2204"
-iso_checksum_type="sha256"
-iso_checksum="84aeaf7823c8c61baa0ae862d0a06b03409394800000b3235854a6b38eb4856f"
-iso_url="https://releases.ubuntu.com/22.04/ubuntu-22.04-live-server-amd64.iso"
-output_directory="output-ubuntu2204"
-output_vagrant="./vbox/packer-ubuntu2204-g2.box"
-provision_script_options="-z false -h true"
-ssh_password="password"
-ssh_username="ubuntu"
-switch_name="vSwitch"
-vagrantfile_template="./vagrant/hv_ubuntu2204_g2.template"
-vlan_id=""
-vm_name="packer-ubuntu2204-g2"
diff --git a/variables/variables_win2016_std.pkvars.hcl b/variables/variables_win2016_std.pkvars.hcl
deleted file mode 100644
index 26d288a..0000000
--- a/variables/variables_win2016_std.pkvars.hcl
+++ /dev/null
@@ -1,14 +0,0 @@
-iso_url=".\\iso\\SW_DVD9_Win_Server_STD_CORE_2016_64Bit_English_-4_DC_STD_MLF_X21-70526.ISO"
-iso_checksum_type="sha256"
-iso_checksum="47919ce8b4993f531ca1fa3f85941f4a72b47ebaa4d3a321fecf83ca9d17e6b8"
-switch_name="vSwitch"
-vlan_id=""
-vm_name="packer-windows2016-g2"
-disk_size="80000"
-output_directory="output-windows-g2"
-secondary_iso_image="./extra/files/gen2-2016/secondary.iso"
-output_vagrant="./vbox/packer-windows-2016-std-g2.box"
-vagrantfile_template="./vagrant/hv_win2016_std.template"
-sysprep_unattended="./extra/files/gen2-2016/std/unattend.xml"
-vagrant_sysprep_unattended="./extra/files/gen2-2016/std/unattend_vagrant.xml"
-upgrade_timeout="240"
diff --git a/variables/variables_win2019_dc.pkvars.hcl b/variables/variables_win2019_dc.pkvars.hcl
deleted file mode 100644
index 39127c5..0000000
--- a/variables/variables_win2019_dc.pkvars.hcl
+++ /dev/null
@@ -1,14 +0,0 @@
-iso_url="./iso/SW_DVD9_Win_Server_STD_CORE_2019_1809.17_64Bit_English_DC_STD_MLF_X22-69933.ISO"
-iso_checksum_type="sha256"
-iso_checksum="d894b01db8a856bfbcf9e18d9202a6e98c1d4bba147dc7be9763f28ca68aefdb"
-switch_name="vSwitch"
-vlan_id=""
-vm_name="packer-windows2019dc-g2"
-disk_size="80000"
-output_directory="output-windows-2019dc-g2"
-secondary_iso_image="./extra/files/gen2-2019/dc/secondary.iso"
-output_vagrant="./vbox/packer-windows-2019-dc-g2.box"
-vagrantfile_template="./vagrant/hv_win2019_dc.template"
-sysprep_unattended="./extra/files/gen2-2019/dc/unattend.xml"
-vagrant_sysprep_unattended="./extra/files/gen2-2019/dc/unattend_vagrant.xml"
-upgrade_timeout="240"
diff --git a/variables/variables_win2019_std.pkvars.hcl b/variables/variables_win2019_std.pkvars.hcl
deleted file mode 100644
index 3c7dbf2..0000000
--- a/variables/variables_win2019_std.pkvars.hcl
+++ /dev/null
@@ -1,14 +0,0 @@
-iso_url="./iso/SW_DVD9_Win_Server_STD_CORE_2019_1809.17_64Bit_English_DC_STD_MLF_X22-69933.ISO"
-iso_checksum_type="sha256"
-iso_checksum="d894b01db8a856bfbcf9e18d9202a6e98c1d4bba147dc7be9763f28ca68aefdb"
-switch_name="vSwitch"
-vlan_id=""
-vm_name="packer-windows2019-g2"
-disk_size="80000"
-output_directory="output-windows-2019-g2"
-secondary_iso_image="./extra/files/gen2-2019/std/secondary.iso"
-output_vagrant="./vbox/packer-windows-2019-std-g2.box"
-vagrantfile_template="./vagrant/hv_win2019_std.template"
-sysprep_unattended="./extra/files/gen2-2019/std/unattend.xml"
-vagrant_sysprep_unattended="./extra/files/gen2-2019/std/unattend_vagrant.xml"
-upgrade_timeout="240"
diff --git a/variables/variables_windows_server_2019_dc.pkvars.hcl b/variables/variables_windows_server_2019_dc.pkvars.hcl
new file mode 100644
index 0000000..01ae9c8
--- /dev/null
+++ b/variables/variables_windows_server_2019_dc.pkvars.hcl
@@ -0,0 +1,11 @@
+iso_url="https://software-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66749/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso"
+iso_checksum_type="sha256"
+iso_checksum="6dae072e7f78f4ccab74a45341de0d6e2d45c39be25f1f5920a2ab4f51d7bcbb"
+switch_name="vSwitch"
+vlan_id=""
+vm_name="packer-windows2019-g2"
+disk_size="80000"
+output_directory="output-windows-2019-g2"
+secondary_iso_image="./extra/files/windows/2019/hyperv/dc/secondary.iso"
+sysprep_unattended="./extra/files/windows/2019/hyperv/dc/unattend.xml"
+upgrade_timeout="240"
diff --git a/variables/variables_windows_server_2019_std.pkvars.hcl b/variables/variables_windows_server_2019_std.pkvars.hcl
new file mode 100644
index 0000000..513b505
--- /dev/null
+++ b/variables/variables_windows_server_2019_std.pkvars.hcl
@@ -0,0 +1,11 @@
+iso_url="https://software-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66749/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso"
+iso_checksum_type="sha256"
+iso_checksum="6dae072e7f78f4ccab74a45341de0d6e2d45c39be25f1f5920a2ab4f51d7bcbb"
+switch_name="vSwitch"
+vlan_id=""
+vm_name="packer-windows2019-g2"
+disk_size="80000"
+output_directory="output-windows-2019-g2"
+secondary_iso_image="./extra/files/windows/2019/hyperv/std/secondary.iso"
+sysprep_unattended="./extra/files/windows/2019/hyperv/std/unattend.xml"
+upgrade_timeout="240"
diff --git a/variables/variables_win2022_dc.pkvars.hcl b/variables/variables_windows_server_2022_dc.pkvars.hcl
similarity index 57%
rename from variables/variables_win2022_dc.pkvars.hcl
rename to variables/variables_windows_server_2022_dc.pkvars.hcl
index b07d14a..2cb3a0c 100644
--- a/variables/variables_win2022_dc.pkvars.hcl
+++ b/variables/variables_windows_server_2022_dc.pkvars.hcl
@@ -6,11 +6,8 @@ vlan_id=""
vm_name="packer-windows2022dc-g2"
disk_size="80000"
output_directory="output-windows-2022dc-g2"
-secondary_iso_image="./extra/files/gen2-2022/dc/secondary.iso"
-output_vagrant="./vbox/packer-windows-2022-dc-g2.box"
-vagrantfile_template="./vagrant/hv_win2022_dc.template"
-sysprep_unattended="./extra/files/gen2-2022/dc/unattend.xml"
-vagrant_sysprep_unattended="./extra/files/gen2-2022/dc/unattend_vagrant.xml"
+secondary_iso_image="./extra/files/windows/2022/hyperv/dc/secondary.iso"
+sysprep_unattended="./extra/files/windows/2022/hyperv/dc/unattend.xml"
upgrade_timeout="240"
memory = "4096"
cpus = "4"
diff --git a/variables/variables_win2022_std.pkvars.hcl b/variables/variables_windows_server_2022_std.pkvars.hcl
similarity index 57%
rename from variables/variables_win2022_std.pkvars.hcl
rename to variables/variables_windows_server_2022_std.pkvars.hcl
index ea1944b..b6ec9ce 100644
--- a/variables/variables_win2022_std.pkvars.hcl
+++ b/variables/variables_windows_server_2022_std.pkvars.hcl
@@ -6,11 +6,8 @@ vlan_id=""
vm_name="packer-windows2022-g2"
disk_size="80000"
output_directory="output-windows-2022-g2"
-secondary_iso_image="./extra/files/gen2-2022/std/secondary.iso"
-output_vagrant="./vbox/packer-windows-2022-std-g2.box"
-vagrantfile_template="./vagrant/hv_win2022_std.template"
-sysprep_unattended="./extra/files/gen2-2022/std/unattend.xml"
-vagrant_sysprep_unattended="./extra/files/gen2-2022/std/unattend_vagrant.xml"
+secondary_iso_image="./extra/files/windows/2022/hyperv/std/secondary.iso"
+sysprep_unattended="./extra/files/windows/2022/hyperv/std/unattend.xml"
upgrade_timeout="240"
memory = "4096"
cpus = "4"
\ No newline at end of file