parent
a43f7d9f6a
commit
dd58ffddd7
@ -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,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,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:
|
- name: Check out dotfiles
|
||||||
|
ansible.builtin.git:
|
||||||
repo: git@git.kejadlen.dev:alpha/dotfiles.git
|
repo: git@git.kejadlen.dev:alpha/dotfiles.git
|
||||||
dest: ~/.dotfiles.git
|
dest: ~/.dotfiles
|
||||||
bare: true
|
version: main
|
||||||
|
accept_newhostkey: true
|
||||||
# macOS things
|
# repo can have local changes
|
||||||
|
ignore_errors: true # noqa: ignore-errors
|
||||||
# Not needed anymore since I've switched to kitty
|
|
||||||
#
|
- name: Import dotfiles playbook
|
||||||
# - name: Import terminal profile
|
import_playbook: dotfiles.yml
|
||||||
# ansible.builtin.command: open ~/.macos/Alpha.terminal
|
|
||||||
#
|
# First since this installs tooling used later
|
||||||
# - name: Set terminal profile to be the default
|
- name: Import homebrew playbook
|
||||||
# osx_defaults:
|
import_playbook: homebrew.yml
|
||||||
# domain: com.apple.Terminal
|
|
||||||
# key: "{{ item }} Window Settings"
|
- name: Import defaults playbook
|
||||||
# type: string
|
import_playbook: defaults.yml
|
||||||
# value: Alpha
|
|
||||||
# with_items:
|
- name: Import dock playbook
|
||||||
# - Default
|
import_playbook: dock.yml
|
||||||
# - Startup
|
|
||||||
|
- name: Import macos playbook
|
||||||
- import_playbook: homebrew.yml
|
import_playbook: macos.yml
|
||||||
|
|
||||||
- import_playbook: defaults.yml
|
- name: Misc macOS things
|
||||||
- import_playbook: dock.yml
|
hosts: os_MacOSX
|
||||||
- import_playbook: macos.yml
|
|
||||||
|
|
||||||
- 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
|
||||||
|
Loading…
Reference in new issue