-
Notifications
You must be signed in to change notification settings - Fork 1
/
homedir-setup.yaml
95 lines (86 loc) · 2.56 KB
/
homedir-setup.yaml
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
---
# Ansible playbook to set up or update my home directory and related stuff.
- name: Homedir setup
hosts: all
tasks:
- name: Install packages
ansible.builtin.package:
name:
- diff-so-fancy
- git
- gnupg
- keychain
- pinentry-mac
- vim
- zsh-autosuggestions
- zsh-completions
- zsh-syntax-highlighting
state: installed
when: ansible_facts.os_family == 'Darwin'
- name: Create my git repo directory
ansible.builtin.import_tasks: tasks/ensure-git-dir.yaml
- name: Update my git repos
ansible.builtin.import_tasks: tasks/update-sysadmin-repos.yaml
- name: Create ~/.ssh and ~/.gnupg
ansible.builtin.file:
state: directory
mode: "0700"
path: "{{ ansible_user_dir }}/{{ item }}"
loop:
- .gnupg
- .ssh
- name: Create other directories
ansible.builtin.file:
state: directory
recurse: true
path: "{{ ansible_user_dir }}/{{ item }}"
loop:
- .config/git
- name: Create symlinks to dotfiles
ansible.builtin.file:
state: link
force: true
path: "{{ ansible_user_dir }}/{{ item }}"
src: "{{ ansible_user_dir }}/git/dotfiles/{{ item }}"
loop:
- .aspell.en.prepl
- .aspell.en.pws
- .config/git/ignore
- .emacs.d
- .gitconfig
- .inputrc
- .profile
- .screenrc
- .signature
- .tmux.conf
- .vim
- .vimrc
- .zlogin
- .zshenv
- .zshrc
when: ansible_facts.os_family == 'Darwin'
- name: Create symlinks to more dotfiles
ansible.builtin.file:
state: link
force: true
path: "{{ ansible_user_dir }}/{{ item }}"
src: "{{ ansible_user_dir }}/git/sysadmin/dotfiles/{{ item }}"
loop:
- .gnupg/gpg-agent.conf
- .gnupg/gpg.conf
- name: Create vim-gnupg directories
ansible.builtin.file:
state: directory
recurse: true
path: "{{ ansible_user_dir }}/.vim/pack/gnupg/start"
- name: Clone or update vim-gnupg # noqa: latest
ansible.builtin.git:
repo: [email protected]:jamessan/vim-gnupg.git
dest: "{{ ansible_user_dir }}/.vim/pack/gnupg/start/vim-gnupg"
update: true
- name: Set secure directory permissions to allow zsh to load completions
ansible.builtin.file:
path: /usr/local/share
recurse: true
mode: go-w
when: ansible_facts.os_family == 'Darwin'