Ubuntu 20.04 on QEmu working

This commit is contained in:
Greg Hellings
2022-05-04 09:00:17 -05:00
parent 950500c9f1
commit ff59effbb1
43 changed files with 757 additions and 0 deletions
@@ -0,0 +1,5 @@
- name: create hgfs dir
become: true
file:
state: directory
path: /mnt/hgfs
+45
View File
@@ -0,0 +1,45 @@
- name: create mount point
become: true
file:
path: /mnt/vmware
state: directory
- name: mount iso file
become: true
command: mount -o loop,ro {{ ansible_user_dir }}/linux.iso /mnt/vmware
- name: create tmp dir
file:
path: /tmp/vmware
state: directory
- name: untar tools
command: |
set -ex
tar zxf /mnt/vmware/VMWareTools-*.tar.gz -C /tmp/vmware
sudo /tmp/vmware/vmware-tools-distrib/vmware-install.pl --default --force-install
rm -r /tmp/vmware
sudo umount /mnt/vmware
changed_when: false
- name: remove files
become: true
file:
path: "{{ item }}"
state: absent
loop:
- /mnt/vmware
- "{{ ansible_user_dir }}/linux.iso"
- name: add content to /etc/vmware-tools/locations
blockinfile:
block: |
remove_answer ENABLE_VGAUTH
answer ENABLE_VGAUTH no
remove_answer ENABLE_VMBLOCK
answer ENABLE_VMBLOCK no
- name: finish up installs
become: true
command: /usr/bin/vmware-config-tools.pl --default --skip-stop-abort
changed_when: false
+25
View File
@@ -0,0 +1,25 @@
- name: read variables
include_vars: "{{ item }}"
loop:
- "{{ role_path }}/vars/{{ ansible_facts.distribution }}.yml"
- "{{ role_path }}/vars/{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml"
when: item is file
- name: install vmware related packages
become: true
package:
name: "{{ vmware_packages }}"
state: present
- name: modern systems
import_tasks: has_package.yml
when: >-
ansible_distribution_name == 'fedora' or
(ansible_distribution_name == 'debian' and
ansible_distribution_major_version > '8')
- name: legacy builds
import_tasks: legacy.yml
when: >-
(ansible_distribution_name == 'debian' and
ansible_distribution_major_version <= '8')
+6
View File
@@ -0,0 +1,6 @@
vmware_packages:
- perl
- net-tools
- make
- gcc
- kernel-devel
+2
View File
@@ -0,0 +1,2 @@
vmware_packages:
- open-vm-tools
+4
View File
@@ -0,0 +1,4 @@
vmware_packages:
- perl
- make
- linux-headers-{{ ansible_architecture }}
+2
View File
@@ -0,0 +1,2 @@
vmware_packages:
- open-vm-tools
+2
View File
@@ -0,0 +1,2 @@
vmware_packages:
- open-vm-tools
+2
View File
@@ -0,0 +1,2 @@
vmware_packages:
- open-vm-tools