--- - name: workspaces directory file: path: ~/.workspaces state: directory - name: workspace focus scripts template: src: workspaces/workspace.focus.fish.j2 dest: ~/.workspaces/{{workspace}}.focus mode: 0755 with_items: "{{workspaces|dict2items|json_query(\"[?value.type=='vdesk'].key\") }}" loop_control: loop_var: workspace - name: workspace space shortcut scripts template: src: workspaces/workspace.space.fish.j2 dest: ~/.workspaces/{{workspace}}.space mode: 0755 with_items: "{{workspaces|dict2items|json_query(\"[?value.type=='vncviewer'||value.type=='tmux'].key\") }}" loop_control: loop_var: workspace