Compare commits

..

No commits in common. 'master' and 'master' have entirely different histories.

@ -1,8 +0,0 @@
download_url: https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-posix-2.0.0.tar.gz
format_version: 1.0.0
name: posix
namespace: ansible
server: https://galaxy.ansible.com/api/
signatures: []
version: 2.0.0
version_url: /api/v3/plugin/ansible/content/published/collections/index/ansible/posix/versions/2.0.0/

@ -1,8 +0,0 @@
download_url: https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/community-general-10.2.0.tar.gz
format_version: 1.0.0
name: general
namespace: community
server: https://galaxy.ansible.com/api/
signatures: []
version: 10.2.0
version_url: /api/v3/plugin/ansible/content/published/collections/index/community/general/versions/10.2.0/

@ -6,7 +6,5 @@
roles:
- role: unified_boot
when: is_unified_boot is defined
- create_network_dir
- create_logind_conf
- gencloud_guest
- cleanup_vm

@ -1,6 +1,5 @@
---
collections:
- community.general
- ansible.posix
roles:
- name: ezamriy.vbox_guest

@ -1,6 +0,0 @@
---
- name: Create /etc/systemd/logind.conf file if it does not exist
file:
path: /etc/systemd/logind.conf
state: touch # Creates a new file or updates the timestamp if it exists.
mode: '0644'

@ -1,6 +0,0 @@
---
- name: Create /etc/sysconfig/network-scripts directory
file:
path: /etc/sysconfig/network-scripts
state: directory
mode: '0755'

@ -1,7 +1,6 @@
---
- name: Remove firewalld and linux-firmware
ansible.builtin.dnf:
# releasever: 10.0
name:
- firewalld
- firewalld-filesystem
@ -17,12 +16,12 @@
- name: Install additional software
ansible.builtin.dnf:
# releasever: 10.0
name:
- cockpit-system
- cockpit-ws
- dnf-utils
- gdisk
- nfs-utils
- rsync
- tar
- tuned

@ -1,6 +1,5 @@
---
- name: Install nfs-utils
ansible.builtin.dnf:
# releasever: 10.0
name: nfs-utils
state: present

@ -9,7 +9,6 @@ galaxy_info:
versions:
- '8'
- '9'
- '10'
galaxy_tags:
- qemu
- qemu-guest-agent

@ -1,6 +1,5 @@
---
- name: Install qemu-guest-agent
ansible.builtin.dnf:
# releasever: 10.0
name: qemu-guest-agent
state: present

@ -1,6 +1,5 @@
- name: Install cloud-init
ansible.builtin.dnf:
# releasever: 10.0
name:
- cloud-init
- cloud-utils-growpart

@ -1,7 +1,6 @@
---
- name: Upgrade packages
ansible.builtin.dnf:
# releasever: 10.0
name: '*'
state: latest
register: system_upgrade

@ -0,0 +1,4 @@
# vagrant_pubkey
An Ansible role that adds a Vagrant public SSH key to the `vagrant` user's
`~/.ssh/authorized_keys` file.

@ -1,2 +0,0 @@
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN1YdxBpNlzxDqfJyw/QKow1F+wvG9hXGoqiysfJOn5Y vagrant insecure public key

@ -1,8 +0,0 @@
---
galaxy_info:
author: AlmaLinux OS Cloud SIG
description: Configuration and optimizations for a Vagrant guest
company: AlmaLinux OS Foundation
# https://almalinux.org/p/the-almalinux-os-licensing-policy
license: GPL-3.0-only
min_ansible_version: "2.14"

@ -0,0 +1,15 @@
galaxy_info:
role_name: vagrant_pubkey
author: Eugene Zamriy
description: Adds Vagrant public SSH key
license: MIT
min_ansible_version: '2.5'
platforms:
- name: EL
versions:
- '8'
- '9'
galaxy_tags:
- vagrant
dependencies: []

@ -1,37 +0,0 @@
---
- name: Disable SSH reverse DNS lookup
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: "(.*UseDNS.*)"
line: "UseDNS no"
backrefs: true
state: present
create: false
- name: Install additional packages
ansible.builtin.dnf:
name:
- cifs-utils
- jq
- nfs-utils
- rsync
- tcpdump
- tuned
state: present
- name: Install Vagrant public SSH key
when: ansible_facts['distribution_major_version'] | int <= 9
ansible.posix.authorized_key:
user: vagrant
key: https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub
state: present
# Temporary workaround error on fetching a key from a URL on AlmaLinux OS Kitten 10
# Error output: Error getting key from
# See: https://github.com/ansible-collections/ansible.posix/blob/main/plugins/modules/authorized_key.py
- name: Install Vagrant public SSH key
when: ansible_facts['distribution_major_version'] == '10'
ansible.posix.authorized_key:
user: vagrant
key: "{{ lookup('ansible.builtin.file', 'vagrant.pub') }}"
state: present

@ -0,0 +1,16 @@
---
- name: Create /home/vagrant/.ssh directory
ansible.builtin.file:
path: /home/vagrant/.ssh
state: directory
owner: vagrant
group: vagrant
mode: 0o700
- name: Download Vagrant public SSH key
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub
dest: /home/vagrant/.ssh/authorized_keys
owner: vagrant
group: vagrant
mode: 0o600

@ -9,7 +9,6 @@ galaxy_info:
versions:
- '8'
- '9'
- '10'
galaxy_tags:
- guest
- system

@ -1,6 +1,5 @@
---
- name: Install open-vm-tools
ansible.builtin.dnf:
# releasever: 9.5
name: open-vm-tools
state: present

@ -1,7 +1,6 @@
---
- name: Remove firewalld and linux-firmware
ansible.builtin.dnf:
# releasever: 10.0
name:
- firewalld
- firewalld-filesystem
@ -17,12 +16,12 @@
- name: Install additional software
ansible.builtin.dnf:
# releasever: 10.0
name:
- cockpit-system
- cockpit-ws
- dnf-utils
- gdisk
- nfs-utils
- rsync
- tar
- tuned

@ -2,8 +2,6 @@
- name: MSVSphere Vagrant box
hosts: default
become: true
collections:
- almalinux.ci
roles:
- upgrade_and_reboot
@ -11,5 +9,6 @@
when: packer_provider == 'virtualbox-iso'
- role: vmware_guest
when: packer_provider == 'vmware-iso'
- nfs_client
- vagrant_pubkey
- cleanup_vm

@ -6,7 +6,5 @@
roles:
- role: unified_boot
when: is_unified_boot is defined
- create_network_dir
- create_logind_conf
- yandexcloud_guest
- cleanup_vm

@ -7,8 +7,7 @@ SOURCE=''
NO_PAKER_INIT=''
NO_PKG_INSTALL=''
# Use $PATH to find packer
PACKER='packer'
PACKER='/usr/local/bin/packer'
# ------------------------------------------------------------------------------
Usage()
@ -60,10 +59,18 @@ CheckSource "$SOURCE" || { echo "Unknown source: $SOURCE"; exit 1; }
if [ -z "$NO_PKG_INSTALL" ]; then
if which dnf &>/dev/null; then
sudo dnf install edk2-ovmf libvirt libvirt-daemon-kvm ansible-core libnsl
sudo dnf install edk2-ovmf libvirt libvirt-daemon-kvm ansible-core
fi
fi
[ -z "$NO_PAKER_INIT" ] && $PACKER init -upgrade . || exit 1
PACKER_LOG=1 $PACKER build -only=$SOURCE . 2>$PACKER_LOG_FILE || exit 1
if [ "$SOURCE" = "vmware-iso.msvsphere-9-ovf-x86_64" ]; then
OUT_DIR='./vmware-iso.msvsphere-9-ovf-x86_64_ovf'
rm -rf $OUT_DIR
mkdir $OUT_DIR
/usr/lib/vmware-ovftool/ovftool --machineOutput --X:logFile=./ovftool.log --X:logLevel=verbose --exportFlags=extraconfig --allowExtraConfig --X:vCloudEnableGuestCustomization ./output-msvsphere-9-ovf-x86_64/msvsphere-9.4.vmx $OUT_DIR || exit 1
fi

