From: Christian Pointner Date: Tue, 16 Jul 2019 20:36:39 +0000 (+0200) Subject: nicer loop labels X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=b04196adbd6d15535651fbcaa3baddd22179887d;p=noc.git nicer loop labels --- diff --git a/ansible/roles/debian-installer/tasks/main.yml b/ansible/roles/debian-installer/tasks/main.yml index eb32f6a..77228e9 100644 --- a/ansible/roles/debian-installer/tasks/main.yml +++ b/ansible/roles/debian-installer/tasks/main.yml @@ -1,15 +1,15 @@ - name: prepare directories for installer images - with_subelements: - - "{{ distros }}" - - arch + loop: "{{ distros | subelements('arch') }}" + loop_control: + label: "{{ item.0.distro }}/{{ item.0.codename }} {{ item.1 }}" file: name: "{{ debian_installer_path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}" state: directory - name: download installer kernel images - with_subelements: - - "{{ distros }}" - - arch + loop: "{{ distros | subelements('arch') }}" + loop_control: + label: "{{ item.0.distro }}/{{ item.0.codename }} {{ item.1 }}" get_url: url: "{{ debian_installer_url[item.0.distro] }}/dists/{{ item.0.codename }}/main/installer-{{ item.1 }}/current/images/netboot/{{ item.0.distro }}-installer/{{ item.1 }}/linux" dest: "{{ debian_installer_path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}/linux" @@ -17,9 +17,9 @@ force: "{{ debian_installer_force_download }}" - name: download installer initrd.gz - with_subelements: - - "{{ distros }}" - - arch + loop: "{{ distros | subelements('arch') }}" + loop_control: + label: "{{ item.0.distro }}/{{ item.0.codename }} {{ item.1 }}" get_url: url: "{{ debian_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: "{{ debian_installer_path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}/initrd.gz" diff --git a/ansible/roles/vm/install/tasks/main.yml b/ansible/roles/vm/install/tasks/main.yml index a883758..4970393 100644 --- a/ansible/roles/vm/install/tasks/main.yml +++ b/ansible/roles/vm/install/tasks/main.yml @@ -1,6 +1,8 @@ --- - name: create disks for vm with_dict: "{{ hostvars[hostname].install_cooked.disks.virtio | default({}) | combine(hostvars[hostname].install_cooked.disks.scsi | default({})) }}" + loop_control: + label: "{{ item.value.vg }} / {{ item.value.lv }} ({{ item.value.size }})" lvol: vg: "{{ item.value.vg }}" lv: "{{ item.value.lv }}" diff --git a/ansible/roles/vm/network/tasks/main.yml b/ansible/roles/vm/network/tasks/main.yml index c972eed..baae455 100644 --- a/ansible/roles/vm/network/tasks/main.yml +++ b/ansible/roles/vm/network/tasks/main.yml @@ -11,6 +11,7 @@ - name: install systemd network link units with_items: "{{ network.systemd_link.interfaces }}" loop_control: + label: "{{ item.name }}" index_var: interface_index template: src: systemd.link.j2