-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.yml
56 lines (45 loc) · 1.45 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
---
- hosts: localhost
user: '{{ username }}'
connection: local
vars_files:
- vars/main.yml
- vars/local.yml
roles:
- geerlingguy.mac.homebrew
tasks:
# Configure Git
- name: "Set default branch"
command: git config --global init.defaultBranch main
- name: "Set Git name"
command: "git config --global user.name '{{ git_name }}'"
- name: "Set Git mail"
command: "git config --global user.email '{{ git_email }}'"
- name: "Create SSH key"
openssh_keypair:
path: "~/.ssh/id_rsa"
type: rsa
size: 4096
state: present
force: no
ignore_errors: yes
# Setup Oh My ZSH
- name: Check if oh-my-zsh is installed
stat:
path: ~/.oh-my-zsh/
register: oh_my_zsh
- name: Install Oh My ZSH
shell: sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
when: not oh_my_zsh.stat.exists
- name: ZSH Autosuggestions
shell: git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
when: not oh_my_zsh.stat.exists
- name: Append git to plugins in .zshrc
lineinfile:
path: ~/.zshrc
regexp: '^plugins='
line: 'plugins=(git bundler dotenv rake rbenv ruby npm zsh-autosuggestions)'
backup: yes
- name: Reload .zshrc
shell: source ~/.zshrc
when: oh_my_zsh.stat.exists