Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,34 @@ The `install.sh` script performs the following actions:
- Runs the Ansible playbook contained in this repository.

### What does the Ansible playbook do?
#### The Ansible playbook installs a variety of applications and performs some customizations to the MacOS or Debian environment. Here's a brief overview:

1. Taps into several Homebrew repositories, including HashiCorp, AWS, and Homebrew's own font cask.
The Ansible playbook installs a variety of applications and performs customizations to the MacOS or Debian environment. The packages are organized efficiently with shared packages common across configurations and configuration-specific additions.

#### For MacOS:
#### Package Organization

- Installs a variety of Homebrew packages, including `neovim`, `tmux`, `git-extras`, `thefuck`, `go`, `kubectl`, `skaffold`, `awscli`, `terraform`, `packer`, `aws-sam-cli`, `node`, `redis`, and `molecule`.
- Installs several Homebrew cask packages, including `arc`, `iterm2`, `visual-studio-code`, `1password`, `rectangle`, `font-hack-nerd-font`, `jetbrains-toolbox`, `nordvpn`, `switchresx`, `discord`, `istat-menus`, `signal`, `docker`, `postman`, `gimp`, `obs`, and `krisp`.
**Shared Packages** (installed in both Developer and Home configurations):
- **Homebrew Taps**: `aws/tap`, `hashicorp/tap`, `twilio/brew`
- **Homebrew Packages**: `aws-sam-cli`, `awscli`, `battery`, `exercism`, `git-extras`, `go`, `hashicorp/tap/packer`, `hashicorp/tap/terraform`, `kubectl`, `molecule`, `neovim`, `node`, `redis`, `skaffold`, `thefuck`, `tmux`, `twilio`, `yarn`
- **Homebrew Cask Packages**: `1password`, `arc`, `cursor`, `docker`, `font-hack-nerd-font`, `ghostty`, `istat-menus`, `iterm2`, `jetbrains-toolbox`, `obs`, `postman`, `rectangle`, `switchresx`, `visual-studio-code`
- **APT Packages** (Debian): `git-extras`, `golang-go`, `neovim`, `thefuck`, `tmux`, `zsh`

#### For Debian:
#### Configuration-Specific Packages

- Installs a variety of packages using the package manager, including `neovim`, `tmux`, `git-extras`, `thefuck`, `go`, `kubectl`, `skaffold`, `awscli`, `terraform`, `packer`, `aws-sam-cli`, `node`, `redis`, and `molecule`.
**Lightweight Configuration** (Essentials only):
- **Homebrew Cask Packages**: `1password`, `arc`, `istat-menus`, `iterm2`, `rectangle`

2. Creates directories at `~/stuffy`, `~/stuffy/code`, and `~/stuffy/playground`.
**Developer Configuration** (Clean development environment):
- **Additional Packages**: None (uses shared packages only)

**Home Configuration** (Full productivity setup):
- **Additional Homebrew Cask Packages**: `discord`, `gimp`, `krisp`, `microsoft-office`, `nordvpn`, `signal`

#### Additional Features

1. **Directory Structure**: Creates directories at `~/stuffy`, `~/stuffy/code`, and `~/stuffy/playground`
2. **Shell Configuration**: Sets up ZSH with Oh My Zsh and autosuggestions
3. **Go Installation**: Installs Go 1.22.2 on Debian systems
4. **Git Configuration**: Sets up global git configuration

## Notes

Expand Down
34 changes: 23 additions & 11 deletions defilan-osconfig/roles/defilan-osconfig/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
---
# tasks file for defilan-macos

- name: Set config variable
- name: Set config variable with default
set_fact:
config: "{{ lookup('env', 'config') }}"
config: "{{ config | default('home') }}"
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line overwrites any existing 'config' variable with the default value if it's undefined. However, if 'config' is already defined (e.g., from environment or playbook vars), the 'default' filter won't apply and this task becomes redundant. Consider using 'when: config is not defined' condition or checking if the variable exists first.

Suggested change
config: "{{ config | default('home') }}"
config: "{{ config | default('home') }}"
when: config is not defined

Copilot uses AI. Check for mistakes.

- name: Display selected config
debug:
msg: "Using config: {{ config }}"

- name: Validate config variable
fail:
msg: "Invalid config '{{ config }}'. Valid options are: {{ config_packages.keys() | list }}"
when: config not in config_packages

- name: Merge shared and config-specific packages
set_fact:
merged_packages: "{{ shared_packages | combine(config_packages[config], recursive=true) }}"

- name: Add Extra Casks
community.general.homebrew_tap:
name: "{{ item }}"
loop: "{{ config_packages[config].homebrew_taps }}"
when: ansible_os_family == 'Darwin' and config_packages[config].homebrew_taps is defined

