vm/host: Install haveged on VM hosts
[noc.git] / ansible / roles / vm / host / tasks / main.yml
1 ---
2 - name: install dependencies
3   apt:
4     name:
5       - atftpd
6       - openbsd-inetd
7       - qemu-kvm
8       - libvirt-bin
9       - python-libvirt
10       - haveged
11     state: present
12
13 - name: configure haveged
14   lineinfile:
15     regexp: "^#?DAEMON_ARGS"
16     line: 'DAEMON_ARGS="-w 3072"'
17     path: /etc/default/haveged
18   notify: restart haveged
19
20 - name: configure tftpd via inetd
21   lineinfile:
22     regexp: "^#?({{ vm_host.network.ip }}:)?tftp"
23     line: "{{ vm_host.network.ip }}:tftp                dgram   udp4    wait    nobody /usr/sbin/tcpd /usr/sbin/in.tftpd --tftpd-timeout 300 --retry-timeout 5 --maxthread 10 --verbose=5 {{ vm_host.installer.preseed_path }}"
24     path: /etc/inetd.conf
25   notify: restart inetd
26
27 - name: make sure installer directories exists
28   with_items:
29     - "{{ vm_host.installer.path }}"
30     - "{{ vm_host.installer.preseed_path }}"
31   file:
32     name: "{{ item }}"
33     state: directory
34
35 - name: prepare directories for installer images
36   with_subelements:
37     - "{{ vm_host.installer.distros }}"
38     - arch
39   file:
40     name: "{{ vm_host.installer.path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}"
41     state: directory
42
43 - name: download installer kernel images
44   with_subelements:
45     - "{{ vm_host.installer.distros }}"
46     - arch
47   get_url:
48     url: "{{ vm_host_installer_url[item.0.distro] }}/dists/{{ item.0.codename }}/main/installer-{{ item.1 }}/current/images/netboot/{{ item.0.distro }}-installer/{{ item.1 }}/linux"
49     dest: "{{ vm_host.installer.path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}/linux"
50     mode: 0644
51     force: "{{ vm_host_force_download_installer }}"
52
53 - name: download installer initrd.gz
54   with_subelements:
55     - "{{ vm_host.installer.distros }}"
56     - arch
57   get_url:
58     url: "{{ vm_host_installer_url[item.0.distro] }}/dists/{{ item.0.codename }}/main/installer-{{ item.1 }}/current/images/netboot/{{ item.0.distro }}-installer/{{ item.1 }}/initrd.gz"
59     dest: "{{ vm_host.installer.path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}/initrd.gz"
60     mode: 0644
61     force: "{{ vm_host_force_download_installer }}"