2017-10-12 22:28:35 +01:00
|
|
|
# Install Homebrew
|
2019-01-20 16:16:17 +00:00
|
|
|
- name: 'Brew: Check if already installed'
|
2017-11-24 18:42:08 +00:00
|
|
|
tags:
|
|
|
|
- install
|
2019-01-20 16:16:17 +00:00
|
|
|
- brew
|
2017-10-12 22:28:35 +01:00
|
|
|
stat:
|
|
|
|
path: /usr/local/bin/brew
|
|
|
|
register: st
|
|
|
|
|
2019-01-20 16:16:17 +00:00
|
|
|
- name: 'Brew: Install'
|
2017-11-24 18:42:08 +00:00
|
|
|
tags:
|
|
|
|
- install
|
2019-01-20 16:16:17 +00:00
|
|
|
- brew
|
2017-10-12 22:28:35 +01:00
|
|
|
command: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
|
|
|
when: st.stat.executable != True
|
|
|
|
|
2019-01-20 16:16:17 +00:00
|
|
|
- name: 'Brew: Disable analytics'
|
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
- brew
|
2017-10-12 22:28:35 +01:00
|
|
|
command: brew analytics off
|
|
|
|
|
|
|
|
# Taps
|
2019-01-20 16:16:17 +00:00
|
|
|
- name: 'Brew: Install Taps'
|
2017-11-24 18:42:08 +00:00
|
|
|
tags:
|
|
|
|
- install
|
2019-01-20 16:16:17 +00:00
|
|
|
- brew
|
|
|
|
- packages
|
2017-10-12 22:28:35 +01:00
|
|
|
homebrew_tap:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: present
|
2019-01-20 10:51:09 +00:00
|
|
|
loop: "{{ homebrew_tap_items }}"
|
2017-10-12 22:28:35 +01:00
|
|
|
|
|
|
|
# Update and upgrades
|
2019-01-20 16:16:17 +00:00
|
|
|
- name: 'Brew: Update and upgrades'
|
2017-11-24 18:42:08 +00:00
|
|
|
tags:
|
|
|
|
- install
|
2019-01-20 16:16:17 +00:00
|
|
|
- brew
|
|
|
|
- upgrade
|
|
|
|
- update
|
2017-10-12 22:28:35 +01:00
|
|
|
homebrew:
|
|
|
|
update_homebrew: True
|
|
|
|
upgrade_all: True
|
|
|
|
|
|
|
|
# Brews
|
2019-01-20 16:16:17 +00:00
|
|
|
- name: 'Brew: Install packages'
|
2017-11-24 18:42:08 +00:00
|
|
|
tags:
|
|
|
|
- install
|
2019-01-20 16:16:17 +00:00
|
|
|
- brew
|
|
|
|
- packages
|
2017-10-12 22:28:35 +01:00
|
|
|
homebrew:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: present
|
2019-01-20 10:51:09 +00:00
|
|
|
loop: "{{ homebrew_brew_items }}"
|
2017-10-12 22:28:35 +01:00
|
|
|
|
|
|
|
# Casks
|
2019-01-20 16:16:17 +00:00
|
|
|
- name: 'Brew: Install Casks'
|
2017-11-24 18:42:08 +00:00
|
|
|
tags:
|
|
|
|
- install
|
2019-01-20 16:16:17 +00:00
|
|
|
- brew
|
|
|
|
- cask
|
|
|
|
- packages
|
2017-10-12 22:28:35 +01:00
|
|
|
homebrew_cask:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: present
|
2019-01-20 10:51:09 +00:00
|
|
|
loop: "{{ homebrew_cask_items }}"
|
2019-01-20 16:16:17 +00:00
|
|
|
|
|
|
|
# Config
|
|
|
|
- name: 'Brew: Bash completion'
|
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
- brew
|
|
|
|
- shell
|
|
|
|
copy:
|
|
|
|
content: |
|
|
|
|
if [ -f $(brew --prefix 2>/dev/null)/etc/bash_completion ]; then
|
|
|
|
. $(brew --prefix 2>/dev/null)/etc/bash_completion
|
|
|
|
fi
|
|
|
|
dest: '~/.bashrc.d/homebew_bash_completion'
|
|
|
|
mode: '0400'
|
|
|
|
|
|
|
|
- name: 'Brew: API token'
|
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
- homebrew
|
|
|
|
- shell
|
|
|
|
copy:
|
|
|
|
content: |
|
|
|
|
if [ -x "$(which brew 2>/dev/null)" ]; then
|
|
|
|
export HOMEBREW_GITHUB_API_TOKEN=$(getkey HOMEBREW_GITHUB_API_TOKEN)
|
|
|
|
fi
|
|
|
|
dest: '~/.bashrc.d/homebrew_token'
|
|
|
|
mode: '0400'
|