Skip to content
Merged
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
4 changes: 0 additions & 4 deletions .ansible-lint

This file was deleted.

5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,3 @@ updates:
schedule:
interval: "weekly"
assignees: ["hisaac"]
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"
assignees: ["hisaac"]
10 changes: 0 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
---
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
env:
MISE_ENV: ci
MISE_LOCKED: 1

jobs:
lint:
Expand All @@ -16,14 +14,6 @@ jobs:
- name: checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: cache Ansible dependencies
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |-
galaxy_collection
galaxy_roles
key: ${{ runner.os }}-${{ hashFiles('ansible.cfg', 'requirements.yml') }}

- name: setup mise
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0

Expand Down
19 changes: 0 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,3 @@

# Packer
packer_cache/

# Ansible
.ansible
ansible.log

# External roles/collections installed via ansible-galaxy
galaxy_roles/
galaxy_collections/

# Ansible retry files
*.retry

# Vault password file (if used locally)
.vault_pass

# Python
__pycache__
.ruff_cache
.venv/
5 changes: 0 additions & 5 deletions .mise/locks/pipx-ansible-core/2.21.4/pyproject.toml

This file was deleted.

316 changes: 0 additions & 316 deletions .mise/locks/pipx-ansible-core/2.21.4/uv.lock

This file was deleted.

5 changes: 0 additions & 5 deletions .mise/locks/pipx-ansible-lint/26.9.0/pyproject.toml

This file was deleted.

1,057 changes: 0 additions & 1,057 deletions .mise/locks/pipx-ansible-lint/26.9.0/uv.lock

This file was deleted.

11 changes: 0 additions & 11 deletions .vscode/settings.json

This file was deleted.

66 changes: 0 additions & 66 deletions AGENTS.md

This file was deleted.

1 change: 0 additions & 1 deletion CLAUDE.md

This file was deleted.

171 changes: 0 additions & 171 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,172 +1 @@
# hisaac-ci

Ansible-first automation for provisioning macOS CI agents, with Tart VM support for local iteration.

## Overview

This repository provisions macOS hosts (VMs or physical machines) using Ansible roles and playbooks.

The current active stack is:

- Root-level Ansible project (`ansible.cfg`, `inventory/`, `playbooks/`, `roles/`)
- Dynamic Tart inventory (`inventory/tart_inventory.py`) for VM IP discovery at runtime
- Role-scoped reference scripts in `scripts/` used as implementation references and helpers
- Toolchain and workflow orchestration via `mise`

## Repository Structure

```text
.
├── ansible.cfg
├── requirements.yml
├── inventory/
│ ├── tart_inventory.py
│ └── group_vars/
│ ├── macos_agents.yml
│ ├── macos_15_agents.yml
│ ├── macos_26_agents.yml
│ ├── tart_agents.yml
│ └── orka_agents.yml
├── playbooks/
│ └── provision.yml
├── roles/
│ ├── xcode_clt/
│ ├── macos_updates/
│ ├── rosetta/
│ ├── ssh_config/
│ ├── system_config/
│ ├── auth_config/
│ ├── homebrew/
│ └── xcode/
├── scripts/
│ ├── xcode/
│ ├── xcode_clt/
│ ├── homebrew/
│ ├── system_config/
│ ├── auth_config/
│ ├── ssh_config/
│ ├── rosetta/
│ └── macos_updates/
├── mise.toml
└── pyproject.toml
```

## Prerequisites

- macOS host for Tart-based workflows
- [mise](https://mise.jdx.dev)
- Tart VMs prepared locally (if using dynamic Tart inventory)
- Pre-staged Xcode `.xip` and Simulator Runtime `.dmg` assets for the target OS version(s)

## Setup

Run commands from the repository root.

1. Install toolchain from `mise.toml`:

```bash
mise install
```

2. Bootstrap Python/Ansible dependencies and Galaxy content:

```bash
mise run bootstrap
```

This installs:

- Python dependencies from `pyproject.toml` (`ansible-core`, `ansible-lint`, `paramiko`)
- Roles and collections from `requirements.yml`

## Inventory and Variables

`ansible.cfg` points to `inventory/tart_inventory.py` as the default inventory.

- `inventory/tart_inventory.py` discovers VM IPs via `tart ip <vm_name>`
- Hosts are grouped into:
- `macos_agents` (parent)
- `tart_agents` (runtime Tart VM group)
- version-specific groups like `macos_15_agents` and `macos_26_agents`

Primary variable files:

- `inventory/group_vars/macos_agents.yml`: shared settings (admin credentials, Homebrew base packages, Dock config)
- `inventory/group_vars/tart_agents.yml`: Tart-specific packages (`tart-guest-agent`)
- `inventory/group_vars/macos_15_agents.yml` and `inventory/group_vars/macos_26_agents.yml`: Xcode/runtime/simulator presets

## Xcode Cache Inputs

The `xcode` role installs all `*.xip` files found in the admin user's Downloads folder on the remote host. Stage the desired Xcode `.xip` files there before running provisioning — they will be deleted after installation.

## Provisioning

Run the full playbook:

```bash
ansible-playbook playbooks/provision.yml
```

Or run common role slices with tags:

```bash
ansible-playbook playbooks/provision.yml --tags xcode
ansible-playbook playbooks/provision.yml --tags homebrew
ansible-playbook playbooks/provision.yml --tags system_config
```

Playbook role order in `playbooks/provision.yml` is intentional:

1. `xcode_clt`
2. `macos_updates`
3. `rosetta`
4. `ssh_config`
5. `system_config`
6. `auth_config`
7. `homebrew`
8. `geerlingguy.mac.dock`
9. `xcode`
10. Spotlight re-index task
11. Reboot task

## Tart VM Workflow (Local)

`mise` includes helper tasks for local Tart loops:

- `mise run run-tart-vms`: starts configured VMs and waits for SSH readiness
- `mise run provision`: verifies Xcode/simruntime cache inputs, starts VMs, then runs `ansible-playbook playbooks/provision.yml`
- `mise run shutdown-tart-vms`: shuts down hosts in `tart_agents`
- `mise run refresh-tart-vms`: recreates local Tart VM clones from frozen images

Adjust VM names in:

- `inventory/tart_inventory.py` (`VMS` list)
- `mise.toml` (`tasks.run-tart-vms` and `tasks.refresh-tart-vms`)

## Linting and Formatting

This repo uses `hk` and `mise` task aliases:

```bash
mise run chk # lint/check
mise run fmt # auto-fix formatting and supported lint issues
```

`chk` includes `ansible-lint`, `shellcheck`, `shfmt`, `ruff`, `yamlfmt`, and additional utility checks defined in `hk.pkl`.

## Shell Script Tests

Xcode utility script tests can be run directly on macOS:

```bash
bash scripts/xcode/tests/test_xcode-utils.bash
```

## References

- https://github.com/timsutton/osx-vm-templates
- https://github.com/boxcutter/macos
- https://github.com/cirruslabs/macos-image-templates
- https://github.com/actions/runner-images
- https://github.com/torarnv/tart-image-bakery
- https://gist.github.com/aessam/aa9c32af6900123277c36d4d0ac7f73d#9d-skip-setup-assistant--6-layers
8 changes: 0 additions & 8 deletions TODO.md

This file was deleted.

14 changes: 0 additions & 14 deletions ansible.cfg

This file was deleted.

Loading