diff options
Diffstat (limited to 'roles/vm')
-rw-r--r-- | roles/vm/grub/tasks/main.yml | 18 | ||||
-rw-r--r-- | roles/vm/guest/tasks/main.yml | 12 | ||||
-rw-r--r-- | roles/vm/host/tasks/main.yml | 2 | ||||
-rw-r--r-- | roles/vm/install/tasks/main.yml | 2 | ||||
-rw-r--r-- | roles/vm/network/tasks/main.yml | 4 |
5 files changed, 20 insertions, 18 deletions
diff --git a/roles/vm/grub/tasks/main.yml b/roles/vm/grub/tasks/main.yml index eb868d38..e663e808 100644 --- a/roles/vm/grub/tasks/main.yml +++ b/roles/vm/grub/tasks/main.yml @@ -1,15 +1,17 @@ --- - name: enable serial console in grub and for kernel - with_dict: - GRUB_TIMEOUT: 2 - GRUB_CMDLINE_LINUX: '"console=ttyS0,115200n8"' - GRUB_TERMINAL: serial - GRUB_SERIAL_COMMAND: >- - "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" + vars: + grub_options: + GRUB_TIMEOUT: 2 + GRUB_CMDLINE_LINUX: '"console=ttyS0,115200n8"' + GRUB_TERMINAL: serial + GRUB_SERIAL_COMMAND: >- + "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" + loop: "{{ grub_options | dict2items }}" + loop_control: + label: "{{ item.key }}" lineinfile: dest: /etc/default/grub regexp: "^{{ item.key }}=" line: "{{ item.key }}={{ item.value }}" notify: update grub - loop_control: - label: "{{ item.key }}" diff --git a/roles/vm/guest/tasks/main.yml b/roles/vm/guest/tasks/main.yml index 4830d051..68c36be3 100644 --- a/roles/vm/guest/tasks/main.yml +++ b/roles/vm/guest/tasks/main.yml @@ -4,23 +4,23 @@ state: present - name: Configure rngd [1/2] + loop: '{{ rngd_config | dict2items }}' + loop_control: + label: "{{ item.key }}" lineinfile: path: /etc/default/rng-tools line: '{{ item.key }}={{ item.value }}' regexp: '^#?{{ item.key }}=' - with_dict: '{{ rngd_config }}' - loop_control: - label: "{{ item.key }}" notify: restart rngd - name: Configure rngd [2/2] + loop: '{{ rngd_config | dict2items }}' + loop_control: + label: "{{ item.key }}" lineinfile: path: /etc/default/rng-tools regexp: '^{{ item.key }}=(?!{{ item.value }})' state: absent - with_dict: '{{ rngd_config }}' - loop_control: - label: "{{ item.key }}" notify: restart rngd - name: Provide a root shell on the VM console [1/2] diff --git a/roles/vm/host/tasks/main.yml b/roles/vm/host/tasks/main.yml index 010fdce4..562e502e 100644 --- a/roles/vm/host/tasks/main.yml +++ b/roles/vm/host/tasks/main.yml @@ -17,7 +17,7 @@ notify: restart haveged - name: make sure installer directories exists - with_items: + loop: - "{{ debian_installer_path }}" - "{{ preseed_path }}" file: diff --git a/roles/vm/install/tasks/main.yml b/roles/vm/install/tasks/main.yml index a971a7be..dc272b67 100644 --- a/roles/vm/install/tasks/main.yml +++ b/roles/vm/install/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: create disks for vm - with_dict: "{{ hostvars[hostname].install_cooked.disks.virtio | default({}) | combine(hostvars[hostname].install_cooked.disks.scsi | default({})) }}" + loop: "{{ hostvars[hostname].install_cooked.disks.virtio | default({}) | combine(hostvars[hostname].install_cooked.disks.scsi | default({})) | dict2items }}" lvol: vg: "{{ item.value.vg }}" lv: "{{ item.value.lv }}" diff --git a/roles/vm/network/tasks/main.yml b/roles/vm/network/tasks/main.yml index 9bef36ed..cb73ef6e 100644 --- a/roles/vm/network/tasks/main.yml +++ b/roles/vm/network/tasks/main.yml @@ -1,7 +1,7 @@ --- - block: - name: remove legacy systemd.link units - with_items: + loop: - 50-virtio-kernel-names.link - 99-default.link file: @@ -9,7 +9,7 @@ state: absent - name: install systemd network link units - with_items: "{{ network.systemd_link.interfaces }}" + loop: "{{ network.systemd_link.interfaces }}" loop_control: index_var: interface_index template: |