@ -1,77 +0,0 @@
# MSVSphere 10 Generic Cloud image kickstart file
url --url https://rsync.inferitos.ru/msvsphere/10.0-beta/BaseOS/x86_64/kickstart/
repo --name=BaseOS --baseurl=https://rsync.inferitos.ru/msvsphere/10.0-beta/BaseOS/x86_64/os/
repo --name=AppStream --baseurl=https://rsync.inferitos.ru/msvsphere/10.0-beta/AppStream/x86_64/os/
text
skipx
eula --agreed
firstboot --disabled
lang C.UTF-8
keyboard us
timezone UTC --utc
network --bootproto=dhcp
firewall --enabled --service=ssh
services --disabled="kdump" --enabled="chronyd,rsyslog,sshd"
selinux --enforcing
bootloader --timeout=1 --location=mbr --append="console=tty0 console=ttyS0,115200n8 no_timer_check crashkernel=auto net.ifnames=0"
%pre --erroronfail
parted -s -a optimal /dev/sda -- mklabel gpt
parted -s -a optimal /dev/sda -- mkpart biosboot 1MiB 2MiB set 1 bios_grub on
parted -s -a optimal /dev/sda -- mkpart '"EFI System Partition"' fat32 2MiB 202MiB set 2 esp on
parted -s -a optimal /dev/sda -- mkpart boot xfs 202MiB 714MiB
parted -s -a optimal /dev/sda -- mkpart root xfs 714MiB 100%
%end
part biosboot --fstype=biosboot --onpart=sda1
part /boot/efi --fstype=efi --onpart=sda2
part /boot --fstype=xfs --onpart=sda3
part / --fstype=xfs --onpart=sda4
rootpw --plaintext msvsphere
reboot --eject
%packages --inst-langs=en
@core
dracut-config-generic
grub2-pc
usermode
-biosdevname
-dnf-plugin-spacewalk
-dracut-config-rescue
-iprutils
-iwl*-firmware
-langpacks-*
-mdadm
-open-vm-tools
-plymouth
-rhn*
-nfs-utils
-rpcbind
sphere-release-identity-server
sphere-release-server
sphere-release
%end
# disable kdump service
%addon com_redhat_kdump --disable
%end
%post --erroronfail
grub2-install --target=i386-pc /dev/sda
# permit root login via SSH with password authetication
echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/01-permitrootlogin.conf
%end

@ -1,65 +0,0 @@
# MSVSphere 10 OVF kickstart file
# TODO: change url to the kickstart one when we have it
url --url https://rsync.inferitos.ru/msvsphere/10.0-beta/BaseOS/x86_64/kickstart/
repo --name=BaseOS --baseurl=https://rsync.inferitos.ru/msvsphere/10.0-beta/BaseOS/x86_64/os/
repo --name=AppStream --baseurl=https://rsync.inferitos.ru/msvsphere/10.0-beta/AppStream/x86_64/os/
text
skipx
eula --agreed
firstboot --disabled
lang C.UTF-8
keyboard us
timezone UTC --utc
network --bootproto=dhcp
firewall --enabled --service=ssh
services --disabled="kdump" --enabled="chronyd,rsyslog,sshd"
selinux --enforcing
bootloader --location=mbr
zerombr
clearpart --all --initlabel
autopart --type=plain --nohome --noboot --noswap
rootpw --plaintext msvsphere
reboot --eject
%packages --inst-langs=en
@core
bzip2
dracut-config-generic
tar
usermode
-biosdevname
-dnf-plugin-spacewalk
-dracut-config-rescue
-iprutils
-iwl*-firmware
-langpacks-*
-mdadm
-open-vm-tools
-plymouth
-rhn*
sphere-release-identity-server
sphere-release-server
sphere-release
perl
%end
# disable kdump service
%addon com_redhat_kdump --disable
%end
%post
yum clean all
# permit root login via SSH with password authentication
echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/01-permitrootlogin.conf
%end

