Skip to content

Commit f415846

Browse files
authored
Merge pull request #186 from KVM-VMI/vagrant/downgrade_debian_11
Vagrant: downgrade debian 11
2 parents 97daf38 + da515bd commit f415846

File tree

5 files changed

+65
-31
lines changed

5 files changed

+65
-31
lines changed

vagrant/Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'rubygems'
22

33
Vagrant.configure(2) do |config|
4-
config.vm.box = "generic/debian12"
4+
config.vm.box = "generic/debian11"
55
config.vm.box_version = "4.3.12"
66
config.vm.define "kvmi"
77

vagrant/ansible/roles/kvm/tasks/install_normal.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@
33
command: "make -j{{ ansible_processor_vcpus }} bzImage"
44
args:
55
chdir: "{{ root_dir }}/kvm"
6-
environment:
7-
EXTRA_CFLAGS: "-Wno-error=use-after-free"
86
become: false
97

108
- name: build modules
119
command: "make -j{{ ansible_processor_vcpus }} modules"
1210
args:
1311
chdir: "{{ root_dir }}/kvm"
14-
environment:
15-
EXTRA_CFLAGS: "-Wno-error=use-after-free"
1612
become: false
1713

1814
- name: install modules

vagrant/ansible/roles/kvm/tasks/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- bison
1515
- libelf-dev
1616
- libssl-dev
17-
- pahole
17+
- dwarves
1818

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

7878
- name: install kvm
79-
include: install_deb.yml
79+
include_tasks: install_deb.yml
8080
when: kvm_install_package
8181

8282
- name: install kvm
83-
include: install_normal.yml
83+
include_tasks: install_normal.yml
8484
when: not kvm_install_package
8585

8686
- name: set kvmi kernel as default
@@ -93,4 +93,4 @@
9393
command: update-grub
9494

9595
- name: setup libkvmi
96-
include: libkvmi.yml
96+
include_tasks: libkvmi.yml

vagrant/ansible/roles/vm/tasks/main.yml

Lines changed: 57 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,44 @@
1212
group: vagrant
1313

1414
- name: setup libvirt
15-
include: libvirt.yml
15+
include_tasks: libvirt.yml
1616

17-
- name: install Packer
18-
apt:
19-
name: packer
17+
- name: Create temporary directory
18+
ansible.builtin.tempfile:
19+
state: directory
20+
suffix: packer
21+
register: temp_dir
22+
23+
- name: Download Packer zip archive
24+
ansible.builtin.get_url:
25+
url: "https://releases.hashicorp.com/packer/1.6.0/packer_1.6.0_linux_amd64.zip"
26+
dest: "{{ temp_dir.path }}/packer.zip"
27+
mode: "0644"
28+
29+
- name: Install unzip
30+
ansible.builtin.apt:
31+
name: unzip
2032
state: present
33+
become: true
34+
35+
- name: Unzip Packer archive
36+
ansible.builtin.unarchive:
37+
src: "{{ temp_dir.path }}/packer.zip"
38+
dest: "{{ temp_dir.path }}"
39+
remote_src: true
40+
41+
- name: Move Packer binary to /usr/local/bin
42+
ansible.builtin.copy:
43+
src: "{{ temp_dir.path }}/packer"
44+
dest: "/usr/local/bin/packer"
45+
mode: "0755"
46+
remote_src: true
47+
become: true
48+
49+
- name: Clean up temporary directory
50+
ansible.builtin.file:
51+
path: "{{ temp_dir.path }}"
52+
state: absent
2153

2254
- name: upload templates
2355
synchronize:
@@ -33,35 +65,40 @@
3365
mode: 0666
3466

3567
- name: setup Windows XP
36-
include: setup.yml
68+
include_tasks: setup.yml
3769
with_items:
3870
- {
39-
name: 'winxp',
40-
ram: '512',
41-
packer_template: 'windows.json',
42-
packer_varfile: 'winxp.json',
43-
image_url: 'https://www.dropbox.com/s/0zycew5u3xnf8m7/winxp.qcow2?dl=1',
44-
checksum_url: 'sha1:8550675150ee1601859c4665d49eb29005065446'
71+
name: "winxp",
72+
ram: "512",
73+
packer_template: "windows.json",
74+
packer_varfile: "winxp.json",
75+
image_url: "https://www.dropbox.com/s/0zycew5u3xnf8m7/winxp.qcow2?dl=1",
76+
checksum_url: "sha1:8550675150ee1601859c4665d49eb29005065446",
4577
}
4678
when: enabled_vms['winxp']
4779

4880
- name: setup Windows 7
49-
include: setup.yml
81+
include_tasks: setup.yml
5082
with_items:
5183
- {
52-
name: 'win7',
53-
ram: '1500',
54-
packer_template: 'windows.json',
55-
packer_varfile: 'win7.json',
56-
image_url: 'https://www.dropbox.com/s/x9uyexfbhumphe7/win7.qcow2?dl=1',
57-
checksum_url: 'sha1:64c1c051efa70c902b0fd4b10c7d8da90215bbca'
84+
name: "win7",
85+
ram: "1500",
86+
packer_template: "windows.json",
87+
packer_varfile: "win7.json",
88+
image_url: "https://www.dropbox.com/s/x9uyexfbhumphe7/win7.qcow2?dl=1",
89+
checksum_url: "sha1:64c1c051efa70c902b0fd4b10c7d8da90215bbca",
5890
}
5991
when: enabled_vms['win7']
6092

6193
- name: setup Ubuntu
62-
include: setup.yml
94+
include_tasks: setup.yml
6395
with_items:
64-
- { name: 'ubuntu', ram: '1024', packer_template: 'ubuntu.json', packer_varfile: 'ubuntu-16.04-server-i386.json' }
96+
- {
97+
name: "ubuntu",
98+
ram: "1024",
99+
packer_template: "ubuntu.json",
100+
packer_varfile: "ubuntu-16.04-server-i386.json",
101+
}
65102
when: enabled_vms['ubuntu']
66103

67104
- name: refresh libvirt pool

vagrant/ansible/roles/vm/templates/domain-template.xml.j2

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
<apic/>
1818
<vmport state='off'/>
1919
</features>
20-
<cpu mode='host-model'>
21-
<model fallback='allow'/>
20+
<cpu mode="custom" match="exact" check="partial">
21+
<model fallback="allow">core2duo</model>
22+
<feature policy="optional" name="monitor"/>
2223
</cpu>
2324
<clock offset='utc'>
2425
<timer name='rtc' tickpolicy='catchup'/>

0 commit comments

Comments
 (0)