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