@ -1,71 +0,0 @@
# MSVSphere 10 Vagrant boxes kickstart file
url --url https://rsync.inferitos.ru/msvsphere/10.0-beta/BaseOS/x86_64/kickstart/
repo --name=BaseOS --baseurl=https://rsync.inferitos.ru/msvsphere/10.0-beta/BaseOS/x86_64/os/
repo --name=AppStream --baseurl=https://rsync.inferitos.ru/msvsphere/10.0-beta/AppStream/x86_64/os/
text
skipx
eula --agreed
firstboot --disabled
lang C.UTF-8
keyboard us
timezone UTC --utc
network --bootproto=dhcp
firewall --disabled
services --enabled=sshd
selinux --enforcing
bootloader --location=mbr
zerombr
clearpart --all --initlabel
autopart --type=plain --nohome --noboot --noswap
rootpw vagrant
user --name=vagrant --plaintext --password vagrant
reboot --eject
%packages --inst-langs=en
@core
bzip2
dracut-config-generic
tar
usermode
-biosdevname
-dnf-plugin-spacewalk
-dracut-config-rescue
-iprutils
-iwl*-firmware
-langpacks-*
-mdadm
-open-vm-tools
-plymouth
-rhn*
sphere-release-identity-server
sphere-release-server
sphere-release
%end
# disable kdump service
%addon com_redhat_kdump --disable
%end
%post
# allow passwordless sudo for the vagrant user
echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant
# see Vagrant documentation (https://docs.vagrantup.com/v2/boxes/base.html)
# for details about the requiretty.
sed -i "s/^.*requiretty/# Defaults requiretty/" /etc/sudoers
yum clean all
# permit root login via SSH with password authentication
echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/01-permitrootlogin.conf
%end

@ -25,8 +25,8 @@ bootloader --timeout=1 --location=mbr --append="console=tty0 console=ttyS0,11520
parted -s -a optimal /dev/sda -- mklabel gpt
parted -s -a optimal /dev/sda -- mkpart biosboot 1MiB 2MiB set 1 bios_grub on
parted -s -a optimal /dev/sda -- mkpart '"EFI System Partition"' fat32 2MiB 202MiB set 2 esp on
parted -s -a optimal /dev/sda -- mkpart boot xfs 202MiB 1226MiB
parted -s -a optimal /dev/sda -- mkpart root xfs 1226MiB 100%
parted -s -a optimal /dev/sda -- mkpart boot xfs 202MiB 714MiB
parted -s -a optimal /dev/sda -- mkpart root xfs 714MiB 100%
%end
@ -55,8 +55,6 @@ usermode
-open-vm-tools
-plymouth
-rhn*
-nfs-utils
-rpcbind
sphere-release-identity-server
sphere-release-server
sphere-release

@ -1,9 +1,9 @@
# MSVSphere 9 OVF kickstart file
# TODO: change url to the kickstart one when we have it
url --url https://repo1.msvsphere-os.ru/msvsphere/9/BaseOS/x86_64/kickstart/
repo --name=BaseOS --baseurl=https://repo1.msvsphere-os.ru/msvsphere/9/BaseOS/x86_64/os/
repo --name=AppStream --baseurl=https://repo1.msvsphere-os.ru/msvsphere/9/AppStream/x86_64/os/
url --url https://rsync.inferitos.ru/msvsphere/9/BaseOS/x86_64/kickstart/
repo --name=BaseOS --baseurl=https://rsync.inferitos.ru/msvsphere/9/BaseOS/x86_64/kickstart/
repo --name=AppStream --baseurl=https://rsync.inferitos.ru/msvsphere/9/AppStream/x86_64/kickstart/
text
skipx

