--- - name: Check .profile status stat: path: "/home/{{ user_name }}/.profile" register: profile - name: Delete profile if not a link file: path: "/home/{{ user_name }}/.profile" state: absent when: profile.stat.islnk is defined and profile.stat.islnk == False - name: Apply dotfiles command: "stow --target /home/{{ user_name }}/ --dir /home/{{ user_name }}/.local/share/dotfiles {{ item }}" with_items: - bash - sh - vim