dotfiles/.ansible/roles/darwin_desktop/tasks/homebrew.yaml

94 lines
1.7 KiB
YAML
Raw Permalink Normal View History

# Install Homebrew
- name: 'Brew: Check if already installed'
2017-11-24 18:42:08 +00:00
tags:
- install
- brew
stat:
path: /usr/local/bin/brew
register: st
- name: 'Brew: Install'
2017-11-24 18:42:08 +00:00
tags:
- install
- brew
command: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
when: st.stat.executable != True
- name: 'Brew: Disable analytics'
tags:
- config
- brew
command: brew analytics off
# Taps
- name: 'Brew: Install Taps'
2017-11-24 18:42:08 +00:00
tags:
- install
- brew
- packages
homebrew_tap:
name: "{{ item }}"
state: present
2019-01-20 10:51:09 +00:00
loop: "{{ homebrew_tap_items }}"
# Update and upgrades
- name: 'Brew: Update and upgrades'
2017-11-24 18:42:08 +00:00
tags:
- install
- brew
- upgrade
- update
homebrew:
update_homebrew: True
upgrade_all: True
# Brews
- name: 'Brew: Install packages'
2017-11-24 18:42:08 +00:00
tags:
- install
- brew
- packages
homebrew:
name: "{{ item }}"
state: present
2019-01-20 10:51:09 +00:00
loop: "{{ homebrew_brew_items }}"
# Casks
- name: 'Brew: Install Casks'
2017-11-24 18:42:08 +00:00
tags:
- install
- brew
- cask
- packages
homebrew_cask:
name: "{{ item }}"
state: present
2019-01-20 10:51:09 +00:00
loop: "{{ homebrew_cask_items }}"
# 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'