@ -1,58 +0,0 @@
/**
* Packer template for building MSVSphere 10 Generic Cloud images.
*/
source "qemu" "msvsphere-10-gencloud-x86_64" {
iso_url = var.iso_url_10_x86_64
iso_checksum = var.iso_checksum_10_x86_64
boot_command = var.gencloud_boot_cmd_10_x86_64_uefi
boot_wait = var.boot_wait
cpus = var.cpus
memory = var.memory
disk_size = var.gencloud_disk_size
headless = var.headless
http_directory = var.http_directory
shutdown_command = var.root_shutdown_command
ssh_username = var.gencloud_ssh_username
ssh_password = var.gencloud_ssh_password
ssh_timeout = var.ssh_timeout
vnc_bind_address = var.vnc_bind_address
vnc_port_min = var.vnc_port_min
vnc_port_max = var.vnc_port_max
accelerator = "kvm"
efi_firmware_code = var.uefi_ovmf_code
efi_firmware_vars = var.uefi_ovmf_vars
disk_interface = "virtio-scsi"
disk_cache = "unsafe"
disk_discard = "unmap"
disk_detect_zeroes = "unmap"
disk_compression = true
format = "qcow2"
machine_type = "q35"
net_device = "virtio-net"
qemu_binary = var.qemu_binary
vm_name = "MSVSphere-${var.os_version_10}-${formatdate("YYYYMMDD", timestamp())}.gencloud.x86_64.qcow2"
qemuargs = [
["-cpu", "host"]
]
}
build {
sources = [
"qemu.msvsphere-10-gencloud-x86_64"
]
provisioner "ansible" {
playbook_file = "ansible/gencloud.yml"
galaxy_file = "ansible/requirements.yml"
roles_path = "ansible/roles"
collections_path = "ansible/collections"
ansible_env_vars = [
"ANSIBLE_PIPELINING=True",
"ANSIBLE_REMOTE_TEMP=/tmp",
"ANSIBLE_SSH_ARGS='-o ControlMaster=no -o ControlPersist=180s -o ServerAliveInterval=120s -o TCPKeepAlive=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa'"
]
extra_arguments = ["--scp-extra-args", "'-O'"]
}
}

@ -1,60 +0,0 @@
/**
* Packer template for building MSVSphere 10 ovf image.
*/
source "vmware-iso" "msvsphere-10-ovf-x86_64" {
iso_url = var.iso_url_10_x86_64
iso_checksum = var.iso_checksum_10_x86_64
http_directory = var.http_directory
shutdown_command = var.vagrant_shutdown_command
ssh_username = var.vagrant_ssh_username
ssh_password = var.vagrant_ssh_password
ssh_timeout = var.ssh_timeout
boot_command = var.vagrant_boot_cmd_10_x86_64_bios
boot_wait = var.boot_wait
disk_size = var.vagrant_disk_size
guest_os_type = "centos-64"
version = 21
vm_name = "MSVSphere-${var.os_version_10}-${formatdate("YYYYMMDD", timestamp())}.ovf.x86_64"
cpus = var.cpus
memory = var.memory
network_adapter_type = "vmxnet3"
headless = var.headless
vmx_remove_ethernet_interfaces = true
vmx_data = {
"cpuid.coresPerSocket" : "1"
}
vmx_data_post = {
"memsize" : var.post_memory
"numvcpus" : var.post_cpus
}
}
build {
sources = [
"sources.vmware-iso.msvsphere-10-ovf-x86_64"
]
provisioner "ansible" {
playbook_file = "ansible/ovf.yml"
galaxy_file = "ansible/requirements.yml"
roles_path = "ansible/roles"
collections_path = "ansible/collections"
ansible_env_vars = [
"ANSIBLE_PIPELINING=True",
"ANSIBLE_REMOTE_TEMP=/tmp",
"ANSIBLE_SSH_ARGS='-o ControlMaster=no -o ControlPersist=180s -o ServerAliveInterval=120s -o TCPKeepAlive=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa'"
]
extra_arguments = [
"--extra-vars",
"packer_provider=${source.type}"
]
}
post-processor "shell-local"{
inline = ["rm -rf vmware-iso.msvsphere-10-ovf-x86_64_ovf",
"mkdir vmware-iso.msvsphere-10-ovf-x86_64_ovf",
"/usr/lib/vmware-ovftool/ovftool --machineOutput --X:logFile=./ovftool.log --X:logLevel=verbose --exportFlags=extraconfig --allowExtraConfig --X:vCloudEnableGuestCustomization ./output-msvsphere-10-ovf-x86_64/MSVSphere-${var.os_version_10}-${formatdate("YYYYMMDD", timestamp())}.ovf.x86_64.vmx ./vmware-iso.msvsphere-10-ovf-x86_64_ovf"
]
}
}

