- name: Check that Oh My ZSH is installed become_user: user stat: path: "~/.oh-my-zsh" register: ohmyzsh_result - name: Install Oh My ZSH become_user: user shell: sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" args: creates: "~/.oh-my-zsh" when: not ohmyzsh_result.stat.exists - name: Check that Auto Suggestions is installed become_user: user stat: path: ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions register: auto_suggestions_result - name: Install Auto Suggestions become_user: user shell: git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions when: not auto_suggestions_result.stat.exists - name: check if zshrc file was moved become_user: user stat: path: ~/.zshrc.pre-oh-my-zsh register: zshrc - name: Restore zshrc file become_user: user shell: rm ~/.zshrc && mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc when: zshrc.stat.exists == true - user: name: "user" shell: /usr/bin/zsh