cachy-workstation

Log | Files | Refs | README

README.md (2276B)


      1 # Cachy-workstation
      2 
      3 Infrastructure-as-Code for a CachyOS Linux workstation, managed with Ansible.
      4 
      5 ## Goals
      6 
      7 - Describe and reproduce the workstation configuration declaratively
      8 - Learn Ansible patterns: site-based playbooks, roles, and tags
      9 
     10 ## Design
     11 
     12 - **Tool:** Ansible
     13 - **Target:** `localhost` only
     14 - **Entry point:** `site.yml`
     15 - **Structure:** Roles with tags for selective execution
     16 
     17 ## New Machine Bootstrap
     18 
     19 On a fresh machine, run `bootstrap.yml` first. It handles the prerequisites that
     20 `site.yml` depends on:
     21 
     22 1. Installs and authenticates Tailscale
     23 2. Imports GPG keys from the local git server
     24 3. Clones the pass password store
     25 
     26 Prerequisites before running bootstrap:
     27 
     28 ```bash
     29 sudo pacman -S ansible git
     30 ```
     31 
     32 Run bootstrap:
     33 
     34 ```bash
     35 ansible-playbook -K -i inventory/hosts.yml bootstrap.yml
     36 ```
     37 
     38 Then run the full site playbook:
     39 
     40 ```bash
     41 ansible-playbook -K -i inventory/hosts.yml site.yml
     42 ```
     43 
     44 ## Usage
     45 
     46 Run the full site playbook:
     47 
     48 ```bash
     49 ansible-playbook -K -i inventory/hosts.yml site.yml
     50 ```
     51 
     52 Run only tasks matching a specific tag:
     53 
     54 ```bash
     55 ansible-playbook -K -i inventory/hosts.yml site.yml --tags <tagname>
     56 ```
     57 
     58 Skip tasks matching a tag:
     59 
     60 ```bash
     61 ansible-playbook -K -i inventory/hosts.yml site.yml --skip-tags <tagname>
     62 ```
     63 
     64 ## Roles
     65 
     66 | Role | Play | Description |
     67 |------|------|-------------|
     68 | firewall | system | ufw, default deny incoming, allow port 22 |
     69 | packages | system | General packages via pacman |
     70 | docker | system | Docker, enables service, adds user to docker group |
     71 | virtualization | system | qemu-full, virt-manager, libvirtd |
     72 | web | system | hcloud, hugo, tea |
     73 | flatpak | system | Flatpak and apps, MakeMKV device permissions |
     74 | gpg | user | Import GPG keys from private git repo |
     75 | ssh | user | Deploy SSH keys and config from pass |
     76 | pass | user | Clone pass password store |
     77 | dotfiles | user | Clone dotfiles and nvim repos, symlink configs |
     78 | scripts | user | Clone scripts repo, add to PATH, deploy Pushover credentials |
     79 | hotkeys | user | Deploy .desktop files, set Plasma 6 global shortcuts |
     80 
     81 ## Structure
     82 
     83 ```
     84 .
     85 ├── bootstrap.yml     # New machine bootstrap
     86 ├── site.yml          # Main entry point
     87 ├── inventory/        # Inventory files
     88 └── roles/            # Ansible roles
     89 ```