-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.yml
More file actions
63 lines (58 loc) · 2.1 KB
/
Copy pathmain.yml
File metadata and controls
63 lines (58 loc) · 2.1 KB
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
---
- name: Configure local host
hosts: localhost
vars:
ansible_python_interpreter: /usr/bin/python3
vars_files:
- config.default.yml
pre_tasks:
- name: Python interpreter
debug: { var: ansible_python_interpreter }
tags: [always]
- name: Ensure python3
assert: { that: ansible_facts.python_version > "2" }
tags: [always]
- name: Provision SOPS and variables
include_role:
name: sops
apply: { tags: [always] }
when: sops_file is defined
tags: [always]
# Rm after tap trust is supported: https://github.com/geerlingguy/ansible-collection-mac/issues/127
- name: Resolve Homebrew executable path
set_fact:
homebrew_brew_cmd: "{{ (ansible_facts.machine == 'arm64') | ternary('/opt/homebrew/bin/brew', '/usr/local/bin/brew') }}"
tags: [brew]
- name: Check if Homebrew is already installed
stat:
path: "{{ homebrew_brew_cmd }}"
register: homebrew_brew_cmd_stat
tags: [brew]
- name: Ensure configured taps are tapped before trust
homebrew_tap:
tap: "{{ item.name | default(item) }}"
url: "{{ item.url | default(omit) }}"
state: present
loop: "{{ homebrew_taps | default([]) }}"
when:
- homebrew_brew_cmd_stat.stat.exists
- (homebrew_taps | default([])) | length > 0
tags: [brew]
- name: Trust configured taps before formula install
command: "{{ homebrew_brew_cmd }} trust {{ item.name | default(item) }}"
loop: "{{ homebrew_taps | default([]) }}"
changed_when: false
when:
- homebrew_brew_cmd_stat.stat.exists
- (homebrew_taps | default([])) | length > 0
tags: [brew]
roles:
- { role: elliotweiser.osx-command-line-tools, tags: [install] }
- { role: dotfiles, tags: [dotfiles] }
- { role: geerlingguy.mac.homebrew, tags: [brew] }
- { role: geerlingguy.mac.mas, tags: [mas] }
- { role: python, tags: [python] }
- { role: java, tags: [java] }
# - {role: macos, tags: [macos]}
- { role: ide, tags: [ide] }
# - {role: geerlingguy.mac.dock, tags: [dock]}