-
Notifications
You must be signed in to change notification settings - Fork 0
/
laptop.yml
107 lines (92 loc) · 2.94 KB
/
laptop.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
--- # playbook for configuring dell latitude 5400 with Ubuntu
# first run: wget sfs.connorrhodes.com/bootstrap/ubuntu.sh && bash ubuntu.sh, then configure ssh access
- name: Configure personal laptop
hosts: latitude
vars_files:
- host_vars/laptop/secrets.yml
- host_vars/laptop/packages.yml
tasks:
- name: "Update apt cache"
become: true
apt:
update_cache: true
- name: "Upgrade packages"
become: true
apt:
upgrade: safe
autoremove: yes
- name: "Install packages"
become: true
package:
name: "{{ install_packages }}"
state: present
- name: 'Add the flathub flatpak repository remote to the user installation'
community.general.flatpak_remote:
name: flathub
state: present
flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
method: user
- name: "Install flatpak packages"
community.general.flatpak:
name: "{{ flatpak_packages }}"
state: present
method: user
- name: 'Create code directory'
file:
path: "{{ lookup('env', 'HOME') }}/code"
state: directory
mode: '0755'
- name: Check if the directory already exists
stat:
path: "{{ lookup('env', 'HOME') }}/code/devct-laptop"
register: devct_cloned
- name: Clone the repository into the specified subfolder
git:
repo: '[email protected]:0xConnorRhodes/devct-laptop.git'
dest: "{{ lookup('env', 'HOME') }}/code/devct-laptop"
version: 'HEAD'
accept_hostkey: yes
when: not devct_cloned.stat.exists
- name: Create secret directory
file:
path: "{{ lookup('env', 'HOME') }}/.local/.secret"
state: directory
mode: '0755'
- name: copy dotfiles encryption key
copy:
src: configs/laptop/age-chezmoi-key.txt
dest: "{{ lookup('env', 'HOME') }}/.local/.secret/age-chezmoi-key.txt"
- name: Symlink for bat
become: true
ansible.builtin.file:
src: /usr/bin/batcat
dest: /usr/local/bin/bat
state: link
- name: Symlink for fd
become: true
ansible.builtin.file:
src: /usr/bin/fdfind
dest: /usr/local/bin/fd
state: link
roles:
- role: generate_ssh_key
- role: PeterMosmans.customize-gnome
vars:
gnome_extensions:
- id: 517 # caffeine
enable: true
gnome_dconf:
- key: /org/gnome/shell/disabled-extensions
value: ['[email protected]']
- key: /org/gnome/desktop/input-sources/xkb-options
value: ['ctrl:nocaps']
- role: hussainweb.chezmoi
chezmoi_init_url: "0xConnorRhodes"
- role: geerlingguy.docker
become: true
vars:
docker_install_compose_plugin: true
docker_compose_package: docker-compose-plugin
docker_compose_package_state: present
docker_users:
- "{{ user }}"