Move preseed generation to a separate role
[noc.git] / ansible / roles / vm / host / tasks / main.yml
index 248f855..2c75bbb 100644 (file)
@@ -1,25 +1,24 @@
 ---
-- name: install tftpd and python-libvirt
+- name: install dependencies
   apt:
     name:
-      - atftpd
-      - openbsd-inetd
       - qemu-kvm
       - libvirt-bin
       - python-libvirt
+      - haveged
     state: present
 
-- name: configure tftpd via inetd
+- name: configure haveged
   lineinfile:
-    regexp: "^#?({{ vm_host.network.ip }}:)?tftp"
-    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 }}"
-    path: /etc/inetd.conf
-  notify: restart inetd
+    regexp: "^#?DAEMON_ARGS"
+    line: 'DAEMON_ARGS="-w 3072"'
+    path: /etc/default/haveged
+  notify: restart haveged
 
 - name: make sure installer directories exists
   with_items:
-    - "{{ vm_host.installer.path }}"
-    - "{{ vm_host.installer.preseed_path }}"
+    - "{{ debian_installer_path }}"
+    - "{{ preseed_path }}"
   file:
     name: "{{ item }}"
     state: directory
@@ -29,7 +28,7 @@
     - "{{ vm_host.installer.distros }}"
     - arch
   file:
-    name: "{{ vm_host.installer.path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}"
+    name: "{{ debian_installer_path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}"
     state: directory
 
 - name: download installer kernel images
@@ -38,7 +37,7 @@
     - arch
   get_url:
     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"
-    dest: "{{ vm_host.installer.path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}/linux"
+    dest: "{{ debian_installer_path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}/linux"
     mode: 0644
     force: "{{ vm_host_force_download_installer }}"
 
@@ -48,6 +47,6 @@
     - arch
   get_url:
     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"
-    dest: "{{ vm_host.installer.path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}/initrd.gz"
+    dest: "{{ debian_installer_path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}/initrd.gz"
     mode: 0644
     force: "{{ vm_host_force_download_installer }}"