summaryrefslogtreecommitdiff
path: root/roles/vm-host/tasks/main.yaml
blob: a5e98fa91c9fd9a326b79a22ea51c0cb07e2d4b7 (plain) (blame)
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
---
- name: install tftpd and python-libvirt
  with_items:
  - atftpd
  - openbsd-inetd
  - qemu-kvm
  - libvirt-bin
  - python-libvirt
  apt:
    name: "{{ item }}"
    state: present

- name: configure tftpd via inetd
  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

- name: make sure installer directories exists
  with_items:
  - "{{ vm_host.installer.path }}"
  - "{{ vm_host.installer.preseed_path }}"
  file:
    name: "{{ item }}"
    state: directory

- name: prepare directories for installer images
  with_subelements:
  - "{{ vm_host.installer.distros }}"
  - arch
  file:
    name: "{{ vm_host.installer.path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}"
    state: directory

- name: download installer kernel images
  with_subelements:
  - "{{ vm_host.installer.distros }}"
  - 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"
    mode: 0644
    force: "{{ vm_host_force_download_installer }}"

- name: download installer initrd.gz
  with_subelements:
  - "{{ vm_host.installer.distros }}"
  - 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"
    mode: 0644
    force: "{{ vm_host_force_download_installer }}"