Add apps role and update Neovim installation
- 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 <noreply@anthropic.com>
This commit is contained in:
57
CLAUDE.md
Normal file
57
CLAUDE.md
Normal file
@@ -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
|
||||
1
main.yml
1
main.yml
@@ -4,4 +4,5 @@
|
||||
gather_facts: true
|
||||
become: true
|
||||
roles:
|
||||
- role: apps
|
||||
- role: shell
|
||||
32
roles/apps/tasks/install_apps.yml
Normal file
32
roles/apps/tasks/install_apps.yml
Normal file
@@ -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"
|
||||
8
roles/apps/tasks/main.yml
Normal file
8
roles/apps/tasks/main.yml
Normal file
@@ -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
|
||||
31
roles/apps/tasks/package_managers.yml
Normal file
31
roles/apps/tasks/package_managers.yml
Normal file
@@ -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"
|
||||
Reference in New Issue
Block a user