From 0fe18fea1ddfb6ca4bd555af02625fde39bc7a78 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 11 Oct 2025 19:37:27 +0200 Subject: [PATCH] Make iteration less verbose --- infrastructure/roles/users/tasks/main.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/infrastructure/roles/users/tasks/main.yaml b/infrastructure/roles/users/tasks/main.yaml index 43ecc25..b4e3448 100644 --- a/infrastructure/roles/users/tasks/main.yaml +++ b/infrastructure/roles/users/tasks/main.yaml @@ -5,12 +5,16 @@ groups: - sudo loop: "{{ users }}" + loop_control: + label: "{{ item.name }}" - name: accesible home directory (for web serving, for example) ansible.builtin.file: path: "/home/{{ item.name }}" state: directory mode: '0701' loop: "{{ users }}" + loop_control: + label: "{{ item.name }}" - name: create .ssh directory ansible.builtin.file: path: "/home/{{ item.name }}/.ssh" @@ -18,6 +22,8 @@ owner: "{{ item.name }}" group: "{{ item.name }}" loop: "{{ users }}" + loop_control: + label: "{{ item.name }}" - name: set authorized keys ansible.builtin.copy: dest: "/home/{{ item.name }}/.ssh/authorized_keys" @@ -26,3 +32,5 @@ mode: '0400' content: "{{ item.authorized_keys }}" loop: "{{ users }}" + loop_control: + label: "{{ item.name }}" -- 2.47.3