|
|
- hosts: all
|
|
|
tasks:
|
|
|
- group_by: key=os_{{ ansible_distribution }}
|
|
|
tags: always
|
|
|
|
|
|
- hosts: os_MacOSX
|
|
|
tasks:
|
|
|
- file: path=~/Library/KeyBindings state=directory
|
|
|
- name: Symlink Emacs-style keybindings for OS X
|
|
|
file:
|
|
|
src: ~/.dotfiles/macos/DefaultKeyBinding.dict
|
|
|
dest: ~/Library/KeyBindings/DefaultKeyBinding.dict
|
|
|
state: link
|
|
|
|
|
|
- file: path=~/Library/Dictionaries state=directory
|
|
|
- name: Install Webster's 1913 dictionary
|
|
|
block:
|
|
|
- copy:
|
|
|
src: ~/.dotfiles/macos/websters-1913.dictionary/
|
|
|
dest: ~/Library/Dictionaries/websters-1913.dictionary
|
|
|
|
|
|
# This worked in earlier versions of MacOS, but not in Big Sur?
|
|
|
# The plist now looks like this:
|
|
|
#
|
|
|
# ❯ /usr/libexec/PlistBuddy -c "Print" ~/Library/Preferences/com.apple.DictionaryServices.plist
|
|
|
# Dict {
|
|
|
# DCSActiveDictionaries = Array {
|
|
|
# /Users/alpha/Library/Containers/com.apple.Dictionary/Data/Library/Dictionaries/websters-1913.dictionary
|
|
|
# com.apple.dictionary.NOAD
|
|
|
# com.apple.dictionary.OAWT
|
|
|
# com.apple.dictionary.AppleDictionary
|
|
|
# /System/Library/Frameworks/CoreServices.framework/Frameworks/DictionaryServices.framework/Resources/Wikipedia.wikipediadictionary
|
|
|
# }
|
|
|
# DCSPreferenceVersion = 7
|
|
|
# DCSLastUsedAssetCompatibilityVersion = 10
|
|
|
# }
|
|
|
#
|
|
|
# - shell: /usr/libexec/PlistBuddy -c "Print :DCSActiveDictionaries:0" ~/Library/Preferences/com.apple.DictionaryServices.plist
|
|
|
# register: websters_1913_result
|
|
|
# - command: >
|
|
|
# /usr/libexec/PlistBuddy
|
|
|
# -c "Add :DCSActiveDictionaries:0 string /Users/alpha/Library/Containers/com.apple.Dictionary/Data/Library/Dictionaries/websters-1913.dictionary"
|
|
|
# ~/Library/Preferences/com.apple.DictionaryServices.plist
|
|
|
# when: websters_1913_result is failed
|
|
|
|
|
|
- name: Enable Touch ID for sudo
|
|
|
become: yes
|
|
|
lineinfile:
|
|
|
path: /etc/pam.d/sudo
|
|
|
insertafter: '^auth\s+sufficient'
|
|
|
regexp: '^auth\s+sufficient\s+pam_tid.so$'
|
|
|
line: "auth\tsufficient\tpam_tid.so"
|
|
|
- name: Enable Touch ID for sudo in tmux
|
|
|
block:
|
|
|
- shell: brew --prefix
|
|
|
register: brew_prefix
|
|
|
- lineinfile:
|
|
|
path: /etc/pam.d/sudo
|
|
|
insertbefore: '^auth\tsufficient\tpam_tid.so'
|
|
|
regexp: '^auth\s+optional\s+.*pam_reattach.so$'
|
|
|
line: "auth\toptional\t{{ brew_prefix.stdout | trim }}/lib/pam/pam_reattach.so"
|
|
|
become: yes
|
|
|
|
|
|
# https://developer.1password.com/docs/ssh/get-started#step-4-configure-your-ssh-or-git-client
|
|
|
- file: path=~/.1password state=directory
|
|
|
- name: Symlink 1Password agent
|
|
|
file:
|
|
|
src: ~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock
|
|
|
dest: ~/.1password/agent.sock
|
|
|
state: link
|