@ -1,89 +0,0 @@
/**
* Packer template for building MSVSphere 10 Vagrant boxes.
*/
source "virtualbox-iso" "msvsphere-10-vagrant-x86_64" {
firmware = "efi"
iso_url = var.iso_url_10_x86_64
iso_checksum = var.iso_checksum_10_x86_64
boot_command = var.vagrant_boot_cmd_10_x86_64_bios
boot_wait = var.boot_wait
cpus = var.cpus
memory = var.memory
disk_size = var.vagrant_disk_size
headless = var.headless
http_directory = var.http_directory
guest_os_type = "RedHat_64"
shutdown_command = var.vagrant_shutdown_command
ssh_username = var.vagrant_ssh_username
ssh_password = var.vagrant_ssh_password
ssh_timeout = var.ssh_timeout
hard_drive_interface = "sata"
iso_interface = "sata"
vboxmanage = [
["modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"],
]
vboxmanage_post = [
["modifyvm", "{{.Name}}", "--memory", var.post_memory],
["modifyvm", "{{.Name}}", "--cpus", var.post_cpus]
]
}
source "vmware-iso" "msvsphere-10-vagrant-x86_64" {
iso_url = var.iso_url_10_x86_64
iso_checksum = var.iso_checksum_10_x86_64
http_directory = var.http_directory
shutdown_command = var.vagrant_shutdown_command
ssh_username = var.vagrant_ssh_username
ssh_password = var.vagrant_ssh_password
ssh_timeout = var.ssh_timeout
boot_command = var.vagrant_boot_cmd_10_x86_64_bios
boot_wait = var.boot_wait
disk_size = var.vagrant_disk_size
guest_os_type = "centos-64"
version = 21
vm_name = "MSVSphere-Vagrant-VMware-10-${formatdate("YYYYMMDD", timestamp())}.x86_64"
cpus = var.cpus
memory = var.memory
network_adapter_type = "vmxnet3"
headless = var.headless
vmx_remove_ethernet_interfaces = true
vmx_data = {
"cpuid.coresPerSocket" : "1"
}
vmx_data_post = {
"memsize" : var.post_memory
"numvcpus" : var.post_cpus
}
}
build {
sources = [
"sources.virtualbox-iso.msvsphere-10-vagrant-x86_64",
"sources.vmware-iso.msvsphere-10-vagrant-x86_64"
]
provisioner "ansible" {
playbook_file = "ansible/vagrant.yml"
galaxy_file = "ansible/requirements.yml"
roles_path = "ansible/roles"
collections_path = "ansible/collections"
ansible_env_vars = [
"ANSIBLE_PIPELINING=True",
"ANSIBLE_REMOTE_TEMP=/tmp",
"ANSIBLE_SCP_EXTRA_ARGS=-O"
]
extra_arguments = [
"--extra-vars",
"packer_provider=${source.type}"
]
}
post-processors {
post-processor "vagrant" {
compression_level = "9"
output = "MSVSphere-10-${formatdate("YYYYMMDD", timestamp())}.{{.Provider}}.x86_64.box"
}
}
}

