Alpha Chen 4 weeks ago
parent a43f7d9f6a
commit dd58ffddd7
No known key found for this signature in database

@ -1,5 +1,5 @@
[defaults] [defaults]
inventory = hosts.yml inventory = hosts.yml,hosts.local
# [privilege_escalation] # [privilege_escalation]
# become_ask_pass = True # become_ask_pass = True

@ -1,4 +1,4 @@
- hosts: all - hosts: os_MacOSX
tasks: tasks:
- name: set OS X defaults - name: set OS X defaults
@ -9,13 +9,14 @@
value: "{{ item.value }}" value: "{{ item.value }}"
notify: restart OS X system services notify: restart OS X system services
vars: vars:
mailmate_allowed_image_urls: mailmate:
- https://((i|images|d)\.gr-assets\.com allowed_image_regexps:
- www\.goodreads\.com - https://((i|images|d)\.gr-assets\.com
- massdrop-s3\.imgix\.net - www\.goodreads\.com
- .*\.cloudfront\.net - massdrop-s3\.imgix\.net
- s3\.amazonaws\.com - .*\.cloudfront\.net
- files\.convertkitcdn\.com/assets/pictures)/.* - s3\.amazonaws\.com
- files\.convertkitcdn\.com/assets/pictures)/.*
with_items: with_items:
# NSGlobalDomain defaults # NSGlobalDomain defaults
@ -251,7 +252,7 @@
- domain: com.freron.MailMate - domain: com.freron.MailMate
key: MmAllowedImageURLRegexp key: MmAllowedImageURLRegexp
type: string type: string
value: "{{ mailmate_allowed_image_urls | join('|') }}" value: "{{ mailmate.allowed_image_regexps | join('|') }}"
- domain: com.freron.MailMate - domain: com.freron.MailMate
key: MmSendMessageDelayEnabled key: MmSendMessageDelayEnabled
@ -271,3 +272,5 @@
- Finder - Finder
- Dock - Dock
- SystemUIServer - SystemUIServer
# vim: ft=yaml.ansible

@ -1,13 +1,17 @@
- hosts: all - name: Sync dotfiles
hosts: dev
tasks: tasks:
- name: List dotfiles - name: List dotfiles # noqa: risky-shell-pipe
shell: ls -A ~/.dotfiles | grep '^\.' ansible.builtin.shell: ls -A ~/.dotfiles | grep '^\.'
register: ls_dotfiles register: ls_dotfiles
changed_when: false
- name: Symlink dotfiles - name: Symlink dotfiles
file: ansible.builtin.file:
src: ~/.dotfiles/{{ item }} src: ~/.dotfiles/{{ item }}
dest: ~/{{ item }} dest: ~/{{ item }}
state: link state: link
loop: "{{ ls_dotfiles.stdout_lines | difference(['.git', '.gitmodules']) }}" loop: "{{ ls_dotfiles.stdout_lines | difference(['.git', '.gitmodules', '.DS_Store']) }}"
# vim: ft=yaml.ansible

@ -1,5 +1,5 @@
- name: Homebrew - name: Install homebrew formulae
hosts: all hosts: os_MacOSX
tasks: tasks:
- name: Install Homebrew formulae - name: Install Homebrew formulae
@ -61,6 +61,8 @@
- name: Heed docker-compose caveats - name: Heed docker-compose caveats
block: block:
- name: Create Docker CLI plugins config dir - name: Create Docker CLI plugins config dir
ansible.buitin.file: ansible.builtin.file:
dest: ~/.docker/cli-plugins dest: ~/.docker/cli-plugins
state: directory state: directory
# vim: ft=yaml.ansible

@ -1,44 +1,50 @@
- hosts: all - name: Main playbook
hosts: dev
tasks: tasks:
- group_by: key=os_{{ ansible_distribution }} - name: Group by OS
tags: always ansible.builtin.group_by:
key: os_{{ ansible_distribution }}
- ansible.builtin.git:
repo: git@git.kejadlen.dev:alpha/dotfiles.git - name: Check out dotfiles
dest: ~/.dotfiles.git ansible.builtin.git:
bare: true repo: git@git.kejadlen.dev:alpha/dotfiles.git
dest: ~/.dotfiles
# macOS things version: main
accept_newhostkey: true
# Not needed anymore since I've switched to kitty # repo can have local changes
# ignore_errors: true # noqa: ignore-errors
# - name: Import terminal profile
# ansible.builtin.command: open ~/.macos/Alpha.terminal - name: Import dotfiles playbook
# import_playbook: dotfiles.yml
# - name: Set terminal profile to be the default
# osx_defaults: # First since this installs tooling used later
# domain: com.apple.Terminal - name: Import homebrew playbook
# key: "{{ item }} Window Settings" import_playbook: homebrew.yml
# type: string
# value: Alpha - name: Import defaults playbook
# with_items: import_playbook: defaults.yml
# - Default
# - Startup - name: Import dock playbook
import_playbook: dock.yml
- import_playbook: homebrew.yml
- name: Import macos playbook
- import_playbook: defaults.yml import_playbook: macos.yml
- import_playbook: dock.yml
- import_playbook: macos.yml - name: Misc macOS things
hosts: os_MacOSX
- hosts: all
tasks: tasks:
# https://tratt.net/laurie/blog/2024/faster_shell_startup_with_shell_switching.html # https://tratt.net/laurie/blog/2024/faster_shell_startup_with_shell_switching.html
# I'm not sure why this doesn't work on my Linux box, but whatever
- name: Set default shell to sh - name: Set default shell to sh
user: ansible.builtin.user:
name: alpha name: alpha
shell: /bin/sh --login shell: /bin/sh --login
- ansible.builtin.command: "luarocks install fennel"
- name: Install Fennel
ansible.builtin.command: "luarocks install fennel"
args:
creates: /opt/homebrew/bin/fennel
# vim: ft=yaml.ansible # vim: ft=yaml.ansible

@ -8,3 +8,6 @@ all:
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3
on-fire-within: on-fire-within:
lotus-land-story: lotus-land-story:
dev:
hosts:
localhost:

Loading…
Cancel
Save