loop: "{{ merged_packages.homebrew_taps }}"
when: ansible_os_family == 'Darwin' and merged_packages.homebrew_taps is defined

- name: Install brew packages
homebrew:
name: "{{ item }}"
loop: "{{ config_packages[config].homebrew_packages }}"
when: ansible_os_family == 'Darwin' and config_packages[config].homebrew_packages is defined
loop: "{{ merged_packages.homebrew_packages }}"
when: ansible_os_family == 'Darwin' and merged_packages.homebrew_packages is defined

- name: Install cask packages
homebrew_cask:
name: "{{ item }}"
loop: "{{ config_packages[config].homebrew_cask_packages }}"
when: ansible_os_family == 'Darwin' and config_packages[config].homebrew_cask_packages is defined
loop: "{{ merged_packages.homebrew_cask_packages }}"
when: ansible_os_family == 'Darwin' and merged_packages.homebrew_cask_packages is defined

# Debian specific tasks

Expand All @@ -35,9 +47,9 @@
- name: Install apt packages
apt:
name: "{{ item }}"
loop: "{{ config_packages[config].apt_packages }}"
loop: "{{ merged_packages.apt_packages }}"
become: yes
when: ansible_os_family == 'Debian' and config_packages[config].apt_packages is defined
when: ansible_os_family == 'Debian' and merged_packages.apt_packages is defined

# Configure ZSH and directories

Expand Down
150 changes: 59 additions & 91 deletions defilan-osconfig/roles/defilan-osconfig/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,110 +2,78 @@
# vars file for defilan-macos
go_version: 1.22.2

# Shared packages that are common across all configurations
shared_packages:
homebrew_taps:
- aws/tap
- hashicorp/tap
- twilio/brew

homebrew_packages:
- aws-sam-cli
- awscli
- battery
- exercism
- git-extras
- go
- hashicorp/tap/packer
- hashicorp/tap/terraform
- kubectl
- molecule
- neovim
- node
- redis
- skaffold
- thefuck
- tmux
- twilio
- yarn

homebrew_cask_packages:
- 1password
- arc
- cursor
- docker
- font-hack-nerd-font
- ghostty
- istat-menus
- iterm2
- jetbrains-toolbox
- obs
- postman
- rectangle
- switchresx
- visual-studio-code

apt_packages:
- git-extras
- golang-go
- neovim
- thefuck
- tmux
- zsh

# Configuration-specific package additions
config_packages:
lightweight:
homebrew_cask_packages:
- arc
- iterm2
- 1password
- rectangle
- istat-menus
developer:
homebrew_taps:
- hashicorp/tap
- aws/tap
- twilio/brew
homebrew_packages:
- neovim
- tmux
- git-extras
- thefuck
- go
- kubectl
- skaffold
- awscli
- hashicorp/tap/terraform
- hashicorp/tap/packer
- aws-sam-cli
- node
- redis
- molecule
- battery
- twilio
- exercism
- yarn
homebrew_cask_packages:
- arc
- istat-menus
- iterm2
- visual-studio-code
- 1password
- rectangle
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'lightweight' configuration overrides shared packages by redefining the same packages (1password, arc, istat-menus, iterm2, rectangle). This defeats the purpose of the shared_packages refactor. Consider removing these duplicated packages from the lightweight config since they're already in shared_packages.

Copilot uses AI. Check for mistakes.
- font-hack-nerd-font
- jetbrains-toolbox
- switchresx
- istat-menus
- docker
- postman
- obs
- cursor
apt_packages:
- neovim
- tmux
- git-extras
- thefuck
- zsh
- golang-go

developer: {}

home:
homebrew_taps:
- hashicorp/tap
- aws/tap
- twilio/brew
homebrew_packages:
- neovim
- tmux
- git-extras
- thefuck
- go
- kubectl
- skaffold
- awscli
- hashicorp/tap/terraform
- hashicorp/tap/packer
- aws-sam-cli
- node
- redis
- molecule
- battery
- twilio
- exercism
- yarn
homebrew_cask_packages:
- arc
- iterm2
- visual-studio-code
- 1password
- rectangle
- font-hack-nerd-font
- jetbrains-toolbox
- nordvpn
- switchresx
- discord
- istat-menus
- signal
- docker
- postman
- gimp
- obs
- krisp
- microsoft-office
- cursor
apt_packages:
- neovim
- tmux
- git-extras
- thefuck
- zsh
- golang-go
- nordvpn
- signal

defilan_directories:
- ~/stuffy
- ~/stuffy/code
Expand Down