Skip to content

SolidRhino/installscript

Repository files navigation

Development Environment Automation

A comprehensive Ansible playbook for automating the setup of a modern development environment on Ubuntu servers. This project provides infrastructure as code for consistent, repeatable server provisioning with a focus on developer productivity and modern tooling.

Overview

This playbook transforms a fresh Ubuntu installation into a fully configured development environment. It installs and configures essential tools, modern CLI utilities, development environments, and productivity enhancers through a modular role-based architecture.

Key Features

  • Infrastructure as Code: Complete server configuration defined in version-controlled YAML
  • Idempotent Execution: Safe to run multiple times without side effects
  • Modular Design: Independent roles that can be executed selectively
  • Comprehensive Tooling: Modern alternatives to traditional Unix tools
  • Security First: GPG verification, encrypted secrets, and secure defaults
  • Cross-machine Sync: Shell history and configurations that follow you

Quick Start

1. Install Dependencies

# Install required Ansible collections and roles
ansible-galaxy install -r requirements.yml

# Verify Ansible version (2.12+ required)
ansible --version

2. Configure Inventory

Edit inventory/hosts.ini to specify your target hosts:

[development]
dev-server ansible_host=192.168.1.100 ansible_user=ubuntu

[production]
prod-server ansible_host=10.0.1.100 ansible_user=admin

3. Configure Variables

Customize installation in group_vars/all/:

  • main.yml: General configuration and repository settings
  • versions.yml: Software versions and release information
  • vault.yml: Encrypted secrets (Tailscale auth key, Atuin credentials)

Create encrypted vault file:

ansible-vault create group_vars/all/vault.yml

4. Run Playbook

# Complete installation
ansible-playbook -i inventory/hosts.ini site.yml --ask-vault-pass

# Test with dry run
ansible-playbook -i inventory/hosts.ini site.yml --check --ask-vault-pass

# Install specific components only
ansible-playbook -i inventory/hosts.ini site.yml --tags "docker,cli" --ask-vault-pass

# Skip certain roles
ansible-playbook -i inventory/hosts.ini site.yml --skip-tags "tailscale" --ask-vault-pass

What Gets Installed

System Foundation

  • Base System: Updated packages, build tools, essential dependencies
  • User Configuration: Proper permissions, lingering services

Shell Environment

  • Fish Shell: Smart shell with syntax highlighting and autocompletion
  • Starship Prompt: Fast, customizable prompt with Git integration
  • Modern CLI Tools: bat, eza, fd, ripgrep, zoxide, bottom, dust

Development Tools

  • Rust Toolchain: Complete Rust development environment via rustup
  • Helix Editor: Modern modal editor with LSP support
  • Docker: Container development platform with user group access

Productivity & Utilities

  • fzf: Fuzzy finder for files and commands
  • lazydocker: Terminal UI for Docker management
  • yazi: Terminal file manager with preview support
  • Atuin: Encrypted shell history sync across machines

Networking & Security

  • Tailscale: Zero-config VPN for secure networking
  • GPG Verification: All external packages verified with GPG signatures

Role Architecture

Core Roles

Role Purpose Dependencies
common Base system setup and essential packages None
fish Fish shell installation and configuration common
rust Rust toolchain via rustup common
docker Docker CE with user management common
tailscale VPN client configuration common
cli_tools Modern CLI utilities common, rust
configs Application configuration deployment common, cli_tools
atuin Shell history synchronization common, fish, cli_tools

Execution Order

The roles execute in dependency order:

common → fish → rust → docker → tailscale → cli_tools → configs → atuin

Advanced Usage

Tag-based Execution

Execute specific components using tags:

# Install only base system and shell
ansible-playbook site.yml --tags "base,shell"

# Install development tools only
ansible-playbook site.yml --tags "development"

# Install networking components
ansible-playbook site.yml --tags "networking"

Available Tags

  • Functional Tags: base, shell, development, networking
  • Role Tags: common, fish, rust, docker, tailscale, cli, configs, atuin
  • Component Tags: prerequisites, terminal, toolchain, containers, vpn, utilities

Variable Customization

Override default behavior through group or host variables:

# group_vars/development/main.yml
rust_toolchain: "nightly"
docker_compose_version: "2.24.0"

# host_vars/dev-server/main.yml
skip_fish_default: true
tailscale_auth_key: "{{ vault_dev_tailscale_key }}"

Limiting Execution

Target specific hosts or groups:

# Single host
ansible-playbook site.yml --limit "dev-server"

# Host group
ansible-playbook site.yml --limit "development"

# Multiple hosts
ansible-playbook site.yml --limit "dev-server,staging-server"

Requirements

System Requirements

  • OS: Ubuntu 20.04 LTS, 22.04 LTS, or 24.04 LTS
  • Memory: 2GB RAM minimum, 4GB recommended
  • Storage: 10GB free space minimum
  • Network: Internet connectivity for package downloads

Control Machine

  • Ansible: Version 2.12 or later
  • Python: 3.8 or later
  • SSH: Key-based authentication to target hosts
  • Privileges: sudo access on target hosts

Network Access

  • Package repositories (Ubuntu, Docker, Tailscale, GitHub)
  • Rust toolchain downloads (rustup.rs)
  • Ansible Galaxy collections

Troubleshooting

Common Issues

Permission Denied Errors

# Ensure SSH key authentication
ssh-add ~/.ssh/id_rsa
ssh ubuntu@your-server  # Test connection

Vault Decryption Errors

# Test vault file
ansible-vault view group_vars/all/vault.yml

Collection Missing Errors

# Reinstall collections and roles
ansible-galaxy install -r requirements.yml --force

Docker Permission Issues

# User needs to logout/login after docker group addition
# Or run: newgrp docker

Validation Commands

# Syntax check
ansible-playbook site.yml --syntax-check

# Dry run
ansible-playbook site.yml --check

# Test connectivity
ansible all -m ping -i inventory/hosts.ini

Contributing

Refer to the Repository Guidelines for contributor expectations, role workflows, and PR requirements.

Development Setup

  1. Clone the repository
  2. Install development dependencies
  3. Run syntax checks before committing
  4. Test against staging hosts
  5. Update documentation for changes

Testing

# Syntax validation
ansible-playbook site.yml --syntax-check

# Dry run testing
ansible-playbook site.yml --check --diff

# Lint roles
ansible-lint roles/*/

Adding New Tools

  1. Add version to group_vars/all/versions.yml
  2. Update relevant role's tasks and defaults
  3. Add configuration templates if needed
  4. Update role documentation
  5. Test on staging environment

Security Considerations

  • All external repositories use GPG verification
  • Sensitive data encrypted with Ansible Vault
  • User-level installations preferred over system-wide
  • Minimal privilege escalation
  • Secure defaults for all services

License

MIT License - see LICENSE file for details

Author Information

Development Team - Internal Use


This playbook provides a foundation for consistent development environments. Customize it to match your organization's specific needs and security requirements.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published