-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacos.yml
74 lines (62 loc) · 2.37 KB
/
macos.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
---
- name: The Primary macOSa Playbook
hosts: macos
connection: local
become: no
pre_tasks:
- name: Include default variables
include_vars:
dir: vars
tags: [ always ]
- name: Include user-supplied variables
include_vars:
dir: user/vars
ignore_files: [ ".keep", ".DS_Store" ]
tags: [ always ]
- name: Get a list of all user-supplied pre tasks to include
find:
paths: "{{ playbook_dir }}/user/tasks/pre"
patterns: "*.yml"
register: user_pre_tasks
changed_when: false
tags: [ mymacosa ]
- name: Include user-supplied pre tasks
include_tasks: "{{ user_pre_task_file.path }}"
with_items: "{{ user_pre_tasks.files }}"
loop_control:
loop_var: "user_pre_task_file"
tags: [ mymacosa ]
- name: See if user .bash_profile exists
stat:
path: "/Users/{{ ansible_user_id }}/.bash_profile"
register: user_bash_profile
changed_when: false
tags: [ always ]
- name: Ensure initial .bash_profile is present
copy:
dest: "/Users/{{ ansible_user_id }}/.bash_profile"
content: "# macOSa manages a good deal of this file, you probably don't want to edit in here directly"
when: not user_bash_profile.stat.exists
tags: [ always ]
roles:
- { role: homebrew, when: "'homebrew' in include_macosa_roles", tags: [ homebrew ] }
- { role: xenv, when: "'xenv' in include_macosa_roles", tags: [ xenv ] }
- { role: docker-for-mac, when: "'docker-for-mac' in include_macosa_roles", tags: [ docker-for-mac, docker ] }
- { role: browsers, when: "'browsers' in include_macosa_roles", tags: [ browsers ] }
- { role: aws, when: "'aws' in include_macosa_roles", tags: [ aws ] }
- { role: user, when: "'user' in include_macosa_roles", tags: [ user ] }
- { role: system, when: "'system' in include_macosa_roles", tags: [ system ] }
tasks:
- name: Get a list of all user-supplied post tasks to include
find:
paths: "{{ playbook_dir }}/user/tasks/post"
patterns: "*.yml"
register: user_post_tasks
changed_when: false
tags: [ mymacosa ]
- name: Include user-supplied post tasks
include_tasks: "{{ user_post_task_file.path }}"
with_items: "{{ user_post_tasks.files }}"
loop_control:
loop_var: "user_post_task_file"
tags: [ mymacosa ]