workstation-setup/local.yml

67 lines
1.5 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-27 14:23:15 +01:00
shell: wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
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:23:15 +01:00
shell: export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && nvm install --lts
2021-12-27 14:17:07 +01:00
args:
executable: /usr/bin/zsh