-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathcreate_env.yml
More file actions
96 lines (85 loc) · 2.57 KB
/
Copy pathcreate_env.yml
File metadata and controls
96 lines (85 loc) · 2.57 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
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
---
- hosts: localhost
tasks:
# Work with Apps
- name: Ensure configured taps are tapped.
homebrew_tap: "tap={{ item }} state=present"
with_items: "{{ homebrew_taps }}"
when: homebrew_taps is defined
tags:
- apps
- brew
- cask
- name: Override mas-cli for macOS < 10.13.
shell: brew tap mas-cli/tap && brew install mas-cli/tap/mas
changed_when: false
when: ansible_distribution_version is version_compare('10.13', '<')
tags:
- apps
- mas
- brew
- name: Ensure configured homebrew packages are installed.
homebrew:
name: "{{ homebrew_mandatory_packages + homebrew_installed_packages }}"
state: present
when: homebrew_mandatory_packages is defined or homebrew_installed_packages is defined
tags:
- apps
- brew
- name: Install configured cask applications.
homebrew_cask:
name: "{{ item }}"
state: present
install_options: "appdir={{ homebrew_cask_appdir }}"
with_items: "{{ homebrew_cask_apps }}"
when: homebrew_cask_apps is defined
tags:
- apps
- cask
- name: List installed MAS apps.
command: mas list
register: mas_list
check_mode: no
changed_when: false
tags:
- apps
- mas
- name: Ensure configured MAS apps are installed.
command: mas install "{{ item.id|default(item) }}"
with_items: "{{ mas_installed_apps }}"
when: "'{{ item.id|default(item) }}' not in mas_list.stdout"
tags:
- apps
- mas
- name: Install configured pip applications.
pip:
name: "{{ pip_apps }}"
state: present
when: pip_apps is defined
tags:
- apps
- pip
# Work with Dock
- name: Remove selected from Dock
shell: dockutil --remove '{{ item }}'
ignore_errors: true
with_items: "{{ dockitems_to_remove }}"
when: "'All' not in dockitems_to_remove"
tags:
- dock
- name: Remove ALL from Dock if enabled
shell: dockutil --remove all
ignore_errors: true
when: "'All' in dockitems_to_remove"
tags:
- dock
- name: Check if items in dock exist
shell: dockutil --find '{{ item.name }}' || dockutil --add '{{ item.path }}' --label '{{ item.name }}'
with_items: "{{ dockitems_to_persist }}"
tags:
- dock
- name: Fix order
shell: dockutil --move '{{ item.name }}' --position {{ item.pos }}
with_items: "{{ dockitems_to_persist }}"
tags:
- dock