-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaybook.yml
More file actions
executable file
·103 lines (85 loc) · 2.92 KB
/
playbook.yml
File metadata and controls
executable file
·103 lines (85 loc) · 2.92 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
97
98
99
100
101
102
103
---
- hosts: localhost
connection: local
vars_files:
- vars/main.yml
vars_prompt:
- name: "my_password"
prompt: "Enter password"
private: true
pre_tasks:
# - name: add github to known_hosts
# file: path=~/.ssh mode=0700 state=directory
# lineinfile: dest=~/.ssh/known_hosts create=yes state=present line='{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}' regexp='^github.com'
- name: ensure homebrew is installed
stat:
path: /opt/homebrew/bin/brew
register: homebrew_check
- name: fail if homebrew is not installed
fail:
msg: homebrew is missing, install from http://brew.sh
when:
- not homebrew_check.stat.exists
- not install_homebrew_if_missing
- name: installing homebrew
shell: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
when:
- not homebrew_check.stat.exists
- install_homebrew_if_missing
# FIXME: Ansible has been updated
# roles:
# - role: elliotweiser.osx-command-line-tools
# - role: geerlingguy.mac.mas
# when: mas_installed_apps | length > 0 or mas_installed_app_ids | length > 0
# tags: ["mas"]
# - role: geerlingguy.mac.mas
# when: mas_uninstalled_apps
# tags: ["mas"]
tasks:
#- name: generate ssh-key
# command: creates=~/.ssh/id_rsa ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N ''
- include_tasks: dotfiles.yml
when: configure_dotfiles
- name: upgrade homebrew packages
community.general.homebrew:
update_homebrew: yes
upgrade_all: yes
# Tap
#- name: ensure taps are tapped.
# homebrew_tap:
# name: "{{ item }}"
# state: present
# with_items: "{{ brew_taps }}"
# Brew
- name: install homebrew packages
community.general.homebrew:
name: "{{ brew_packages }}"
state: present
# Cask
- name: install homebrew casks
community.general.homebrew_cask:
name: "{{ item }}"
state: present
install_options: force
with_items: "{{ cask_packages }}"
- name: upgrade homebrew casks
community.general.homebrew_cask:
upgrade_all: true
# - name: set up bash for user
# hosts: localhost
# become: no
# vars:
# the_user: "{{ ansible_user_id }}"
# tasks:
# - name: change user shell to bash
# become: yes
# user:
# name: "{{ the_user }}"
# shell: /usr/local/bin/bash
#- name: install npm modules
# npm: name={{item}} global=yes
# with_items: '{{ npm_modules }}'
# - name: install ffmpeg with options
# homebrew: name=ffmpeg install_options='with-fdk-aac,with-freetype,with-libvo-aacenc,with-libvorbis,with-libvpx, with-openjpeg,with-rtmpdump,with-theora,with-tools'
- name: remove outdated brew versions from the cellar
command: brew cleanup