workstation-setup/local.yml

67 lines
1.4 KiB
YAML
Raw Normal View History

2021-12-24 11:17:59 +01:00
---
- hosts: localhost
connection: local
2021-12-24 12:56:04 +01:00
roles:
- role: gantsign.visual-studio-code
2021-12-24 14:29:45 +01:00
become: true
2021-12-24 12:56:04 +01:00
users:
- username: gianm
2021-12-24 11:17:59 +01:00
tasks:
2021-12-25 17:27:14 +01:00
- name: Set zsh main as shell
become: true
when: ansible_facts['os_family'] == "Debian"
shell: apt update
2021-12-24 11:17:59 +01:00
- name: Basic dev install
2021-12-24 14:29:45 +01:00
become: true
2021-12-24 11:17:59 +01:00
package:
name:
- zsh
2021-12-24 12:03:11 +01:00
- name: Set zsh main as shell
2021-12-24 12:05:28 +01:00
become: true
2021-12-24 12:23:02 +01:00
shell: chsh -s $(which zsh) gianm
2021-12-24 12:03:11 +01:00
2021-12-24 12:56:04 +01:00
- name: check if on my zsh is installed
stat:
2021-12-25 17:42:41 +01:00
path: "/home/gianm/.oh-my-zsh"
2021-12-24 12:56:04 +01:00
register: zsh_dir
2021-12-25 17:42:41 +01:00
- name: Install oh my zsh
debug:
msg: "skipping install oh my zsh"
when: zsh_dir.stat.exists
2021-12-27 14:00:58 +01:00
- name: Install oh my zsh
2021-12-27 14:11:20 +01:00
become_user: gianm
2021-12-27 14:00:58 +01:00
git:
repo: https://github.com/ohmyzsh/ohmyzsh.git
dest: ~/.oh-my-zsh
depth: 1
2021-12-25 18:14:16 +01:00
- name: Setup .zshrc
2021-12-27 14:11:20 +01:00
become_user: gianm
2021-12-25 17:27:14 +01:00
copy:
src: files/zshrc
2021-12-27 14:11:20 +01:00
dest: ~/.zshrc
2021-12-27 14:00:58 +01:00
mode: 0644
2021-12-25 17:27:14 +01:00
2021-12-25 18:14:16 +01:00
- name: Setups .profile
2021-12-27 14:11:20 +01:00
become_user: gianm
2021-12-25 17:27:14 +01:00
copy:
src: files/profile
2021-12-27 14:11:20 +01:00
dest: ~/.profile
2021-12-27 14:00:58 +01:00
mode: 0644
2021-12-25 18:14:16 +01:00
- name: install nvm
2021-12-27 14:11:20 +01:00
become_user: gianm
2021-12-25 19:41:20 +01:00
shell: zsh -c "$(wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh -O -)"
2021-12-25 18:14:16 +01:00
args:
2021-12-25 18:52:02 +01:00
creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh"
2021-12-27 14:00:58 +01:00
- name: install node
2021-12-27 14:11:20 +01:00
become_user: gianm
2021-12-27 14:18:16 +01:00
shell: source ~/.zshrc && nvm install --lts
2021-12-27 14:17:07 +01:00
args:
executable: /usr/bin/zsh