-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.yml
103 lines (81 loc) · 2.62 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
---
- name: Bootstrap dev tools
hosts: all
vars_files:
- config/local.yml
- ~/projects/itstommymorgan/dotfiles/config.yml
pre_tasks:
- import_tasks: tasks/sudoer.yml
roles:
- role: elliotweiser.osx-command-line-tools
- role: geerlingguy.dotfiles
tasks:
- name: Register current hostname
ansible.builtin.shell: hostname
register: current_hostname
- name: Set Hostname
ansible.builtin.hostname:
name: "{{ locals.hostname }}"
when: current_hostname.stdout != locals.hostname
- name: Detect CPU Type
ansible.builtin.command: uname -m
register: cpu_type
- name: Install Rosetta
ansible.builtin.command: softwareupdate --install-rosetta --agree-to-license
when: cpu_type.stdout.find('arm64') != -1
- name: Create company projects folder
ansible.builtin.command: mkdir -p ~/projects/{{ locals.company_name }}
when: locals.company_name != ""
- name: Homebrew and Ruby
hosts: all
vars_files:
- config/homebrew.yml
- config/rbenv.yml
roles:
- role: geerlingguy.mac.homebrew
- role: zzet.rbenv
- name: PGP setup and decryption
hosts: all
tasks:
- name: Register public key list
ansible.builtin.command: gpg --list-keys
register: public_key_list
- name: Register private key list
ansible.builtin.command: gpg --list-secret-keys
register: private_key_list
- name: Import public key
ansible.builtin.command: op read op://Private/pgp/public | gpg --import
when: public_key_list.stdout.find('[email protected]') == -1
- name: Import private key
ansible.builtin.command: op read op://Private/pgp/private | gpg --import
when: private_key_list.stdout.find('[email protected]') == -1
- name: Decrypt the repository
ansible.builtin.command: git-crypt unlock
- name: Mac configuration
hosts: all
vars_files:
- config/mas.yml
- config/startup_apps.yml
roles:
- role: geerlingguy.mac.homebrew
- role: geerlingguy.mac.mas
tasks:
- import_tasks: tasks/startup_apps.yml
- name: Install Package Manager Dependencies
hosts: all
vars_files:
- config/packages.yml
environment:
PATH: ~/.rbenv/shims:{{ ansible_env.PATH }}
tasks:
- import_tasks: tasks/extra-packages.yml
- name: Remind about any manual steps that need to be performed
hosts: all
tasks:
- name: Register Vimcal path
stat:
path: /Applications/Vimcal
register: vimcal_path
- name: Check Vimcal
ansible.builtin.command: echo "Install Vimcal - https://www.vimcal.com/downloads/mac-m1"
when: vimcal_path.stat.exists