workstation-setup/local.yml

67 lines
1.4 KiB
YAML

---
- 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_user: gianm
git:
repo: https://github.com/ohmyzsh/ohmyzsh.git
dest: ~/.oh-my-zsh
depth: 1
- name: Setup .zshrc
become_user: gianm
copy:
src: files/zshrc
dest: ~/.zshrc
mode: 0644
- name: Setups .profile
become_user: gianm
copy:
src: files/profile
dest: ~/.profile
mode: 0644
- name: install nvm
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_user: gianm
ansible.builtin.shell: source ~/.zshrc && nvm install --lts
args:
executable: /usr/bin/zsh