aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/tasks/autoinstall_configuration.yml
blob: cd52a84eb12b85698a68b09bedbb6dd8a9c20c54 (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
- name: include httpd role variables
  include_vars: "{{ inventory_dir }}/roles/httpd/defaults/main.yml"

- name: create autoinstall directory
  file:
    path: /var/www/htdocs/autoinstall
    owner: www
    group: www
    mode: 0700
    state: directory

- name: generate autoinstall files
  template: &generation_steps
    src: autoinstall.conf.j2
    dest: "/var/www/htdocs/autoinstall/{{ item.lladdr }}-install.conf"
    owner: www
    group: www
    mode: 0640
  when: item.image == "openbsd"
  loop: "{{ vmm_vms }}"

- name: generate autoupgrade files
  template:
    <<: *generation_steps
    dest: "/var/www/htdocs/autoinstall/{{ item.lladdr }}-upgrade.conf"
  when: item.image == "openbsd"
  loop: "{{ vmm_vms }}"

- name: generate httpd configuration
  template:
    <<: *generation_steps
    src: httpd.conf.j2
    dest: "{{ httpd_configuration_dir }}/autoinstall.conf"
    owner: 0
    group: 0

- name: link openbsd vm kernel to host kernel
  file:
    src: /bsd.sp
    dest: "{{ vmm_image_openbsd_kernel_prefix }}.{{ item.name }}"
    owner: 0
    group: 0
    state: hard
  when: item.image == "openbsd"
  loop: "{{ vmm_vms }}"
remember that computers suck.