@ -1,58 +0,0 @@
/**
* Packer template for building MSVSphere 10 Yandex Cloud images.
*/
source "qemu" "msvsphere-10-yandexcloud-x86_64" {
iso_url = var.iso_url_10_x86_64
iso_checksum = var.iso_checksum_10_x86_64
boot_command = var.gencloud_boot_cmd_10_x86_64_uefi
boot_wait = var.boot_wait
cpus = var.cpus
memory = var.memory
disk_size = var.gencloud_disk_size
headless = var.headless
http_directory = var.http_directory
shutdown_command = var.root_shutdown_command
ssh_username = var.gencloud_ssh_username
ssh_password = var.gencloud_ssh_password
ssh_timeout = var.ssh_timeout
vnc_bind_address = var.vnc_bind_address
vnc_port_min = var.vnc_port_min
vnc_port_max = var.vnc_port_max
accelerator = "kvm"
efi_firmware_code = var.uefi_ovmf_code
efi_firmware_vars = var.uefi_ovmf_vars
disk_interface = "virtio-scsi"
disk_cache = "unsafe"
disk_discard = "unmap"
disk_detect_zeroes = "unmap"
disk_compression = true
format = "qcow2"
machine_type = "q35"
net_device = "virtio-net"
qemu_binary = var.qemu_binary
vm_name = "MSVSphere-${var.os_version_10}-${formatdate("YYYYMMDD", timestamp())}.yandexcloud.x86_64.qcow2"
qemuargs = [
["-cpu", "host"]
]
}
build {
sources = [
"qemu.msvsphere-10-yandexcloud-x86_64"
]
provisioner "ansible" {
playbook_file = "ansible/yandexcloud.yml"
galaxy_file = "ansible/requirements.yml"
roles_path = "ansible/roles"
collections_path = "ansible/collections"
ansible_env_vars = [
"ANSIBLE_PIPELINING=True",
"ANSIBLE_REMOTE_TEMP=/tmp",
"ANSIBLE_SSH_ARGS='-o ControlMaster=no -o ControlPersist=180s -o ServerAliveInterval=120s -o TCPKeepAlive=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa'"
]
extra_arguments = ["--scp-extra-args", "'-O'"]
}
}

@ -3,7 +3,7 @@
*/
source "vmware-iso" "msvsphere-9-ovf-x86_64" {
vm_name = "MSVSphere-${var.os_version_9}-${formatdate("YYYYMMDD", timestamp())}.ovf.x86_64"
vm_name = "msvsphere-9.4"
iso_url = var.iso_url_9_x86_64
iso_checksum = var.iso_checksum_9_x86_64
boot_command = var.ovf_boot_cmd_9_x86_64_bios
@ -49,11 +49,4 @@ build {
"packer_provider=${source.type}"
]
}
post-processor "shell-local"{
inline = ["rm -rf vmware-iso.msvsphere-9-ovf-x86_64_ovf",
"mkdir vmware-iso.msvsphere-9-ovf-x86_64_ovf",
"/usr/lib/vmware-ovftool/ovftool --machineOutput --X:logFile=./ovftool.log --X:logLevel=verbose --exportFlags=extraconfig --allowExtraConfig --X:vCloudEnableGuestCustomization ./output-msvsphere-9-ovf-x86_64/MSVSphere-${var.os_version_9}-${formatdate("YYYYMMDD", timestamp())}.ovf.x86_64.vmx ./vmware-iso.msvsphere-9-ovf-x86_64_ovf"
]
}
}

