From 12c2988edcc9d2b00a4f5a1f888205d0b7cfb1ce Mon Sep 17 00:00:00 2001 From: linhuali Date: Thu, 9 Nov 2023 11:03:50 +0000 Subject: [PATCH 1/4] Add initial autoinstall support for FusionOS Signed-off-by: linhuali --- autoinstall/FusionOS/server_with_GUI/ks.cfg | 96 +++++++++++++++++++ .../FusionOS/server_without_GUI/ks.cfg | 91 ++++++++++++++++++ linux/deploy_vm/deploy_vm_from_iso.yml | 3 +- .../check_secureboot_support_status.yml | 2 +- 4 files changed, 190 insertions(+), 2 deletions(-) create mode 100644 autoinstall/FusionOS/server_with_GUI/ks.cfg create mode 100644 autoinstall/FusionOS/server_without_GUI/ks.cfg diff --git a/autoinstall/FusionOS/server_with_GUI/ks.cfg b/autoinstall/FusionOS/server_with_GUI/ks.cfg new file mode 100644 index 000000000..9baf0c18b --- /dev/null +++ b/autoinstall/FusionOS/server_with_GUI/ks.cfg @@ -0,0 +1,96 @@ +#version=DEVEL +# Use graphical install +graphical + +%packages +@^graphical-server-environment +kexec-tools +cloud-init +java-1.8.0-openjdk-headless +java-1.8.0-openjdk +ndctl +iproute +rdma-core +librdmacm-utils +libibverbs +libibverbs-utils +infiniband-diags +perftest +%end + +# Keyboard layouts +keyboard --xlayouts='us' +# System language +lang en_US.UTF-8 + +# Network information +network --bootproto=dhcp --onboot=yes --ipv6=auto --activate +network --hostname=localhost.localdomain + +# Use CDROM installation media +cdrom +# SELinux configuration +selinux --disabled + +# X Window System configuration information +xconfig --startxonboot +# Do not run the Setup Agent on first boot +firstboot --disable +# System services +services --enabled="chronyd" +services --disabled="firewalld" + +ignoredisk --only-use={{ boot_disk_name }} +autopart +# Partition clearing information +clearpart --none --initlabel + +# System timezone +timezone Asia/Shanghai --utc + +# Shutdown when the install is finished. +shutdown + +# Root password +rootpw --iscrypted {{ vm_password_hash }} +# Add SSH key +sshkey --username=root "{{ ssh_public_key }}" + +{% if new_user is defined and new_user != 'root' %} +user --name={{ new_user }} --password={{ vm_password_hash }} --groups=root,wheel --iscrypted --gecos="{{ new_user }}" +sshkey --username={{ new_user }} "{{ ssh_public_key }}" +{% endif %} + +%addon com_redhat_kdump --disable --reserve-mb='128' + +%end + +%anaconda +pwpolicy root --minlen=8 --minquality=1 --strict --nochanges --notempty +pwpolicy user --minlen=8 --minquality=1 --strict --nochanges --emptyok +pwpolicy luks --minlen=8 --minquality=1 --strict --nochanges --notempty +%end + +%post --interpreter=/usr/bin/bash --log=/root/ks-post.log +if [ -f /etc/cloud/cloud.cfg ]; then + sed -i 's/^disable_root:.*/disable_root: false/' /etc/cloud/cloud.cfg + sed -i 's/^ssh_pwauth:.*/ssh_pwauth: yes/' /etc/cloud/cloud.cfg +fi + +# Permit root login via SSH +sed -i 's/^PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config + +# Workaround for setting guest_os_family as RHEL +if [ -f /etc/FusionOS-release ] && [ ! -f /etc/redhat-release ]; then + ln -s /etc/FusionOS-release /etc/redhat-release +fi + +{% if new_user is defined and new_user != 'root' %} +# Add new user to sudoer +echo '{{ new_user }} ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/{{ new_user }} +# Enable autologin +sed -i '/\[daemon\]/a AutomaticLogin={{ new_user }}' /etc/gdm/custom.conf +sed -i '/\[daemon\]/a AutomaticLoginEnable=True' /etc/gdm/custom.conf +{% endif %} +echo '{{ autoinstall_complete_msg }}' >/dev/ttyS0 +%end diff --git a/autoinstall/FusionOS/server_without_GUI/ks.cfg b/autoinstall/FusionOS/server_without_GUI/ks.cfg new file mode 100644 index 000000000..9465dce06 --- /dev/null +++ b/autoinstall/FusionOS/server_without_GUI/ks.cfg @@ -0,0 +1,91 @@ +#version=DEVEL +# Use graphical install +graphical + +%packages +@^server-product-environment +kexec-tools +#open-vm-tools-desktop +cloud-init +java-1.8.0-openjdk-headless +java-1.8.0-openjdk +ndctl +iproute +rdma-core +librdmacm-utils +libibverbs +libibverbs-utils +infiniband-diags +perftest +%end + +# Keyboard layouts +keyboard --xlayouts='us' +# System language +lang en_US.UTF-8 + +# Network information +network --bootproto=dhcp --ipv6=auto --activate +network --hostname=localhost.localdomain + +# Use CDROM installation media +cdrom +# SELinux configuration +selinux --disabled + +# X Window System configuration information +xconfig --startxonboot +# Do not run the Setup Agent on first boot +firstboot --disable +# System services +services --enabled="chronyd" +services --disabled="firewalld" + +ignoredisk --only-use={{ boot_disk_name }} +autopart +# Partition clearing information +clearpart --none --initlabel + +# System timezone +timezone Asia/Shanghai --utc + +# Shutdown when the install is finished. +shutdown + +# Root password +rootpw --iscrypted {{ vm_password_hash }} +# Add SSH key +sshkey --username=root "{{ ssh_public_key }}" + +{% if new_user is defined and new_user != 'root' %} +user --name={{ new_user }} --password={{ vm_password_hash }} --groups=root,wheel --iscrypted --gecos="{{ new_user }}" +sshkey --username={{ new_user }} "{{ ssh_public_key }}" +{% endif %} + +%addon com_redhat_kdump --disable --reserve-mb='128' + +%end + +%post --interpreter=/usr/bin/bash --log=/root/ks-post.log +if [ -f /etc/cloud/cloud.cfg ]; then + sed -i 's/^disable_root:.*/disable_root: false/' /etc/cloud/cloud.cfg + sed -i 's/^ssh_pwauth:.*/ssh_pwauth: yes/' /etc/cloud/cloud.cfg +fi + +# Permit root login via SSH +sed -i 's/^PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config + +# Workaround for setting guest_os_family as RHEL +if [ -f /etc/FusionOS-release ] && [ ! -f /etc/redhat-release ]; then + ln -s /etc/FusionOS-release /etc/redhat-release +fi + +{% if new_user is defined and new_user != 'root' %} +# Add new user to sudoer +echo '{{ new_user }} ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/{{ new_user }} +# Enable autologin +sed -i '/\[daemon\]/a AutomaticLogin={{ new_user }}' /etc/gdm/custom.conf +sed -i '/\[daemon\]/a AutomaticLoginEnable=True' /etc/gdm/custom.conf +{% endif %} +echo '{{ autoinstall_complete_msg }}' >/dev/ttyS0 +%end diff --git a/linux/deploy_vm/deploy_vm_from_iso.yml b/linux/deploy_vm/deploy_vm_from_iso.yml index 5793b8290..a7b9fd28b 100644 --- a/linux/deploy_vm/deploy_vm_from_iso.yml +++ b/linux/deploy_vm/deploy_vm_from_iso.yml @@ -171,6 +171,7 @@ - (('RHEL' in unattend_install_conf) or ('CentOS' in unattend_install_conf) or ('Fedora' in unattend_install_conf) or + ('FusionOS' in unattend_install_conf) or ('BCLinux' in unattend_install_conf)) # For UnionTech OS, send key to boot screen @@ -249,7 +250,7 @@ vm_get_fullname_timeout: 600 when: - unattend_install_conf is defined - - unattend_install_conf | lower is not match('.*(minimal|server_without_gui|bclinux-for-euler).*') + - unattend_install_conf | lower is not match('.*(minimal|server_without_gui|bclinux-for-euler|fusionos).*') - name: "Get VM guest IPv4 address and add to in-memory inventory" include_tasks: ../../common/update_inventory.yml diff --git a/linux/secureboot_enable_disable/check_secureboot_support_status.yml b/linux/secureboot_enable_disable/check_secureboot_support_status.yml index c91e323b6..d883ee55d 100644 --- a/linux/secureboot_enable_disable/check_secureboot_support_status.yml +++ b/linux/secureboot_enable_disable/check_secureboot_support_status.yml @@ -24,7 +24,7 @@ (guest_os_ansible_distribution == "Rocky" and guest_os_ansible_distribution_ver is version('8.4', '<=')) or guest_os_ansible_distribution is match('Pardus.*') or - (guest_os_ansible_distribution in ["Astra Linux (Orel)", "ProLinux", "UnionTech", "Uos", "FreeBSD", "BigCloud"]) + (guest_os_ansible_distribution in ["Astra Linux (Orel)", "ProLinux", "UnionTech", "Uos", "FreeBSD", "BigCloud", "FusionOS"]) - name: "Skip test case for OS version which has vulnerable bootloaders" block: From 6676a5f2b4a46b9faf805c818c37dba0900776bd Mon Sep 17 00:00:00 2001 From: linhuali Date: Tue, 14 Nov 2023 11:34:44 +0000 Subject: [PATCH 2/4] update README.md for FusionOS Signed-off-by: linhuali --- README.md | 55 ++++++++++++++++++++++--------------------- autoinstall/README.md | 1 + 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 5b9420054..b4f6ddc85 100644 --- a/README.md +++ b/README.md @@ -65,33 +65,34 @@ This project supports below scenarios for end-to-end guest operating system vali ### Compatible Guest Operating Systems -| Guest Operating Systems | Automatic Install from ISO Image | Deploy from OVA Template | Existing VM with Guest Operating System Installed | -|:----------------------------------------------| :------------------------------: | :----------------------: | :--------------------------------: | -| Red Hat Enterprise Linux 7.x, 8.x, 9.x | :heavy_check_mark: | | :heavy_check_mark: | -| CentOS 7.x, 8.x | :heavy_check_mark: | | :heavy_check_mark: | -| Oracle Linux 7.x, 8.x, 9.x | :heavy_check_mark: | | :heavy_check_mark: | -| Rocky Linux 8.x, 9.x | :heavy_check_mark: | | :heavy_check_mark: | -| AlmaLinux 8.x, 9.x | :heavy_check_mark: | | :heavy_check_mark: | -| SUSE Linux Enterprise 15 SP3 and later | :heavy_check_mark: | | :heavy_check_mark: | -| SUSE Linux Enterprise 12 SP5, 15 SP0/SP1/SP2 | | | :heavy_check_mark: | -| VMware Photon OS 3.0, 4.0, 5.0 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Ubuntu 18.04 live-server | :heavy_check_mark: | | :heavy_check_mark: | -| Ubuntu 18.04 desktop | | | :heavy_check_mark: | -| Ubuntu 20.04 and later | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Flatcar 2592.0.0 and later | | :heavy_check_mark: | :heavy_check_mark: | -| Debian 10.10 and later, 11.x, 12.x | :heavy_check_mark: | | :heavy_check_mark: | -| Debian 9.x, 10.9 and earlier | | | :heavy_check_mark: | -| Windows 10, 11 | :heavy_check_mark: | | :heavy_check_mark: | -| Windows Server 2019, 2022 | :heavy_check_mark: | | :heavy_check_mark: | -| UnionTech OS Server 20 1050a | :heavy_check_mark: | | :heavy_check_mark: | -| Fedora Server 36 and later | :heavy_check_mark: | | :heavy_check_mark: | -| ProLinux Server 7.9, 8.5 | :heavy_check_mark: | | :heavy_check_mark: | -| FreeBSD 13 and later | :heavy_check_mark: | | :heavy_check_mark: | -| Pardus 21.2 Server,XFCE Desktop and later | :heavy_check_mark: | | :heavy_check_mark: | -| openSUSE Leap 15.3 and later | :heavy_check_mark: | | :heavy_check_mark: | -| BCLinux 8.x | :heavy_check_mark: | | :heavy_check_mark: | -| BCLinux-for-Euler 21.10 | :heavy_check_mark: | | :heavy_check_mark: | -| Red Hat Enterprise Linux CoreOS (RHCOS) 4.13 and later | | :heavy_check_mark: | :heavy_check_mark: | +| Guest Operating Systems | Automatic Install from ISO Image | Deploy from OVA Template | Existing VM with Guest Operating System Installed | +|:-------------------------------------------------------| :------------------------------: | :----------------------: | :--------------------------------: | +| Red Hat Enterprise Linux 7.x, 8.x, 9.x | :heavy_check_mark: | | :heavy_check_mark: | +| CentOS 7.x, 8.x | :heavy_check_mark: | | :heavy_check_mark: | +| Oracle Linux 7.x, 8.x, 9.x | :heavy_check_mark: | | :heavy_check_mark: | +| Rocky Linux 8.x, 9.x | :heavy_check_mark: | | :heavy_check_mark: | +| AlmaLinux 8.x, 9.x | :heavy_check_mark: | | :heavy_check_mark: | +| SUSE Linux Enterprise 15 SP3 and later | :heavy_check_mark: | | :heavy_check_mark: | +| SUSE Linux Enterprise 12 SP5, 15 SP0/SP1/SP2 | | | :heavy_check_mark: | +| VMware Photon OS 3.0, 4.0, 5.0 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Ubuntu 18.04 live-server | :heavy_check_mark: | | :heavy_check_mark: | +| Ubuntu 18.04 desktop | | | :heavy_check_mark: | +| Ubuntu 20.04 and later | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Flatcar 2592.0.0 and later | | :heavy_check_mark: | :heavy_check_mark: | +| Debian 10.10 and later, 11.x, 12.x | :heavy_check_mark: | | :heavy_check_mark: | +| Debian 9.x, 10.9 and earlier | | | :heavy_check_mark: | +| Windows 10, 11 | :heavy_check_mark: | | :heavy_check_mark: | +| Windows Server 2019, 2022 | :heavy_check_mark: | | :heavy_check_mark: | +| UnionTech OS Server 20 1050a | :heavy_check_mark: | | :heavy_check_mark: | +| Fedora Server 36 and later | :heavy_check_mark: | | :heavy_check_mark: | +| ProLinux Server 7.9, 8.5 | :heavy_check_mark: | | :heavy_check_mark: | +| FreeBSD 13 and later | :heavy_check_mark: | | :heavy_check_mark: | +| Pardus 21.2 Server,XFCE Desktop and later | :heavy_check_mark: | | :heavy_check_mark: | +| openSUSE Leap 15.3 and later | :heavy_check_mark: | | :heavy_check_mark: | +| BCLinux 8.x | :heavy_check_mark: | | :heavy_check_mark: | +| BCLinux-for-Euler 21.10 | :heavy_check_mark: | | :heavy_check_mark: | +| Red Hat Enterprise Linux CoreOS (RHCOS) 4.13 and later | | :heavy_check_mark: | :heavy_check_mark: | +| FusionOS 22 and 23 | :heavy_check_mark: | | :heavy_check_mark: | **Notes** This compatible guest operating systems list is used for this project only. For guest operating system support status on ESXi, please refer to [VMware Compatibility Guide](https://www.vmware.com/resources/compatibility/search.php?deviceCategory=software&testConfig=16). diff --git a/autoinstall/README.md b/autoinstall/README.md index 4e612b34d..441cc530a 100644 --- a/autoinstall/README.md +++ b/autoinstall/README.md @@ -23,6 +23,7 @@ 22. For openSUSE Leap 15.3 or later unattend auto-install, please use file openSUSE/15/autoinst.xml. 23. For BCLinux 8.x unattend auto-install, please use file BCLinux/8/ks.cfg. 24. For BCLinux-for-Euler 21.10 unattend auto-install, please use file BCLinux-for-Euler/21.10/ks.cfg. +25. For FusionOS unattend auto-install, please use files under Fusion. # Notes ## For Windows From f44d945ee26076f045acf13ca6e19ccb3746d41b Mon Sep 17 00:00:00 2001 From: linhuali Date: Wed, 15 Nov 2023 02:06:19 +0000 Subject: [PATCH 3/4] update autoinstall/README.md for FusionOS Signed-off-by: linhuali --- autoinstall/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoinstall/README.md b/autoinstall/README.md index 441cc530a..435cd18e3 100644 --- a/autoinstall/README.md +++ b/autoinstall/README.md @@ -23,7 +23,7 @@ 22. For openSUSE Leap 15.3 or later unattend auto-install, please use file openSUSE/15/autoinst.xml. 23. For BCLinux 8.x unattend auto-install, please use file BCLinux/8/ks.cfg. 24. For BCLinux-for-Euler 21.10 unattend auto-install, please use file BCLinux-for-Euler/21.10/ks.cfg. -25. For FusionOS unattend auto-install, please use files under Fusion. +25. For FusionOS 22 and 23 unattend auto-install, please use files under Fusion. # Notes ## For Windows From 3af494b290cbb58ba1ec6fa1b4e7e25333fa0b3c Mon Sep 17 00:00:00 2001 From: linhuali Date: Wed, 15 Nov 2023 03:09:11 +0000 Subject: [PATCH 4/4] update autoinstall/README.md for FusionOS Signed-off-by: linhuali --- autoinstall/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoinstall/README.md b/autoinstall/README.md index 435cd18e3..267bb5b81 100644 --- a/autoinstall/README.md +++ b/autoinstall/README.md @@ -23,7 +23,8 @@ 22. For openSUSE Leap 15.3 or later unattend auto-install, please use file openSUSE/15/autoinst.xml. 23. For BCLinux 8.x unattend auto-install, please use file BCLinux/8/ks.cfg. 24. For BCLinux-for-Euler 21.10 unattend auto-install, please use file BCLinux-for-Euler/21.10/ks.cfg. -25. For FusionOS 22 and 23 unattend auto-install, please use files under Fusion. +25. For FusionOS 22 unattend auto-install, please use files under Fusion. +26. For FusionOS 23 unattend auto-install, please use file Fusion/server_without_GUI/ks.cfg. # Notes ## For Windows