-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.yml
133 lines (117 loc) · 3.78 KB
/
main.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
---
- name: Set up development workstations the way I like them!
hosts:
- dev_boxes
- test_boxes
- localhost
vars:
# determine where the playbook is on the target machine
# when local: use playbook_dir, which is a built in var for where playbook is on the host
# when on ssh: dev_playbook_checkout_dir is supplied by host or group vars to check it out
dev_playbook_directory: "{{ playbook_dir if ansible_connection == 'local' else dev_playbook_checkout_dir }}"
pre_tasks:
- name: Update packages
become: true
ansible.builtin.apt:
update_cache: true
changed_when: false
- name: Install python dependencies for playbook
ansible.builtin.pip:
name:
# these dependencies needed for modules later on
# experimentally discovered
- requests
- psutil
tasks:
# make it easy to run this playbook
- name: Ensure directories exist
ansible.builtin.file:
dest: "{{ item }}"
state: directory
with_items:
- ~/.local/bin
- ~/code
- name: Make sure this repo exists on dev box
ansible.builtin.git:
repo: https://github.com/kentbrockman/dev-playbook.git
dest: ~/code/dev-playbook/
update: false
- name: Add run-dev-playbook to local scripts
tags:
- run-dev-playbook
ansible.builtin.template:
src: files/run-dev-playbook.sh
dest: ~/.local/bin/run-dev-playbook.sh
mode: 0544
- name: Install dotfiles
ansible.builtin.import_tasks: tasks/dotfiles.yml
tags:
- dotfiles
when: install_dotfiles
- name: Set up nice terminal experience
ansible.builtin.import_tasks: tasks/terminal.yml
tags:
- terminal
- name: Set up nice tmux experience
ansible.builtin.import_tasks: tasks/tmux-plugins.yml
tags:
- tmux-plugins
- name: Set up remote access options (e.g. ssh)
ansible.builtin.import_tasks: tasks/remote-access.yml
tags:
- remote-access
# set up GUI experience
- name: Configure web browser (firefox)
ansible.builtin.import_tasks: tasks/web-browser.yml
tags:
- web-browser
- name: Install applications we commonly use
ansible.builtin.import_tasks: tasks/applications.yml
tags:
- applications
- name: Set up nice gnome-desktop experience
ansible.builtin.import_tasks: tasks/gnome-desktop.yml
tags:
- gnome-desktop
# development tools
# TODO: add langserver installations
- name: Install dev tooling for writing python
ansible.builtin.import_tasks: tasks/python-dev.yml
tags:
- python-dev
- name: Install dev tooling for writing JS
ansible.builtin.import_tasks: tasks/javascript-dev.yml
tags:
- javascript-dev
- name: Install dev tooling for writing golang
ansible.builtin.import_tasks: tasks/golang-dev.yml
tags:
- golang-dev
- name: Install dev tooling for infrastructure development
ansible.builtin.import_tasks: tasks/ops-dev.yml
tags:
- ops-dev
# text editors
- name: Set up vscode
ansible.builtin.import_tasks: tasks/vscode.yml
tags:
- vscode
- name: Set up neovim
ansible.builtin.import_tasks: tasks/neovim.yml
tags:
- neovim
- name: Set up helix
ansible.builtin.import_tasks: tasks/helix.yml
tags:
- helix
# other things
- name: Set up syncthing
ansible.builtin.import_tasks: tasks/sync-content.yml
tags:
- sync-content
when: sync_content
- name: Set up battery management tools
ansible.builtin.import_tasks: tasks/battery-management.yml
tags:
- battery-management
when: install_battery_management_tools