Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vagrant: downgrade debian 11 #186

Merged
merged 5 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vagrant/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'rubygems'

Vagrant.configure(2) do |config|
config.vm.box = "generic/debian12"
config.vm.box = "generic/debian11"
config.vm.box_version = "4.3.12"
config.vm.define "kvmi"

Expand Down
4 changes: 0 additions & 4 deletions vagrant/ansible/roles/kvm/tasks/install_normal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
command: "make -j{{ ansible_processor_vcpus }} bzImage"
args:
chdir: "{{ root_dir }}/kvm"
environment:
EXTRA_CFLAGS: "-Wno-error=use-after-free"
become: false

- name: build modules
command: "make -j{{ ansible_processor_vcpus }} modules"
args:
chdir: "{{ root_dir }}/kvm"
environment:
EXTRA_CFLAGS: "-Wno-error=use-after-free"
become: false

- name: install modules
Expand Down
8 changes: 4 additions & 4 deletions vagrant/ansible/roles/kvm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- bison
- libelf-dev
- libssl-dev
- pahole
- dwarves

# because of Windows filesystem restrictions, the KVM repo cannot be checked out on Windows
# it contains some files like
Expand Down Expand Up @@ -76,11 +76,11 @@
become: false

- name: install kvm
include: install_deb.yml
include_tasks: install_deb.yml
when: kvm_install_package

- name: install kvm
include: install_normal.yml
include_tasks: install_normal.yml
when: not kvm_install_package

- name: set kvmi kernel as default
Expand All @@ -93,4 +93,4 @@
command: update-grub

- name: setup libkvmi
include: libkvmi.yml
include_tasks: libkvmi.yml
77 changes: 57 additions & 20 deletions vagrant/ansible/roles/vm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,44 @@
group: vagrant

- name: setup libvirt
include: libvirt.yml
include_tasks: libvirt.yml

- name: install Packer
apt:
name: packer
- name: Create temporary directory
ansible.builtin.tempfile:
state: directory
suffix: packer
register: temp_dir

- name: Download Packer zip archive
ansible.builtin.get_url:
url: "https://releases.hashicorp.com/packer/1.6.0/packer_1.6.0_linux_amd64.zip"
dest: "{{ temp_dir.path }}/packer.zip"
mode: "0644"

- name: Install unzip
ansible.builtin.apt:
name: unzip
state: present
become: true

- name: Unzip Packer archive
ansible.builtin.unarchive:
src: "{{ temp_dir.path }}/packer.zip"
dest: "{{ temp_dir.path }}"
remote_src: true

- name: Move Packer binary to /usr/local/bin
ansible.builtin.copy:
src: "{{ temp_dir.path }}/packer"
dest: "/usr/local/bin/packer"
mode: "0755"
remote_src: true
become: true

- name: Clean up temporary directory
ansible.builtin.file:
path: "{{ temp_dir.path }}"
state: absent

- name: upload templates
synchronize:
Expand All @@ -33,35 +65,40 @@
mode: 0666

- name: setup Windows XP
include: setup.yml
include_tasks: setup.yml
with_items:
- {
name: 'winxp',
ram: '512',
packer_template: 'windows.json',
packer_varfile: 'winxp.json',
image_url: 'https://www.dropbox.com/s/0zycew5u3xnf8m7/winxp.qcow2?dl=1',
checksum_url: 'sha1:8550675150ee1601859c4665d49eb29005065446'
name: "winxp",
ram: "512",
packer_template: "windows.json",
packer_varfile: "winxp.json",
image_url: "https://www.dropbox.com/s/0zycew5u3xnf8m7/winxp.qcow2?dl=1",
checksum_url: "sha1:8550675150ee1601859c4665d49eb29005065446",
}
when: enabled_vms['winxp']

- name: setup Windows 7
include: setup.yml
include_tasks: setup.yml
with_items:
- {
name: 'win7',
ram: '1500',
packer_template: 'windows.json',
packer_varfile: 'win7.json',
image_url: 'https://www.dropbox.com/s/x9uyexfbhumphe7/win7.qcow2?dl=1',
checksum_url: 'sha1:64c1c051efa70c902b0fd4b10c7d8da90215bbca'
name: "win7",
ram: "1500",
packer_template: "windows.json",
packer_varfile: "win7.json",
image_url: "https://www.dropbox.com/s/x9uyexfbhumphe7/win7.qcow2?dl=1",
checksum_url: "sha1:64c1c051efa70c902b0fd4b10c7d8da90215bbca",
}
when: enabled_vms['win7']

- name: setup Ubuntu
include: setup.yml
include_tasks: setup.yml
with_items:
- { name: 'ubuntu', ram: '1024', packer_template: 'ubuntu.json', packer_varfile: 'ubuntu-16.04-server-i386.json' }
- {
name: "ubuntu",
ram: "1024",
packer_template: "ubuntu.json",
packer_varfile: "ubuntu-16.04-server-i386.json",
}
when: enabled_vms['ubuntu']

- name: refresh libvirt pool
Expand Down
5 changes: 3 additions & 2 deletions vagrant/ansible/roles/vm/templates/domain-template.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
<apic/>
<vmport state='off'/>
</features>
<cpu mode='host-model'>
<model fallback='allow'/>
<cpu mode="custom" match="exact" check="partial">
<model fallback="allow">core2duo</model>
<feature policy="optional" name="monitor"/>
</cpu>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
Expand Down
Loading