@ -2,16 +2,10 @@
* MSVSphere Packer template variables.
*/
variable "os_version_10" {
description = "The target MSVSphere 10 version"
type = string
default = "10.0"
}
variable "os_version_9" {
description = "The target MSVSphere 9 version"
type = string
default = "9.5"
default = "9.4"
}
variable "os_version_8" {
@ -21,16 +15,10 @@ variable "os_version_8" {
}
// TODO: switch to the boot ISO on production
variable "iso_url_10_x86_64" {
description = "MSVSphere 10 x86_64 installation ISO URL"
type = string
default = "https://rsync.inferitos.ru/msvsphere/10.0-beta/isos/x86_64/MSVSphere-10.0-beta-x86_64-netinstall.iso"
}
variable "iso_url_9_x86_64" {
description = "MSVSphere 9 x86_64 installation ISO URL"
type = string
default = "https://repo1.msvsphere-os.ru/msvsphere/9/isos/x86_64/MSVSphere-9.5-x86_64-netinstall.iso"
default = "https://repo1.msvsphere-os.ru/msvsphere/9/isos/x86_64/MSVSphere-9.4-x86_64-netinstall.iso"
}
variable "iso_url_8_x86_64" {
@ -39,16 +27,10 @@ variable "iso_url_8_x86_64" {
default = "https://rsync.inferitos.ru/msvsphere/8/isos/x86_64/MSVSphere-8.10-x86_64-netinstall.iso"
}
variable "iso_checksum_10_x86_64" {
description = "MSVSphere 10 x86_64 installation ISO checksum"
type = string
default = "file:https://rsync.inferitos.ru/msvsphere/10.0-beta/isos/x86_64/MSVSphere-10.0-beta-x86_64-netinstall.iso.CHECKSUM"
}
variable "iso_checksum_9_x86_64" {
description = "MSVSphere 9 x86_64 installation ISO checksum"
type = string
default = "file:https://repo1.msvsphere-os.ru/msvsphere/9/isos/x86_64/MSVSphere-9.5-x86_64-netinstall.iso.CHECKSUM"
default = "file:https://repo1.msvsphere-os.ru/msvsphere/9/isos/x86_64/MSVSphere-9.4-x86_64-netinstall.iso.CHECKSUM"
}
variable "iso_checksum_8_x86_64" {
@ -57,13 +39,6 @@ variable "iso_checksum_8_x86_64" {
default = "file:https://rsync.inferitos.ru/msvsphere/8/isos/x86_64/MSVSphere-8.10-x86_64-netinstall.iso.CHECKSUM"
}
variable "build_number" {
description = "Build number identifier of an image version"
type = number
default = 0
}
variable "headless" {
description = "Start the VM without a GUI console if true"
type = bool
@ -148,25 +123,6 @@ variable "vagrant_disk_size" {
default = 20000
}
variable "vagrant_boot_cmd_10_x86_64_bios" {
description = "The boot command for x86_64 VMs in a BIOS mode"
type = list(string)
default = [
"e",
"<down><down>",
"<leftCtrlOn>e<leftCtrlOff>",
"<spacebar>",
"biosdevname=0",
"<spacebar>",
"net.ifnames=0",
"<spacebar>",
"inst.text inst.lang=en_US.UTF-8",
"<spacebar>",
"inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/msvsphere-10-vagrant.x86_64.ks",
"<leftCtrlOn>x<leftCtrlOff>",
]
}
variable "vagrant_boot_cmd_9_x86_64_bios" {
description = "The boot command for x86_64 VMs in a BIOS mode"
type = list(string)
@ -229,24 +185,7 @@ variable "vnc_port_max" {
variable "gencloud_disk_size" {
description = "The VM disk size"
type = string
default = "12G"
}
variable "gencloud_boot_cmd_10_x86_64_uefi" {
description = "The boot command for x86_64 VMs in UEFI mode"
type = list(string)
default = [
"c<wait>",
"linuxefi",
" /images/pxeboot/vmlinuz",
" inst.stage2=hd:LABEL=MSVSphere-10-0-BaseOS-x86_64 ro",
" inst.text biosdevname=0 net.ifnames=0",
" inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/msvsphere-10-gencloud.x86_64.ks",
"<enter>",
"initrdefi /images/pxeboot/initrd.img",
"<enter>",
"boot<enter><wait>"
]
default = "10G"
}
variable "gencloud_boot_cmd_9_x86_64_uefi" {
@ -256,7 +195,7 @@ variable "gencloud_boot_cmd_9_x86_64_uefi" {
"c<wait>",
"linuxefi",
" /images/pxeboot/vmlinuz",
" inst.stage2=hd:LABEL=MSVSphere-9-5-BaseOS-x86_64 ro",
" inst.stage2=hd:LABEL=MSVSphere-9-4-BaseOS-x86_64 ro",
" inst.text biosdevname=0 net.ifnames=0",
" inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/msvsphere-9-gencloud.x86_64.ks",
"<enter>",
@ -305,25 +244,6 @@ variable "vmware_disk_size" {
default = 20000
}
variable "ovf_boot_cmd_10_x86_64_bios" {
description = "The boot command for x86_64 VMs in a BIOS mode"
type = list(string)
default = [
"e",
"<down><down>",
"<leftCtrlOn>e<leftCtrlOff>",
"<spacebar>",
"biosdevname=0",
"<spacebar>",
"net.ifnames=0",
"<spacebar>",
"inst.text",
"<spacebar>",
"inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/msvsphere-10-ovf.x86_64.ks",
"<leftCtrlOn>x<leftCtrlOff>",
]
}
variable "ovf_boot_cmd_9_x86_64_bios" {
description = "The boot command for x86_64 VMs in a BIOS mode"
type = list(string)

Loading…
Cancel
Save