-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.yml
99 lines (84 loc) · 2.92 KB
/
configure.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
- hosts: localhost
tasks:
- name: Install packages
apt:
name: [ "zsh", "git", "tmux", "fzf", "curl", "deno"]
when: ansible_facts['os_family'] == "RedHat" or ansible_facts['os_family'] == "Debian"
# - name: Install a package with Homebrew
# homebrew:
# name: [ "zsh", "git", "tmux", "fzf", "curl", "deno"]
# when: ansible_facts['ansible_system'] == "Darwin"
- name: Ensure directories exists
file:
path: "~/{{ item }}"
state: directory
mode: '0755'
loop:
- debug
- any
- src
become: true
- name: Change shell
shell: chsh -s `which zsh`
become: true
- name: Check if Oh My Zsh is already installed
stat:
path: "{{ lookup('env', 'ZSH') | default('/home/{{ ansible_user }}/.oh-my-zsh') }}"
register: zsh_status
- name: Install Oh My Zsh
shell: curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
args:
executable: /bin/bash
when: not zsh_status.stat.exists
- name: Check if Powerlevel10k theme is already installed
stat:
path: "{{ (lookup('env', 'ZSH_CUSTOM') or lookup('env', 'HOME') + '/.oh-my-zsh/custom') + '/themes/powerlevel10k' }}"
register: p10k_status
- name: Install Powerlevel10k theme
shell: git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "{{ (lookup('env', 'ZSH_CUSTOM') or lookup('env', 'HOME') + '/.oh-my-zsh/custom') + '/themes/powerlevel10k' }}"
when: not p10k_status.stat.exists
- name: Install zsh plugin autosuggestion
ansible.builtin.git:
repo: https://github.com/zsh-users/zsh-autosuggestions.git
dest: ~/.oh-my-zsh/plugins/zsh-autosuggestions
#Below mainly configuration for myself, feel free to use it.
- name: Checkout Configuration Files
ansible.builtin.git:
repo: https://github.com/MahammadAgayev/devenv.git
dest: ~/devenv
#SHELL
- name: Fetch .zshrc
copy:
src: "~/devenv/.zshrc"
dest: ~/.zshrc
mode: '0644'
- name: Copy .p10k.zsh
copy:
src: "~/devenv/.p10k.zsh"
dest: ~/.p10k.zsh
mode: '0644'
- name: Copy tmux conf
copy:
src: "~/devenv/.tmux.conf"
dest: ~/.tmux.conf
mode: '0644'
- name: Copy tmux-sessionizer
copy:
src: "~/devenv/tmux-sessionizer"
dest: ~/tmux-sessionizer
mode: '0744'
#NeoVIM
- name: Copy Neovim Configuration
copy:
src: "~/devenv/nvim"
dest: ~/.config/
#Uber's go monorepo setup
- name: Check if the ~/go-code directory exists
stat:
path: "~/go-code"
register: dir_status
- name: Copy the file to $HOME/go-code if the directory exists
copy:
src: ".gomonorepo.envrc.local"
dest: "~/go-code/.envrc.local"
when: dir_status.stat.exists