-
Notifications
You must be signed in to change notification settings - Fork 1
/
playbook.yml
161 lines (143 loc) · 4.47 KB
/
playbook.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
---
# Based on https://www.redhat.com/sysadmin/ansible-configure-vim
- name: Config Vim with plugins
hosts: localhost
gather_facts: yes
become: no
vars:
vim_dir: "{{ ansible_env.HOME }}/.vim"
fzf_dir: "{{ ansible_env.HOME }}/.fzf"
download_dir: "{{ ansible_env.HOME }}/Downloads"
nodejs_dir: "{{ ansible_env.HOME }}/nodejs"
nodejs_url: "https://nodejs.org/dist/v16.15.1/node-v16.15.1-linux-x64.tar.gz"
nodejs_sha256sum: "f78a49c0c9c2f546c3a44eb434c49a852125441422a1bcfc433dedc58d6a241c"
pyenv_dir: "{{ ansible_env.HOME }}/.pyenv"
spack_dir: "{{ ansible_env.HOME }}/spack"
tasks:
- name: apply dotfiles role
include_role:
name: geerlingguy.dotfiles
- name: clone fzf git repo
ansible.builtin.git:
dest: "{{ fzf_dir }}"
repo: https://github.com/junegunn/fzf.git
clone: yes
depth: 1
update: yes
version: master
- name: Install fzf binary
ansible.builtin.command: "{{ fzf_dir }}/install --bin"
args:
creates: "{{ fzf_dir }}/bin/fzf"
- name: Ensure .vim folders exist
ansible.builtin.file:
path: "{{ item }}"
state: directory
recurse: no
mode: 0750
loop:
- "{{ vim_dir }}"
- "{{ vim_dir }}/autoload"
- "{{ vim_dir }}/bundle"
- "{{ vim_dir }}/undodir"
- name: Create ~/modules folder
ansible.builtin.file:
path: "{{ ansible_env.HOME }}/modules"
state: directory
recurse: no
mode: 0700
- name: Install vim-plug
ansible.builtin.get_url:
dest: "{{ vim_dir }}/autoload/plug.vim"
url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
mode: 0600
- name: Create folders
file:
path: "{{ item }}"
state: directory
mode: 0700
loop:
- "{{ download_dir }}"
- "{{ nodejs_dir }}"
- name: Download nodejs
ansible.builtin.get_url:
dest: "{{ download_dir }}/nodejs.tar.gz"
url: "{{ nodejs_url }}"
checksum: "sha256:{{ nodejs_sha256sum }}"
mode: 0600
- name: untar nodejs
ansible.builtin.unarchive:
src: "{{ download_dir }}/nodejs.tar.gz"
dest: "{{ nodejs_dir }}"
creates: "{{ nodejs_dir }}/bin/node"
remote_src: yes
mode: 0700
extra_opts:
- --strip-components=1
- name: Install github cli
include_tasks: gh_cli.yml
tags: github
- name: Install pyenv tasks
include_tasks: pyenv.yml
tags: pyenv
- name: source bashrc.d in bashrc
ansible.builtin.lineinfile:
path: ~/.bashrc
line: "[ -f ~/.bashrc.d/bashrc.init ] && source ~/.bashrc.d/bashrc.init"
- name: Create regolith config folder
ansible.builtin.file:
path: "{{ ansible_env.HOME }}/.config/regolith"
state: directory
mode: '0700'
- name: Link regolith config to dotfiles git repo
ansible.builtin.file:
src: "{{ dotfiles_repo_local_destination }}/.config/regolith/i3"
dest: "{{ dotfiles_home }}/.config/regolith/i3"
state: link
- name: Link regolith2 config to dotfiles git repo
ansible.builtin.file:
src: "{{ dotfiles_repo_local_destination }}/.config/regolith2"
dest: "{{ dotfiles_home }}/.config/regolith"
state: link
- name: Set git config
community.general.git_config:
name: "{{ item.name }}"
scope: global
value: "{{ item.value }}"
loop:
- name: push.default
value: matching
- name: gc.auto
value: 1
- name: core.excludesfile
value: "{{ ansible_env.HOME }}/.gitignore_global"
- name: gpg.program
value: gpg
- name: commit.gpgSign
value: "true"
- name: pull.rebase
value: "true"
- name: tag.gpgSign
value: "true"
- name: feature.manyFiles
value: "true"
- name: Add git aliases
community.general.git_config:
name: "alias.{{ item.name }}"
scope: global
value: "{{ item.value }}"
loop:
- name: br
value: branch
- name: co
value: checkout
- name: st
value: status
- name: tree
value: log --graph --oneline --all
- name: Install spack
ansible.builtin.git:
repo: 'https://github.com/spack/spack.git'
dest: "{{ spack_dir }}"
version: develop
depth: 1