diff --git a/LICENSE b/LICENSE index 2c2470b..1de4e99 100644 --- a/LICENSE +++ b/LICENSE @@ -209,7 +209,7 @@ If you develop a new program, and you want it to be of the greatest possible use To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. Home_Lab_Automation - Copyright (C) 2025 seandersont + Copyright (C) 2024 seandersont This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@ -221,7 +221,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - Home_Lab_Automation Copyright (C) 2025 seandersont + Home_Lab_Automation Copyright (C) 2024 seandersont This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/README.md b/README.md index 5ad3512..428a517 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # Home_Lab_Automation -Anderson home lab automation scripts for AAP demos \ No newline at end of file +Automation for quickly provisioning various resources for my home lab environment, primarily consisting of Ansible playbooks and roles \ No newline at end of file diff --git a/build_vm/main.yml b/build_vm/main.yml new file mode 100644 index 0000000..ddacc08 --- /dev/null +++ b/build_vm/main.yml @@ -0,0 +1,10 @@ +--- +- name: Define and start new vms + hosts: localhost + vars: + name: name + + tasks: + - name: Define and install vms + import_tasks: tasks/main.yml + diff --git a/build_vm/tasks/main.yml b/build_vm/tasks/main.yml new file mode 100644 index 0000000..fe59572 --- /dev/null +++ b/build_vm/tasks/main.yml @@ -0,0 +1,15 @@ +--- +- name: Create VM from template + virt: + command: define + xml: "{{ lookup('template', 'templates/vm_template.xml.j2') }}" + +- name: Check {{ name }}.qcow2 exists + stat: + path: /home/seandersont/.local/share/libvirt/images/{{ name }}.qcow2 + register: stat_result + +- name: Create {{ name }}.qcow2 + command: qemu-img create -f qcow2 /home/seandersont/.local/share/libvirt/images/{{ name }}.qcow2 40 + when: not stat_result.stat.exists + diff --git a/build_vm/templates/vm_template.xml.j2 b/build_vm/templates/vm_template.xml.j2 new file mode 100644 index 0000000..83af424 --- /dev/null +++ b/build_vm/templates/vm_template.xml.j2 @@ -0,0 +1,224 @@ + + {{ name }} + + + + + + + 8388608 + 7340032 + 2 + + /machine + + + hvm + + + + + + + + + EPYC-IBPB + AMD + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + destroy + restart + destroy + + + + + + /usr/bin/qemu-system-x86_64 + + + + + + +
+ + + + + + +
+ + + +
+ + + +
+ + + + + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ + + + + + + + + + + + + +
+ +