--- - name: Install vim community.general.pacman: name: vim state: present when: ansible_os_family == "Archlinux" - name: Install vim apt: name: vim state: present when: ansible_os_family == "Debian" - name: mkdir autoload ansible.builtin.file: path: "/home/{{ user.username }}/.vim/autoload" owner: "{{ user.username }}" state: directory - name: Install vim-plug get_url: url: "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" dest: "/home/{{ user.username }}/.vim/autoload/plug.vim" - name: user owns vim-plug ansible.builtin.file: path: "/home/{{ user.username }}/.vim/autoload/plug.vim" owner: "{{ user.username }}"