From d5f44602afb40ad4b3f660f8b9717fc16f9e6834 Mon Sep 17 00:00:00 2001 From: Marcin Bojko Date: Tue, 17 Nov 2020 19:26:58 +0100 Subject: [PATCH] Version 1.4.4 --- .gitlab-ci.yml | 14 +- CHANGELOG.md | 9 + README.md | 184 +++++++++++------- extra/scripts/phase-2.ps1 | 1 + extra/scripts/phase-3.ps1 | 2 +- hv_centos77.ps1 => hv_centos79.ps1 | 4 +- ...tos77_docker.ps1 => hv_centos79_docker.ps1 | 4 +- ...s77_vagrant.ps1 => hv_centos79_vagrant.ps1 | 6 +- vagrant/hv_centos76_g2.template | 27 --- ...77_g2.template => hv_centos79_g2.template} | 4 +- variables/variables_centos78.json | 2 +- ..._centos77.json => variables_centos79.json} | 14 +- 12 files changed, 150 insertions(+), 121 deletions(-) rename hv_centos77.ps1 => hv_centos79.ps1 (92%) rename hv_centos77_docker.ps1 => hv_centos79_docker.ps1 (91%) rename hv_centos77_vagrant.ps1 => hv_centos79_vagrant.ps1 (87%) delete mode 100644 vagrant/hv_centos76_g2.template rename vagrant/{hv_centos77_g2.template => hv_centos79_g2.template} (90%) rename variables/{variables_centos77.json => variables_centos79.json} (50%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7fcc838..845f1c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - packer_version: "1.6.0" + packer_version: "1.6.5" dind: 19.03-dind stages: - get-packer @@ -26,42 +26,42 @@ get-packer: tags: - docker - shared -centos77: +centos79: stage: centos7-packer-validate image: alpine services: - docker:$dind before_script: - export template_file="./templates/hv_centos7_g2.json" - - export var_file="./variables/variables_centos77.json" + - export var_file="./variables/variables_centos79.json" script: - ./packer version --version - ./packer validate -var-file="$var_file" "$template_file" tags: - docker - shared -centos77-docker: +centos79-docker: stage: centos7-packer-validate image: alpine services: - docker:$dind before_script: - export template_file="./templates/hv_centos7_g2_docker.json" - - export var_file="./variables/variables_centos77.json" + - export var_file="./variables/variables_centos79.json" script: - ./packer version --version - ./packer validate -var-file="$var_file" "$template_file" tags: - docker - shared -centos77-vagrant: +centos79-vagrant: stage: centos7-packer-validate image: alpine services: - docker:$dind before_script: - export template_file="./templates/hv_centos7_g2_vagrant.json" - - export var_file="./variables/variables_centos77.json" + - export var_file="./variables/variables_centos79.json" script: - ./packer version --version - ./packer validate -var-file="$var_file" "$template_file" diff --git a/CHANGELOG.md b/CHANGELOG.md index b6302c6..2da0cfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## Version 1.4.4 2020-11-17 + +* [CentOS] added added `CentOS 7.9` support +* [CentOS] added added `CentOS 7.9 Docker` support +* [CentOS] added added `CentOS 7.9 Vagrant` support +* [CentOS] `CentOS 7.8` doesn't update OS by default anymore +* [Windows] upgrade `puppet-agent` package to version 5.5.22 +* [Extra] smaller adjusts in `extra` + ## Version 1.4.3 2020-09-25 * [CentOS] bump SystemCenter Agent to 1.0.3.1028 diff --git a/README.md b/README.md index d7b57f5..173dd8f 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,58 @@ # Set of packer templates to create Microft Hyper-V virtual machines - + + +- [Set of packer templates to create Microft Hyper-V virtual machines](#set-of-packer-templates-to-create-microft-hyper-v-virtual-machines) + - [Requirements](#requirements) + - [Usage](#usage) + - [Install packer from Chocolatey](#install-packer-from-chocolatey) + - [Add firewal exclusions for TCP ports 8000-9000 default range](#add-firewal-exclusions-for-tcp-ports-8000-9000-default-range) + - [To adjust to your Hyper-V, please check variables below and/or in ./variables files - for](#to-adjust-to-your-hyper-v-please-check-variables-below-andor-in-variables-files---for) + - [Scripts](#scripts) + - [Windows Machines](#windows-machines) + - [Linux Machines](#linux-machines) + - [Templates Windows 2019](#templates-windows-2019) + - [Hyper-V Generation 2 Windows Server 2019 Standard Image](#hyper-v-generation-2-windows-server-2019-standard-image) + - [Standard Generation 2 Prerequisites](#standard-generation-2-prerequisites) + - [Hyper-V Generation 2 Windows Server 2019 Datacenter Image](#hyper-v-generation-2-windows-server-2019-datacenter-image) + - [Datacenter Generation 2 Prerequisites](#datacenter-generation-2-prerequisites) + - [Templates Windows 2016](#templates-windows-2016) + - [Hyper-V Generation 2 Windows Server 2016 Standard Image](#hyper-v-generation-2-windows-server-2016-standard-image) + - [Standard Generation 2 Prerequisites](#standard-generation-2-prerequisites) + - [Templates Windows Server](#templates-windows-server) + - [Hyper-V Generation 2 Windows Server 1903 Standard Image](#hyper-v-generation-2-windows-server-1903-standard-image) + - [Hyper-V Generation 2 Windows Server 1909 Standard Image](#hyper-v-generation-2-windows-server-1909-standard-image) + - [Templates CentOS 8.x](#templates-centos-8x) + - [Hyper-V Generation 2 CentOS 8.1 Image](#hyper-v-generation-2-centos-81-image) + - [Warnings - CentOS 8](#warnings---centos-8) + - [Vagrant support - CentOS 8](#vagrant-support---centos-8) + - [Templates CentOS 7.x](#templates-centos-7x) + - [Warnings - CentOS Docker](#warnings---centos-docker) + - [Hyper-V Generation 2 CentOS 7.8](#hyper-v-generation-2-centos-78) + - [Hyper-V Generation 2 CentOS 7.8 Image with extra docker volume](#hyper-v-generation-2-centos-78-image-with-extra-docker-volume) + - [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) + - [Vagrant support - CentOS 7.x](#vagrant-support---centos-7x) + - [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) + - [Infamous UEFI/Secure boot WIndows implementation](#infamous-uefisecure-boot-windows-implementation) + - [~~On Windows Server 2019/Windows 10 1809 image boots to fast for packer to react~~](#on-windows-server-2019windows-10-1809-image-boots-to-fast-for-packer-to-react) + - [~~When Hyper-V host has more than one interface Packer sets {{ .HTTPIP }} variable to inproper interface~~](#when-hyper-v-host-has-more-than-one-interface-packer-sets--httpip--variable-to-inproper-interface) + - [Packer version 1.3.0/1.3.1 have bug with windows-restart provisioner](#packer-version-130131-have-bug-with-windows-restart-provisioner) + - [Packer won't run until VirtualSwitch is created as shared](#packer-wont-run-until-virtualswitch-is-created-as-shared) + - [I have problem how to find a proper WIM name in Windows ISO to pick proper version](#i-have-problem-how-to-find-a-proper-wim--name-in-windows-iso-to-pick-proper-version) + - [On Windows machines, build break during updates phase, when update cycles are interfering with each other](#on-windows-machines-build-break-during-updates-phase-when-update-cycles-are-interfering-with-each-other) + - [Why don't you use ansible instead of shell scripts for provisioning](#why-dont-you-use-ansible-instead-of-shell-scripts-for-provisioning) + - [About](#about) + + ## Requirements -* packer <=`1.6.0`. Do not use packer below 1.6.0. For previous packer versions use previous releases from this repository -* Microsoft Hyper-V Server 2016/2019 or Microsoft Windows Server 2016/2019 (not 2012/R2) with Hyper-V role installed as host to build your images -* firewall exceptions for `packer` http server (look down below) -* [OPTIONAL] Vagrant >= `2.2.9` - for `vagrant` version of scripts. Boxes (prebuilt) are already available here: [https://app.vagrantup.com/marcinbojko](https://app.vagrantup.com/marcinbojko) -* be aware, for 2016 - VMs are in version 8.0, for 2019 - VMs are in version 9.0. There is no way to reuse higher version in previous operating system. If you need v8.0 - build and use only VHDX. +- packer <=`1.6.0`. Do not use packer below 1.6.0. For previous packer versions use previous releases from this repository +- Microsoft Hyper-V Server 2016/2019 or Microsoft Windows Server 2016/2019 (not 2012/R2) with Hyper-V role installed as host to build your images +- firewall exceptions for `packer` http server (look down below) +- [OPTIONAL] Vagrant >= `2.2.9` - for `vagrant` version of scripts. Boxes (prebuilt) are already available here: [https://app.vagrantup.com/marcinbojko](https://app.vagrantup.com/marcinbojko) +- be aware, for 2016 - VMs are in version 8.0, for 2019 - VMs are in version 9.0. There is no way to reuse higher version in previous operating system. If you need v8.0 - build and use only VHDX. ## Usage @@ -26,19 +72,19 @@ New-NetFirewallRule -DisplayName "Packer_http_server" -Direction Inbound -Action ### To adjust to your Hyper-V, please check variables below and/or in ./variables files - for -* proper VLAN ID (possible passing as variable `-var 'vlan_id=0'` ). Look to your build server NIC setings. -* proper Hyper-V Virtual Switch name (access to Internet will be required) (possible passing as variable `-var 'switch_name=vSwitch'`). Remember - creation of new switch by packer, instead of reusing existing one can cause lack of Internet access. If it's possible substitute variable with your current switch's name. -* proper URL for ISO images in packer's template (possible passing as variable `-var 'iso_url=file.iso'` ). Be warned - using your own or different images can fail the build, as for example image index or image name used by your ISO can be different then specified by script. Look at the bottom of this Readme to read how to find or use image index. -* proper checksum type (possible passing as variable `-var 'iso_checksum_type=sha256'` ) -* proper checksum (possible passing as variable `-var 'iso_checksum=aaaabbbbbbbcccccccddddd'` ) +- proper VLAN ID (possible passing as variable `-var 'vlan_id=0'` ). Look to your build server NIC setings. +- proper Hyper-V Virtual Switch name (access to Internet will be required) (possible passing as variable `-var 'switch_name=vSwitch'`). Remember - creation of new switch by packer, instead of reusing existing one can cause lack of Internet access. If it's possible substitute variable with your current switch's name. +- proper URL for ISO images in packer's template (possible passing as variable `-var 'iso_url=file.iso'` ). Be warned - using your own or different images can fail the build, as for example image index or image name used by your ISO can be different then specified by script. Look at the bottom of this Readme to read how to find or use image index. +- proper checksum type (possible passing as variable `-var 'iso_checksum_type=sha256'` ) +- proper checksum (possible passing as variable `-var 'iso_checksum=aaaabbbbbbbcccccccddddd'` ) ## Scripts ### Windows Machines -* all available updates will be applied (3 passes) -* latest version of chocolatey -* packages from a list below: +- all available updates will be applied (3 passes) +- latest version of chocolatey +- packages from a list below: |Package|Version| |-------|-------| @@ -46,11 +92,11 @@ New-NetFirewallRule -DisplayName "Packer_http_server" -Direction Inbound -Action |dotnetfx|latest| |sysinternals|latest| -* latest Nuget poweshell module -* `phase3.ps1` Puppet agent settings will be customized (`server=foreman.spcph.local`) with parameters: - * `Version` - puppet chocolatey version, for example "5.5.20" - * `AddPrivateChoco` ($true/$false) - if set to true, private MyGet repository will be added as `public` - * `PuppetMaster` (foreman.spcph.local) - if set, in `puppet.conf` section server will point to that variable +- latest Nuget poweshell module +- `phase3.ps1` Puppet agent settings will be customized (`server=foreman.spcph.local`) with parameters: + - `Version` - puppet chocolatey version, for example "5.5.20" + - `AddPrivateChoco` ($true/$false) - if set to true, private MyGet repository will be added as `public` + - `PuppetMaster` (foreman.spcph.local) - if set, in `puppet.conf` section server will point to that variable Example of usage: @@ -58,11 +104,11 @@ New-NetFirewallRule -DisplayName "Packer_http_server" -Direction Inbound -Action Puppet is set to clear any temp SSL keys and to be stopped after generalize phase -* `phase5b-docker.ps1` - Docker settings can be customised - * `requiredVersion` - which version of docker module to install - defaults to 19.03.1 - * `installCompose` ($true/$false) - install docker-compose from chocolatey packages - * `dockerLocation` - of set, will default docker images and settings there. On empty, docker location is not being set. - * `configDockerLocation` - default place for docker's config file +- `phase5b-docker.ps1` - Docker settings can be customised + - `requiredVersion` - which version of docker module to install - defaults to 19.03.1 + - `installCompose` ($true/$false) - install docker-compose from chocolatey packages + - `dockerLocation` - of set, will default docker images and settings there. On empty, docker location is not being set. + - `configDockerLocation` - default place for docker's config file Example of usage @@ -70,31 +116,31 @@ New-NetFirewallRule -DisplayName "Packer_http_server" -Direction Inbound -Action ### Linux Machines -* Repositories: +- Repositories: |Repository|Package|switch| |----------|------------|---| |Epel 7 | |no| - |Zabbix 4.2|zabbix-agent|can be switched off by `-z false`| + |Zabbix 4.4|zabbix-agent|can be switched off by `-z false`| |Puppet 5 |puppet-agent|can be switched off by `-p false`| |Webmin (CentOS7)|webmin|can be switched off by setting `-w false`| |Cockpit (CentOS8) |Cockpit|can be switched off by setting `-c false`| |- |scvmmagent| can be switched off by setting `-h false`| |neofetch |neofetch|no| -* [Optional] Linux machine with separated disk for docker -* [Optional] Linux machine for vagrant +- [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 -* adjust `/files/provision.sh` to modify package's versions/servers. -* change `"provision_script_options"` variable to: - * -p (true/false) - switch Install Puppet on/off - * -w (true/false) - switch Install Webmin on/off (CentOS7 only) - * -h (true/false) - switch Install Hyper-V integration services on/off - * -u (true/false) - switch yum update all on/off (usable when creating previous than `latest` version of OS) - * -z (true/false) - switch Zabbix-agent installation - * -c (true/false) - switch Cockpit installation (CentOS8 only) +- adjust `/files/provision.sh` to modify package's versions/servers. +- change `"provision_script_options"` variable to: + - -p (true/false) - switch Install Puppet on/off + - -w (true/false) - switch Install Webmin on/off (CentOS7 only) + - -h (true/false) - switch Install Hyper-V integration services on/off + - -u (true/false) - switch yum update all on/off (usable when creating previous than `latest` version of OS) + - -z (true/false) - switch Zabbix-agent installation + - -c (true/false) - switch Cockpit installation (CentOS8 only) Example: @@ -102,7 +148,7 @@ New-NetFirewallRule -DisplayName "Packer_http_server" -Direction Inbound -Action "provision_script_options": "-p false -u true -w true -h false -z false" ``` -* `prepare_neofetch.sh` - default banner during after the login - change required fields you'd like to see in `provision.sh` +- `prepare_neofetch.sh` - default banner during after the login - change required fields you'd like to see in `provision.sh` ## Templates Windows 2019 @@ -114,8 +160,8 @@ Run `hv_win2019_std.ps1` (Windows) 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 +- ./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. @@ -136,8 +182,8 @@ Run `hv_win2019_dc.ps1` (Windows) For Generation 2 prepare `secondary.iso` with folder structure: -* ./extra/files/gen2-2019/dc/Autounattend.xml => /Autounattend.xml -* ./extra/scripts/hyper-v/bootstrap.ps1 => /bootstrap.ps1 +- ./extra/files/gen2-2019/dc/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. @@ -160,8 +206,8 @@ Run `hv_win2016_std.ps1` (Windows) 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 +- ./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. @@ -180,8 +226,8 @@ This template uses this image name in Autounattendes.xml. If youre using differe If you need changes For - prepare `secondary1903.iso` with folder structure: -* ./extra/files/gen2-1903/Autounattend.xml => /Autounattend.xml -* ./extra/scripts/hyper-v/bootstrap.ps1 => /bootstrap.ps1 +- ./extra/files/gen2-1903/Autounattend.xml => /Autounattend.xml +- ./extra/scripts/hyper-v/bootstrap.ps1 => /bootstrap.ps1 Run `hv_winserver_1903.ps1` @@ -189,8 +235,8 @@ Run `hv_winserver_1903.ps1` If you need changes For - prepare `secondary1909.iso` with folder structure: -* ./extra/files/gen2-1909/Autounattend.xml => /Autounattend.xml -* ./extra/scripts/hyper-v/bootstrap.ps1 => /bootstrap.ps1 +- ./extra/files/gen2-1909/Autounattend.xml => /Autounattend.xml +- ./extra/scripts/hyper-v/bootstrap.ps1 => /bootstrap.ps1 Run `hv_winserver_1909.ps1` @@ -202,13 +248,13 @@ Run `hv_centos81.ps1` ### Warnings - CentOS 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 +- 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 ### Vagrant support - CentOS 8 @@ -218,14 +264,14 @@ Experimental support for vagrant machines `hv_centos81_vagrant.ps1` ### 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 ./files/gen2-centos/provision.sh and ./files/gen2-centos/puppet.conf -* no `docker` repo will be added and no `docker-related` packages will be installed - this build creates and mount separated volume (size specified by variable) for 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 ./files/gen2-centos/provision.sh and ./files/gen2-centos/puppet.conf +- no `docker` repo will be added and no `docker-related` packages will be installed - this build creates and mount separated volume (size specified by variable) for docker ### Hyper-V Generation 2 CentOS 7.8 @@ -235,18 +281,18 @@ Run `hv_centos78_docker.ps1` Run `hv_centos78_docker.ps1` -### Hyper-V Generation 2 CentOS 7.7 +### Hyper-V Generation 2 CentOS 7.9 -Run `hv_centos77_docker.ps1` +Run `hv_centos79_docker.ps1` -### Hyper-V Generation 2 CentOS 7.7 Image with extra docker volume +### Hyper-V Generation 2 CentOS 7.9 Image with extra docker volume -Run `hv_centos77_docker.ps1` +Run `hv_centos79_docker.ps1` ### Vagrant support - CentOS 7.x Experimental support for vagrant machines `hv_centos78_vagrant.ps1` for CentOS 7.8 -Experimental support for vagrant machines `hv_centos77_vagrant.ps1` for CentOS 7.7 +Experimental support for vagrant machines `hv_centos79_vagrant.ps1` for CentOS 7.9 ## Known issues @@ -314,7 +360,7 @@ I wish. In short - Windows. These builds should be done with minimum effort (Hyp ## About -* Marcin Bojko - marcin(at)bojko.com.pl -* [https://marcinbojko.dev/](https://marcinbojko.dev/) +- Marcin Bojko - marcin(at)bojko.com.pl +- [https://marcinbojko.dev/](https://marcinbojko.dev/) Work based on [https://github.com/jacqinthebox/packer-templates.git](https://github.com/jacqinthebox/packer-templates.git) diff --git a/extra/scripts/phase-2.ps1 b/extra/scripts/phase-2.ps1 index 8b7e366..2c050bf 100755 --- a/extra/scripts/phase-2.ps1 +++ b/extra/scripts/phase-2.ps1 @@ -27,6 +27,7 @@ Write-Output "Phase 2 [START] - Start of Phase 2" $goterror=1 } choco feature enable -n allowEmptyChecksums + choco feature enable -name=usePackageExitCodes Write-Output "Phase 2 [INFO] - Chocolatey packagess installing, $packages_count to go" #safely install packages foreach ($package in $packages) { diff --git a/extra/scripts/phase-3.ps1 b/extra/scripts/phase-3.ps1 index 925403c..31ec8e4 100755 --- a/extra/scripts/phase-3.ps1 +++ b/extra/scripts/phase-3.ps1 @@ -4,7 +4,7 @@ param( [Parameter()] [ValidateNotNullOrEmpty()] - [string]$Version="5.5.21", + [string]$Version="5.5.22", [Parameter()] [ValidateNotNullOrEmpty()] [ValidateSet('true','false','$true','$false','0','1')] diff --git a/hv_centos77.ps1 b/hv_centos79.ps1 similarity index 92% rename from hv_centos77.ps1 rename to hv_centos79.ps1 index e45f222..add9c20 100644 --- a/hv_centos77.ps1 +++ b/hv_centos79.ps1 @@ -5,8 +5,8 @@ $startDTM = (Get-Date) # Variables $template_file="./templates/hv_centos7_g2.json" -$var_file="./variables/variables_centos77.json" -$machine="CentOS 7.7 1908" +$var_file="./variables/variables_centos79.json" +$machine="CentOS 7.9 2009" $packer_log=0 if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) { diff --git a/hv_centos77_docker.ps1 b/hv_centos79_docker.ps1 similarity index 91% rename from hv_centos77_docker.ps1 rename to hv_centos79_docker.ps1 index fea1f19..9912aa8 100644 --- a/hv_centos77_docker.ps1 +++ b/hv_centos79_docker.ps1 @@ -5,8 +5,8 @@ $startDTM = (Get-Date) # Variables $template_file="./templates/hv_centos7_g2_docker.json" -$var_file="./variables/variables_centos77.json" -$machine="CentOS 7.7 1908 Docker" +$var_file="./variables/variables_centos79.json" +$machine="CentOS 7.9 2009 Docker" $packer_log=0 if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) { diff --git a/hv_centos77_vagrant.ps1 b/hv_centos79_vagrant.ps1 similarity index 87% rename from hv_centos77_vagrant.ps1 rename to hv_centos79_vagrant.ps1 index 1563031..1a22f2d 100644 --- a/hv_centos77_vagrant.ps1 +++ b/hv_centos79_vagrant.ps1 @@ -5,8 +5,8 @@ $startDTM = (Get-Date) # Variables $template_file="./templates/hv_centos7_g2_vagrant.json" -$var_file="./variables/variables_centos77.json" -$machine="CentOS 7.7 1908 Vagrant" +$var_file="./variables/variables_centos79.json" +$machine="CentOS 7.9 2009 Vagrant" $packer_log=0 if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) { @@ -26,7 +26,7 @@ if ((Test-Path -Path "$template_file") -and (Test-Path -Path "$var_file")) { packer build --force -var-file="$var_file" "$template_file" if ($?) { Write-Output "Calculating checksums" - Get-FileHash -Algorithm SHA256 -Path "./vbox/packer-centos-77-g2.box"|Out-File "./vbox/packer-centos-77-g2.box.sha256" -Verbose + Get-FileHash -Algorithm SHA256 -Path "./vbox/packer-centos-79-g2.box"|Out-File "./vbox/packer-centos-79-g2.box.sha256" -Verbose } } catch { diff --git a/vagrant/hv_centos76_g2.template b/vagrant/hv_centos76_g2.template deleted file mode 100644 index 73759ef..0000000 --- a/vagrant/hv_centos76_g2.template +++ /dev/null @@ -1,27 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.require_version ">= 1.6.2" - -Vagrant.configure("2") do |config| - config.vm.define "vagrant-centos76" - config.vm.box = "centos76" - config.vm.communicator = "ssh" - config.vm.synced_folder ".", "/vagrant", type: "rsync", disabled: "true" - - # Admin user name and password - config.ssh.username = "vagrant" - config.ssh.password = "vagrant" - config.vm.guest = :redhat - -# config.vm.provider "hyperv" do |h| -# h.vm_integration_services = { -# guest_service_interface: true, -# heartbeat: true, -# key_value_pair_exchange: true, -# shutdown: true, -# time_synchronization: true, -# vss: boolean -# } -# end - end diff --git a/vagrant/hv_centos77_g2.template b/vagrant/hv_centos79_g2.template similarity index 90% rename from vagrant/hv_centos77_g2.template rename to vagrant/hv_centos79_g2.template index 5549efd..f532108 100644 --- a/vagrant/hv_centos77_g2.template +++ b/vagrant/hv_centos79_g2.template @@ -4,8 +4,8 @@ Vagrant.require_version ">= 1.6.2" Vagrant.configure("2") do |config| - config.vm.define "vagrant-centos77" - config.vm.box = "centos77" + config.vm.define "vagrant-centos79" + config.vm.box = "centos79" config.vm.communicator = "ssh" config.vm.synced_folder ".", "/vagrant", type: "rsync", disabled: "true" diff --git a/variables/variables_centos78.json b/variables/variables_centos78.json index 4ab8d43..5723a0d 100644 --- a/variables/variables_centos78.json +++ b/variables/variables_centos78.json @@ -11,6 +11,6 @@ "vlan_id": "", "vagrantfile_template": "./vagrant/hv_centos78_g2.template", "ssh_password": "password", - "provision_script_options": "", + "provision_script_options": "-u false", "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" } \ No newline at end of file diff --git a/variables/variables_centos77.json b/variables/variables_centos79.json similarity index 50% rename from variables/variables_centos77.json rename to variables/variables_centos79.json index 8980324..46bb60e 100644 --- a/variables/variables_centos77.json +++ b/variables/variables_centos79.json @@ -1,16 +1,16 @@ { - "iso_url": "http://ftp.ps.pl/pub/Linux/CentOS/7.7.1908/isos/x86_64/CentOS-7-x86_64-Everything-1908.iso", + "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": "bd5e6ca18386e8a8e0b5a9e906297b5610095e375e4d02342f07f32022b13acf", - "vm_name": "packer-centos77-g2", + "iso_checksum": "689531cce9cf484378481ae762fae362791a9be078fda10e4f6977bf8fa71350", + "vm_name": "packer-centos79-g2", "disk_size": "70000", "disk_additional_size":"150000", "switch_name": "vSwitch", - "output_directory": "output-centos77", - "output_vagrant": "./vbox/packer-centos-77-g2.box", + "output_directory": "output-centos79", + "output_vagrant": "./vbox/packer-centos-79-g2.box", "vlan_id": "", - "vagrantfile_template": "./vagrant/hv_centos77_g2.template", + "vagrantfile_template": "./vagrant/hv_centos79_g2.template", "ssh_password": "password", - "provision_script_options": "-u false", + "provision_script_options": "", "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" } \ No newline at end of file