X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=ansible%2Froles%2Fvm%2Finstall%2Ftasks%2Fmain.yml;h=a97230f5bce844a2719363f983588456f3168ab3;hb=6b3a9335bde11948e7538930d57fd2c2853f6583;hp=034cf1db97f5121f49555756999dcdce57217879;hpb=2fb00147adff89fa701ef21a4f6d0da696d27488;p=noc.git diff --git a/ansible/roles/vm/install/tasks/main.yml b/ansible/roles/vm/install/tasks/main.yml index 034cf1d..a97230f 100644 --- a/ansible/roles/vm/install/tasks/main.yml +++ b/ansible/roles/vm/install/tasks/main.yml @@ -1,44 +1,4 @@ --- -- block: - - name: Make a temporary directory - command: mktemp -d - register: tmpdir - - - set_fact: - tmpdir: "{{ tmpdir.stdout }}" - initramfs: "{{ vm_host.installer.preseed_path }}/vm-{{ vmname }}-{{ vmdistro }}-{{ vmdistcodename }}.initrd.gz" - - - name: Copy initramfs into position - copy: - remote_src: yes - src: "{{ vm_host.installer.path }}/{{ vmdistro }}-{{ vmdistcodename }}/{{ hostvars[vmname].vm_install_cooked.arch | default('amd64') }}/initrd.gz" - dest: "{{ initramfs }}" - - - name: generate preseed file - template: - src: "preseed_{{ vmdistro }}-{{ vmdistcodename }}.cfg.j2" - dest: "{{ tmpdir }}/preseed.cfg" - - - name: generate authorized_keys file - authorized_key: - user: root - path: "{{ tmpdir }}/authorized_keys" - key: "{{ hostvars[vmname].ssh_keys | default(noc_ssh_keys) | join('\n') }}" - - - name: Inject files into initramfs - shell: cpio -H newc -o | gzip -9 >> {{ initramfs }} - args: - chdir: "{{ tmpdir }}" - stdin: | - preseed.cfg - authorized_keys - - always: - - name: Delete temporary directory - file: - path: "{{ tmpdir }}" - state: absent - - name: create disks for vm with_dict: "{{ hostvars[vmname].vm_install_cooked.disks.virtio | default({}) | combine(hostvars[vmname].vm_install_cooked.disks.scsi | default({})) }}" lvol: