blob: 77231622e79f5792d3d2b41ba1e610fc0a314a90 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
---
- hosts: localhost
tasks:
- sysctl:
name: net.ipv4.ip_forward
state: present
value: 1
sysctl_set: yes
- systemd:
name: dhcpd
state: stopped
enabled: no
ignore_errors: yes
- systemd:
name: libvirtd
state: started
enabled: yes
- systemd:
name: openvswitch
state: started
enabled: yes
- virt_net:
command: define
name: default
xml: '{{ lookup("template", "virsh_network_default.xml.j2") }}'
state: active
autostart: yes
- openvswitch_bridge:
bridge: 'br-{{ item }}'
state: present
with_items: '{{ virsh_enabled_networks }}'
- virt_net:
command: define
name: '{{ item }}'
xml: '{{ lookup("template", "virsh_network_ovs.xml.j2") }}'
autostart: yes
with_items: '{{ virsh_enabled_networks }}'
- virt_net:
command: create
name: '{{ item }}'
with_items: '{{ virsh_enabled_networks }}'
- virt_pool:
name: default
command: define
autostart: yes
state: active
xml: '{{ lookup("template", "virsh_pool.xml.j2") }}'
- lineinfile:
path: /etc/modprobe.d/kvm_intel.conf
line: 'options kvm-intel nested=1'
create: yes
when: ansible_architecture == "x86_64"
- modprobe:
name: "{{ item }}"
state: present
with_items:
- kvm
- kvm_intel
when: ansible_architecture == "x86_64"
- name: Generate SSH key for root if missing
shell: test -e ~/.ssh/id_rsa || ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
- name: Manually patch vmbc to work with python3.x
lineinfile:
line: " conn.defineXML(ET.tostring(tree, encoding='unicode'))"
regexp: "tostring"
path: /usr/lib/python3.4/site-packages/virtualbmc/vbmc.py
|