add ansible playbooks for managing fedora VMs. update win10 script because tap number is being already used by other VMs

This commit is contained in:
mykola2312 2024-09-13 01:09:29 +03:00
parent 975865a7bf
commit a43909a697
9 changed files with 105 additions and 3 deletions

View file

@ -11,6 +11,7 @@ mkdirs=(
dirs=(
"/var/unbound:."
"$HOME/bhyve:."
"$HOME/ansible:."
"$HOME/.config/i3:i3wm"
"$HOME/.config/i3status:i3wm"
)

30
ansible/fedora-bloat.txt Normal file
View file

@ -0,0 +1,30 @@
ModemManager.x86_64
NetworkManager-bluetooth.x86_64
NetworkManager-wifi.x86_64
NetworkManager-wwan.x86_64
amd-gpu-firmware.noarch
amd-ucode-firmware.noarch
atheros-firmware.noarch
bluez.x86_64
bluez-libs.x86_64
brcmfmac-firmware.noarch
intel-audio-firmware.noarch
intel-gpu-firmware.noarch
iw.x86_64
iwlegacy-firmware.noarch
iwlwifi-dvm-firmware.noarch
iwlwifi-mvm-firmware.noarch
mesa-dri-drivers.x86_64
mesa-libGL.x86_64
mesa-libglapi.x86_64
mesa-va-drivers.x86_64
microcode_ctl.x86_64
mt7xxx-firmware.noarch
nvidia-gpu-firmware.noarch
nxpwireless-firmware.noarch
pulseaudio-libs.x86_64
realtek-firmware.noarch
tiwilink-firmware.noarch
alsa-sof-firmware.noarch
cirrus-audio-firmware.noarch
libertas-firmware.noarch

View file

@ -0,0 +1,16 @@
---
- name: remove useless packages for virtualized environment
hosts: servers
tasks:
- name: copy package list
copy:
src: fedora-bloat.txt
dest: /tmp/fedora-bloat.txt
register: copy_result
- name: dnf remove packages
shell: yes | dnf remove $(cat /tmp/fedora-bloat.txt)
when: copy_result is success
become: true
register: dnf_output
- debug: msg="{{ dnf_output.stdout }}"
- debug: msg="{{ dnf_output.stderr }}"

16
ansible/hosts Normal file
View file

@ -0,0 +1,16 @@
servers:
hosts:
srv-master:
srv-slave1:
srv-slave2:
vars:
ansible_connection: ssh
ansible_user: mykola
ansible_password: 12345678
masters:
hosts:
srv-master:
slaves:
hosts:
srv-slave1:
srv-slave2:

7
ansible/reboot.yml Normal file
View file

@ -0,0 +1,7 @@
---
- name: reboot
hosts: servers
tasks:
- name: reboot 'em all
shell: reboot
become: true

8
ansible/uname.yml Normal file
View file

@ -0,0 +1,8 @@
---
- name: uname test playbook
hosts: servers
tasks:
- name: run uname
shell: uname -a
register: uname_output
- debug: msg="{{ uname_output.stdout }}"

15
ansible/updoot.yml Normal file
View file

@ -0,0 +1,15 @@
---
- name: update all fedora servers
hosts: servers
tasks:
- name: update
shell: yes | dnf update
register: update_status
become: true
- debug: msg="{{ update_status.stdout }}"
- name: upgrade
shell: yes | dnf upgrade
when: update_status is success
register: upgrade_status
become: true
- debug: msg="{{ upgrade_status.stdout }}"

9
ansible/whoami.yml Normal file
View file

@ -0,0 +1,9 @@
---
- name: whoami test playbook
hosts: servers
tasks:
- name: run whoami
shell: whoami
register: whoami_output
become: true
- debug: msg="{{ whoami_output.stdout }}"

View file

@ -1,13 +1,13 @@
#!/bin/sh
./enroll-tap.sh vnat0 tap0 &
./enroll-tap.sh vnat0 tap4 &
bhyve \
-c 2 \
-s 0,hostbridge \
-s 3,ahci-hd,/var/lib/libvirt/images/win10.img \
-s 10,virtio-net,tap0 \
-s 15,fbuf,rfb=127.0.0.1:5900,w=1280,h=720 \
-s 10,virtio-net,tap4 \
-s 15,fbuf,rfb=127.0.0.1:5969,w=1280,h=720 \
-s 31,lpc \
-l com1,/dev/nmdm0A \
-l com2,/dev/nmdm1A \