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