--- - hosts: localhost connection: local roles: - role: gantsign.visual-studio-code become: true users: - username: gianm tasks: - name: Set zsh main as shell become: true when: ansible_facts['os_family'] == "Debian" shell: apt update - name: Basic dev install become: true package: name: - zsh - name: Set zsh main as shell become: true shell: chsh -s $(which zsh) gianm - name: check if on my zsh is installed stat: path: "/home/gianm/.oh-my-zsh" register: zsh_dir - name: Install oh my zsh debug: msg: "skipping install oh my zsh" when: zsh_dir.stat.exists - name: install oh my zsh become: true become_user: gianm when: not zsh_dir.stat.exists shell: sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" - name: Setup .zshrc copy: src: files/zshrc dest: /home/gianm/.zshrc owner: gianm group: gianm - name: Setups .profile copy: src: files/profile dest: /home/gianm/.profile owner: gianm group: gianm - name: install nvm become: true become_user: gianm shell: zsh -c "$(wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh -O -)" args: creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh" - name: install node become: true become_user: gianm shell: zsh && source /home/gianm/.zshrc && nvm install --lts