aboutsummaryrefslogblamecommitdiffstats
path: root/roles/vmm/tasks/autoinstall_configuration.yml
blob: a131cb3ebbb1df490efdf1241e12848a8f5a764a (plain) (tree)
1
2
3
4
5
6
7
8
9
10

   
                                    
                                                                                   

                                    
                       
                                     

              
                

                    
                                           
                                             
                            
                                                                    

              
                


                               
                                           
                           
                         
                                                                    

                               
 
                                         
                           


                                                                      
                               


                                    
                           
                         
                      
                                                           

            

                                             
                       



                                                                 
                
               
               

                               
---

- name: include httpd role variables
  ansible.builtin.include_vars: "{{ inventory_dir }}/roles/httpd/defaults/main.yml"

- name: create autoinstall directory
  ansible.builtin.file:
    path: "{{ vmm_autoinstall_dir }}"
    owner: www
    group: www
    mode: "0700"
    state: directory

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

- name: generate autoupgrade configurations
  ansible.builtin.template:
    <<: *generation_steps
    dest: "{{ vmm_autoinstall_dir }}/{{ item.lladdr }}-upgrade.conf"
  when: item.image == "openbsd"
  loop: "{{ vmm_vms }}"

- name: generate disklabel configurations
  ansible.builtin.template:
    <<: *generation_steps
    src: disklabel.j2
    dest: "{{ vmm_autoinstall_dir }}/{{ item.lladdr }}-disklabel.conf"
  when: item.image == "openbsd"
  loop: "{{ vmm_vms }}"

- name: generate httpd configuration
  ansible.builtin.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
  ansible.builtin.file:
    src: /bsd.sp
    dest: "{{ vmm_image_openbsd_kernel_prefix }}.{{ item.name }}"
    owner: 0
    group: 0
    mode: "0600"
    state: hard
    force: true
  when: item.image == "openbsd"
  loop: "{{ vmm_vms }}"
remember that computers suck.