Compare commits

...

16 Commits

4 changed files with 87 additions and 34 deletions

View File

@@ -101,6 +101,3 @@ source $ZSH/oh-my-zsh.sh
# alias ohmyzsh="mate ~/.oh-my-zsh" # alias ohmyzsh="mate ~/.oh-my-zsh"
source ~/.profile source ~/.profile
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"

110
local.yml
View File

@@ -1,6 +1,12 @@
--- ---
- hosts: localhost - hosts: localhost
become: true
connection: local connection: local
vars_files:
- vars/packages.yml
vars:
tmp_dir: /tmp-ansibe
discord_url: https://discordapp.com/api/download?format=deb&platform=linux
roles: roles:
- role: gantsign.visual-studio-code - role: gantsign.visual-studio-code
become: true become: true
@@ -8,20 +14,61 @@
- username: gianm - username: gianm
tasks: tasks:
- name: Set zsh main as shell - name: Creates temporary directory
file:
path: "{{ tmp_dir }}"
state: directory
- name: get script to add repository nodejs
become: true become: true
when: ansible_facts['os_family'] == "Debian" when: ansible_facts['os_family'] == "Debian"
shell: apt update get_url:
url: "https://deb.nodesource.com/setup_lts.x"
dest: "{{ tmp_dir }}/node-add.sh"
mode: '774'
- name: Basic dev install - name: execute scritp to add repository nodejs
become: true
when: ansible_facts['os_family'] == "Debian"
command: "{{ tmp_dir }}/node-add.sh"
register: source_added
changed_when: source_added.rc != 0
- name: execute scritp to add repository nodejs
become: true
when: ansible_facts['os_family'] == "Debian"
command: "{{ tmp_dir }}/node-add.sh"
register: source_added
changed_when: source_added.rc != 0
- name: DISCORD - Download discord
get_url:
url: "{{ discord_url }}"
dest: "{{ tmp_dir }}/discord.deb"
force: yes
- name: DISCORD - Install my_package
apt:
deb: "{{ tmp_dir }}/discord.deb"
- name: Update apt repository
become: true
when: ansible_facts['os_family'] == "Debian"
command: apt update
- name: Installing {{ packages }}
become: true become: true
package: package:
name: name: "{{ item }}"
- zsh state: present
with_items: "{{ packages }}"
- name: Set zsh main as shell - name: Set zsh main as command
become: true become: true
shell: chsh -s $(which zsh) gianm command: chsh -s $(which zsh) gianm
register: shell_change
changed_when: shell_change.rc != 0
when: ansible_user_shell == "/bin/bash"
- name: check if on my zsh is installed - name: check if on my zsh is installed
stat: stat:
@@ -33,36 +80,43 @@
msg: "skipping install oh my zsh" msg: "skipping install oh my zsh"
when: zsh_dir.stat.exists when: zsh_dir.stat.exists
- name: install oh my zsh - name: Install oh my zsh
become: true
become_user: gianm become_user: gianm
when: not zsh_dir.stat.exists git:
shell: sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" repo: https://github.com/ohmyzsh/ohmyzsh.git
version: 'latest'
dest: ~/.oh-my-zsh
depth: 1
- name: Setup .zshrc - name: Setup .zshrc
become_user: gianm
copy: copy:
src: files/zshrc src: files/zshrc
dest: /home/gianm/.zshrc dest: ~/.zshrc
owner: gianm mode: 0644
group: gianm
- name: Setups .profile - name: Setup .profile
become_user: gianm
copy: copy:
src: files/profile src: files/profile
dest: /home/gianm/.profile dest: ~/.profile
mode: 0644
- name: create local dir for node packages
become_user: gianm
file:
path: ~/.npm-global
state: directory
owner: gianm owner: gianm
group: gianm mode: 0644
- name: install nvm - name: EACCESS fix
become: true
become_user: gianm become_user: gianm
shell: zsh -c "$(wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh -O -)" command: npm config set prefix '~/.npm-global'
args: register: updated_npm
creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh" changed_when: updated_npm.rc != 0
- name: install node - name: Remove temporary directory
become: true file:
become_user: gianm path: "{{ tmp_dir }}"
shell: nvm install --lts state: absent
args:
executable: /usr/bin/zsh

View File

@@ -1,4 +1,4 @@
#! bin/bash #! bin/bash
wget https://git.jatus.tech/Jatus/workstation-setup/raw/branch/main/requirments.yml wget https://git.jatus.tech/Jatus/workstation-setup/raw/branch/main/requirments.yml
ansible-galaxy install -r requirments.yml ansible-galaxy install -r requirments.yml
ansible-pull -U https://git.jatus.tech/Jatus/workstation-setup.git ansible-pull -U https://git.jatus.tech/Jatus/workstation-setup.git -K --ask-vault-pass

2
vars/packages.yml Normal file
View File

@@ -0,0 +1,2 @@
---
packages: ["zsh", "yadm", "nodejs","firefox","chromium","telegram-desktop"]