- name: Check if Oh My Zsh is already installed stat: path: "{{ user_home }}/.oh-my-zsh" register: oh_my_zsh_installed notify: Debug Oh My Zsh installation status - name: Debug Oh My Zsh installation status debug: msg: "Oh My Zsh is {{ 'installed' if oh_my_zsh_installed.stat.exists else 'not installed' }}" when: oh_my_zsh_installed is defined - name: Download Oh My Zsh install script using wget get_url: url: https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh dest: /tmp/install-ohmyzsh.sh mode: '0755' # Makes it executable when: not oh_my_zsh_installed.stat.exists - name: Install Oh My Zsh for the current user shell: | RUNZSH=no CHSH=no sh /tmp/install-ohmyzsh.sh args: creates: "{{ user_home }}/.oh-my-zsh" when: not oh_my_zsh_installed.stat.exists become: true become_user: "{{ ansible_user }}" - name: Clone zsh-syntax-highlighting repository git: repo: 'https://github.com/zsh-users/zsh-syntax-highlighting.git' dest: "{{ user_home }}/.oh-my-zsh/plugins/zsh-syntax-highlighting" version: master