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-25 18:14:16 +01:00
- name: install oh my zsh
2021-12-25 18:28:03 +01:00
become: true
2021-12-24 12:03:11 +01:00
become_user: gianm
2021-12-24 12:56:04 +01:00
when: not zsh_dir.stat.exists
2021-12-24 12:03:11 +01:00
shell: sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
2021-12-25 18:14:16 +01:00
- name: Setup .zshrc
2021-12-25 17:27:14 +01:00
copy:
src: files/zshrc
dest: /home/gianm/.zshrc
owner: gianm
group: gianm
2021-12-25 18:14:16 +01:00
- name: Setups .profile
2021-12-25 17:27:14 +01:00
copy:
src: files/profile
dest: /home/gianm/.profile
owner: gianm
group: gianm
2021-12-25 18:14:16 +01:00
- name: install nvm
2021-12-25 19:45:09 +01:00
become: true
2021-12-25 18:14:16 +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"
- name: install node
2021-12-25 19:05:16 +01:00
become: true
become_user: gianm
2021-12-25 19:16:35 +01:00
shell: zsh && source /home/gianm/.zshrc && nvm install --lts