From e943a784c1320e1ceb183fd1c4deac5d96400dd5 Mon Sep 17 00:00:00 2001 From: Phil Date: Thu, 18 Sep 2025 19:02:40 -0600 Subject: [PATCH] Add apps role and update Neovim installation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add apps role to main playbook for application management - Create comprehensive CLAUDE.md documentation - Update Neovim installation on Debian/Ubuntu to use official PPA - Add cross-platform package manager setup (Homebrew, AppMan) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CLAUDE.md | 57 +++++++++++++++++++++++++++ main.yml | 1 + roles/apps/tasks/install_apps.yml | 32 +++++++++++++++ roles/apps/tasks/main.yml | 8 ++++ roles/apps/tasks/package_managers.yml | 31 +++++++++++++++ 5 files changed, 129 insertions(+) create mode 100644 CLAUDE.md create mode 100644 roles/apps/tasks/install_apps.yml create mode 100644 roles/apps/tasks/main.yml create mode 100644 roles/apps/tasks/package_managers.yml diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..97b9484 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,57 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview +This is an Ansible playbook for local machine configuration and application installation. It automates the setup of shell environments, development tools, and applications across multiple operating systems (macOS, Linux distributions). + +## Architecture +The playbook is structured around two main roles: + +- **shell role**: Configures shell environment (ZSH, Starship prompt, Meslo font, dotfiles via GNU Stow) +- **apps role**: Installs package managers and applications across different OS platforms + +## Key Commands + +### Running the playbook +```bash +# Install Ansible collections first +ansible-galaxy install -r requirements.yml + +# Run the full playbook +ansible-playbook main.yml + +# Run specific roles with tags +ansible-playbook main.yml --tags=zsh +ansible-playbook main.yml --tags=starship +ansible-playbook main.yml --tags=meslo_font +ansible-playbook main.yml --tags=dotfiles +ansible-playbook main.yml --tags=package_managers +ansible-playbook main.yml --tags=apps + +# Check what would be changed (dry run) +ansible-playbook main.yml --check + +# Run with increased verbosity +ansible-playbook main.yml -v +``` + +## Project Structure +- `main.yml`: Main playbook entry point, runs on localhost with privilege escalation +- `requirements.yml`: Ansible collection dependencies (community.general) +- `roles/shell/`: Shell environment configuration tasks +- `roles/apps/`: Application installation and package manager setup tasks + +## Cross-Platform Support +The playbook supports multiple operating systems: +- **macOS**: Uses Homebrew for package management +- **Debian/Ubuntu**: Uses APT package manager +- **RedHat/CentOS/Fedora**: Uses YUM/DNF package managers +- **Arch Linux**: Uses Pacman package manager +- **Linux (general)**: Uses AppMan for universal Linux app management + +## Development Notes +- Tasks are organized by function with conditional execution based on `ansible_os_family` +- All tasks include appropriate `become` directives for privilege requirements +- Package managers are installed before applications in the apps role +- Shell configuration includes font installation, prompt customization, and dotfile management \ No newline at end of file diff --git a/main.yml b/main.yml index b8b7b0f..7569dfe 100644 --- a/main.yml +++ b/main.yml @@ -4,4 +4,5 @@ gather_facts: true become: true roles: + - role: apps - role: shell \ No newline at end of file diff --git a/roles/apps/tasks/install_apps.yml b/roles/apps/tasks/install_apps.yml new file mode 100644 index 0000000..957c106 --- /dev/null +++ b/roles/apps/tasks/install_apps.yml @@ -0,0 +1,32 @@ +--- +- name: Install Neovim on macOS via Homebrew + homebrew: + name: neovim + state: present + become: no + when: ansible_os_family == "Darwin" + +- name: Add Neovim PPA on Debian/Ubuntu + apt_repository: + repo: ppa:neovim-ppa/unstable + state: present + update_cache: yes + when: ansible_os_family == "Debian" + +- name: Install Neovim on Debian/Ubuntu + apt: + name: neovim + state: present + when: ansible_os_family == "Debian" + +- name: Install Neovim on RedHat/CentOS/Fedora + package: + name: neovim + state: present + when: ansible_os_family == "RedHat" + +- name: Install Neovim on Arch Linux + pacman: + name: neovim + state: present + when: ansible_os_family == "Archlinux" \ No newline at end of file diff --git a/roles/apps/tasks/main.yml b/roles/apps/tasks/main.yml new file mode 100644 index 0000000..f9ba052 --- /dev/null +++ b/roles/apps/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- name: Install package managers + import_tasks: package_managers.yml + tags: package_managers + +- name: Install applications + import_tasks: install_apps.yml + tags: apps \ No newline at end of file diff --git a/roles/apps/tasks/package_managers.yml b/roles/apps/tasks/package_managers.yml new file mode 100644 index 0000000..1f4136d --- /dev/null +++ b/roles/apps/tasks/package_managers.yml @@ -0,0 +1,31 @@ +--- +- name: Install Homebrew on macOS + block: + - name: Check if Homebrew is installed + stat: + path: /usr/local/bin/brew + register: homebrew_check + + - name: Install Homebrew + shell: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + when: not homebrew_check.stat.exists + become: no + when: ansible_os_family == "Darwin" + +- name: Install AM (AppMan) on Linux + block: + - name: Check if AppMan is installed + stat: + path: "{{ ansible_env.HOME }}/.local/bin/appman" + register: appman_check + + - name: Install AM as AppMan (local user only) + shell: | + cd {{ ansible_env.HOME }} + wget -q https://raw.githubusercontent.com/ivan-hc/AM/main/AM-INSTALLER + chmod a+x ./AM-INSTALLER + echo '2' | ./AM-INSTALLER + rm ./AM-INSTALLER + when: not appman_check.stat.exists + become: no + when: ansible_os_family == "Debian" or ansible_os_family == "RedHat" or ansible_os_family == "Archlinux" \ No newline at end of file