mystack-rig 1.8.0__tar.gz → 1.9.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/GLOSSARY.md +4 -0
  2. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/PKG-INFO +5 -3
  3. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/README.md +4 -2
  4. mystack_rig-1.9.1/docs/adr/0007-managed-playbook-content-ships-as-bundled-roles.md +22 -0
  5. mystack_rig-1.9.1/docs/roles.md +65 -0
  6. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/pyproject.toml +1 -1
  7. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/main.py +36 -1
  8. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/remote_dev.py +162 -801
  9. mystack_rig-1.9.1/src/cli/roles/rig_base/defaults/main.yml +13 -0
  10. mystack_rig-1.9.1/src/cli/roles/rig_base/tasks/install.yml +22 -0
  11. mystack_rig-1.9.1/src/cli/roles/rig_claude_code/defaults/main.yml +2 -0
  12. mystack_rig-1.9.1/src/cli/roles/rig_claude_code/tasks/authorize.yml +111 -0
  13. mystack_rig-1.9.1/src/cli/roles/rig_claude_code/tasks/install.yml +67 -0
  14. mystack_rig-1.9.1/src/cli/roles/rig_code_server/defaults/main.yml +2 -0
  15. mystack_rig-1.9.1/src/cli/roles/rig_code_server/tasks/authorize.yml +28 -0
  16. mystack_rig-1.9.1/src/cli/roles/rig_code_server/tasks/install.yml +20 -0
  17. mystack_rig-1.9.1/src/cli/roles/rig_cursor_cli/defaults/main.yml +2 -0
  18. mystack_rig-1.9.1/src/cli/roles/rig_cursor_cli/tasks/authorize.yml +61 -0
  19. mystack_rig-1.9.1/src/cli/roles/rig_cursor_cli/tasks/install.yml +51 -0
  20. mystack_rig-1.9.1/src/cli/roles/rig_git/defaults/main.yml +2 -0
  21. mystack_rig-1.9.1/src/cli/roles/rig_git/tasks/authorize.yml +109 -0
  22. mystack_rig-1.9.1/src/cli/roles/rig_git/tasks/install.yml +65 -0
  23. mystack_rig-1.9.1/src/cli/roles/rig_home_ownership/defaults/main.yml +1 -0
  24. mystack_rig-1.9.1/src/cli/roles/rig_home_ownership/tasks/authorize.yml +7 -0
  25. mystack_rig-1.9.1/src/cli/roles/rig_home_ownership/tasks/install.yml +6 -0
  26. mystack_rig-1.9.1/src/cli/roles/rig_live_agent/defaults/main.yml +1 -0
  27. mystack_rig-1.9.1/src/cli/roles/rig_live_agent/tasks/authorize.yml +95 -0
  28. mystack_rig-1.9.1/src/cli/roles/rig_live_agent/tasks/install.yml +10 -0
  29. mystack_rig-1.9.1/src/cli/roles/rig_mcp/defaults/main.yml +2 -0
  30. mystack_rig-1.9.1/src/cli/roles/rig_mcp/tasks/authorize.yml +63 -0
  31. mystack_rig-1.9.1/src/cli/roles/rig_opencode/defaults/main.yml +2 -0
  32. mystack_rig-1.9.1/src/cli/roles/rig_opencode/tasks/authorize.yml +36 -0
  33. mystack_rig-1.9.1/src/cli/roles/rig_opencode/tasks/install.yml +60 -0
  34. mystack_rig-1.9.1/src/cli/roles/rig_workspace_user/defaults/main.yml +2 -0
  35. mystack_rig-1.9.1/src/cli/roles/rig_workspace_user/tasks/authorize.yml +30 -0
  36. mystack_rig-1.9.1/src/cli/roles/rig_workspace_user/tasks/install.yml +45 -0
  37. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/snapshots.py +59 -0
  38. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/mystack_rig.egg-info/PKG-INFO +5 -3
  39. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/mystack_rig.egg-info/SOURCES.txt +32 -0
  40. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/mystack_rig.egg-info/scm_file_list.json +32 -0
  41. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/mystack_rig.egg-info/scm_version.json +2 -2
  42. mystack_rig-1.9.1/tests/_roles.py +66 -0
  43. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_ansible_galaxy.py +3 -2
  44. mystack_rig-1.9.1/tests/test_bundled_roles.py +441 -0
  45. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_destroy_command.py +1 -0
  46. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_encrypt_command.py +7 -4
  47. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_git_credentials_and_author.py +5 -2
  48. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_init_command.py +14 -10
  49. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_live_agent.py +18 -14
  50. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_remote_dev.py +9 -2
  51. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_setup_provision.py +22 -18
  52. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/.coveragerc +0 -0
  53. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/.git-blame-ignore-revs +0 -0
  54. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/.github/workflows/release.yml +0 -0
  55. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/.github/workflows/tests.yml +0 -0
  56. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/.gitignore +0 -0
  57. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/.rig/playbooks/README.md +0 -0
  58. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/.rig/playbooks/vpn-gateway.yml +0 -0
  59. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/CLAUDE.md +0 -0
  60. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/CLI_STORAGE_SUMMARY.md +0 -0
  61. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/Dockerfile +0 -0
  62. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/GIT_CLONE_FEATURE.md +0 -0
  63. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/HETZNER_STORAGE_GUIDE.md +0 -0
  64. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/HETZNER_STORAGE_SECURITY_GUIDE.md +0 -0
  65. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/LICENSE +0 -0
  66. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/Makefile +0 -0
  67. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/README_REAL_E2E.md +0 -0
  68. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/STORAGE_CLI_GUIDE.md +0 -0
  69. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/docs/adr/0001-per-profile-generated-state-bucket.md +0 -0
  70. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/docs/adr/0002-outputs-as-separate-object-via-file-handoff.md +0 -0
  71. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/docs/adr/0003-mcp-servers-declared-once-rendered-at-authorize.md +0 -0
  72. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/docs/adr/0004-agents-run-as-live-agents-in-tmux.md +0 -0
  73. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/docs/adr/0005-docker-in-configure-for-devcontainers.md +0 -0
  74. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/docs/adr/0006-workspace-user-instead-of-root.md +0 -0
  75. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/docs/architecture.md +0 -0
  76. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/docs/architecture.png +0 -0
  77. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/docs/architecture.svg +0 -0
  78. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/forged-idea.md +0 -0
  79. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/pytest.ini +0 -0
  80. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/requirements.txt +0 -0
  81. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/sample.env +0 -0
  82. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/scripts/coverage_badge.py +0 -0
  83. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/scripts/pypi_version.py +0 -0
  84. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/setup.cfg +0 -0
  85. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/__init__.py +0 -0
  86. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/__init__.py +0 -0
  87. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/__main__.py +0 -0
  88. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/agents.py +0 -0
  89. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/ansible_filters/__init__.py +0 -0
  90. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/ansible_filters/rig_live.py +0 -0
  91. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/ansible_filters/rig_mcp.py +0 -0
  92. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/assets/rig-agent-queue +0 -0
  93. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/assets/rig-agent-state +0 -0
  94. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/assets/tmux.conf +0 -0
  95. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/config.py +0 -0
  96. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/devcontainers.py +0 -0
  97. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/encrypt.py +0 -0
  98. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/git.py +0 -0
  99. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/git_author.py +0 -0
  100. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/last_env.py +0 -0
  101. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/last_session.py +0 -0
  102. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/last_target.py +0 -0
  103. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/live_agent.py +0 -0
  104. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/log.py +0 -0
  105. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/mcp.py +0 -0
  106. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/outputs.py +0 -0
  107. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/requirements.txt +0 -0
  108. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/state_bucket.py +0 -0
  109. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/storage.py +0 -0
  110. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/vault_keys.py +0 -0
  111. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/vpn.py +0 -0
  112. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/cli/workspace_user.py +0 -0
  113. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/mystack_rig.egg-info/dependency_links.txt +0 -0
  114. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/mystack_rig.egg-info/entry_points.txt +0 -0
  115. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/mystack_rig.egg-info/requires.txt +0 -0
  116. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/src/mystack_rig.egg-info/top_level.txt +0 -0
  117. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/test_hetzner_integration.py +0 -0
  118. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/conftest.py +0 -0
  119. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_agents.py +0 -0
  120. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_attach_command.py +0 -0
  121. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_credential_security.py +0 -0
  122. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_dev_command.py +0 -0
  123. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_devcontainers.py +0 -0
  124. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_encrypt_coverage.py +0 -0
  125. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_firewall_client_ip.py +0 -0
  126. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_git_clone_unit.py +0 -0
  127. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_git_manager.py +0 -0
  128. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_gitignore_init.py +0 -0
  129. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_hetzner_storage.py +0 -0
  130. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_inspect_describe.py +0 -0
  131. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_last_env.py +0 -0
  132. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_last_session.py +0 -0
  133. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_last_target.py +0 -0
  134. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_live_agent_cli.py +0 -0
  135. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_log.py +0 -0
  136. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_main_coverage.py +0 -0
  137. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_mcp_command.py +0 -0
  138. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_mcp_render.py +0 -0
  139. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_outputs.py +0 -0
  140. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_outputs_storage.py +0 -0
  141. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_pypi_version.py +0 -0
  142. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_python_floor.py +0 -0
  143. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_r2_storage.py +0 -0
  144. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_real_e2e_integration.py +0 -0
  145. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_real_e2e_storage.py +0 -0
  146. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_real_e2e_vpn.py +0 -0
  147. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_real_e2e_vpn_tunnel.py +0 -0
  148. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_remote_dev_coverage_extensions.py +0 -0
  149. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_rig_ansible_vars.py +0 -0
  150. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_rig_config.py +0 -0
  151. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_secret_prompt_hidden.py +0 -0
  152. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_simulation_storage.py +0 -0
  153. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_small_module_coverage.py +0 -0
  154. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_snapshots.py +0 -0
  155. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_state_bucket.py +0 -0
  156. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_storage_basic.py +0 -0
  157. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_vault_keys.py +0 -0
  158. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_vpn_optional.py +0 -0
  159. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_vpn_unit.py +0 -0
  160. {mystack_rig-1.8.0 → mystack_rig-1.9.1}/tests/test_workspace_git_clone.py +0 -0
@@ -67,3 +67,7 @@ _Avoid_: Project, devbox
67
67
  **Dev target**:
68
68
  The Repo and Dev Container pair that `rig dev` opens on an Environment.
69
69
  _Avoid_: Project, selection
70
+
71
+ **Bundled role**:
72
+ An Ansible role that ships inside rig and is called by the playbooks rig generates, so those playbooks stay short. A Workspace's own roles take precedence over a bundled role of the same name.
73
+ _Avoid_: Built-in role, rig module, Galaxy role (that is one installed from Ansible Galaxy)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mystack-rig
3
- Version: 1.8.0
3
+ Version: 1.9.1
4
4
  Summary: Ephemeral remotes with full local parity for coding agents
5
5
  Author: mystack-cloud
6
6
  License-Expression: MIT
@@ -302,11 +302,13 @@ destroy playbooks:
302
302
  | --- | --- |
303
303
  | **init** | Scaffold `rig.yml` + `.rig/`. Collect Hetzner creds, repo PATs, agent choices and a key per agent. |
304
304
  | **create** | Boot VM (base/system snapshot). Run provision → configure → authorize → materialize. Snapshot after **configure** only. |
305
- | **apply** | Default: authorize → materialize. Flags: `--provision` / `--configure` / `--authorize` / `--materialize` / `--finalize` / `--destroy` (playbooks only; the VM stays). `--tags` is passed to every playbook in the run. |
305
+ | **apply** | Default: authorize → materialize. Flags: `--provision` / `--configure` / `--authorize` / `--materialize` / `--finalize` / `--destroy` (playbooks only; the VM stays). `--tags` and `--skip-tags` are passed to every playbook in the run. |
306
306
  | **attach** | SSH TTY into the agent's [live agent](#live-agents) on `/workspace` (started if needed, joined if running). `--agent` picks among installed agents. |
307
307
  | **exec** | Start a live agent with a prompt and return; the work continues unattended. See [Live agents](#live-agents). |
308
308
  | **dev** | Open VS Code/Cursor via Remote-SSH on `/workspace` (or `--browser` for code-server). |
309
- | **delete** | Run finalize → destroy playbooks, then delete VM / firewall / SSH key. `--tags` is passed to both playbooks. |
309
+ | **delete** | Run finalize → destroy playbooks, then delete VM / firewall / SSH key. `--tags` and `--skip-tags` are passed to both playbooks. |
310
+
311
+ `provision.yml` and `authorize.yml` only call [bundled roles](docs/roles.md); skip any part with `--skip-tags` (or `ansible.skip_tags` in `rig.yml`). See [ADR 0007](docs/adr/0007-managed-playbook-content-ships-as-bundled-roles.md). **Existing Environments** created before tmux entered provision (before live agents) lack it: authorize no longer installs it, so run `rig apply --provision` or re-create them.
310
312
 
311
313
  Put secret-free installs in `configure.yml` (cached). Put clone/setup that needs credentials in `materialize.yml`.
312
314
 
@@ -280,11 +280,13 @@ destroy playbooks:
280
280
  | --- | --- |
281
281
  | **init** | Scaffold `rig.yml` + `.rig/`. Collect Hetzner creds, repo PATs, agent choices and a key per agent. |
282
282
  | **create** | Boot VM (base/system snapshot). Run provision → configure → authorize → materialize. Snapshot after **configure** only. |
283
- | **apply** | Default: authorize → materialize. Flags: `--provision` / `--configure` / `--authorize` / `--materialize` / `--finalize` / `--destroy` (playbooks only; the VM stays). `--tags` is passed to every playbook in the run. |
283
+ | **apply** | Default: authorize → materialize. Flags: `--provision` / `--configure` / `--authorize` / `--materialize` / `--finalize` / `--destroy` (playbooks only; the VM stays). `--tags` and `--skip-tags` are passed to every playbook in the run. |
284
284
  | **attach** | SSH TTY into the agent's [live agent](#live-agents) on `/workspace` (started if needed, joined if running). `--agent` picks among installed agents. |
285
285
  | **exec** | Start a live agent with a prompt and return; the work continues unattended. See [Live agents](#live-agents). |
286
286
  | **dev** | Open VS Code/Cursor via Remote-SSH on `/workspace` (or `--browser` for code-server). |
287
- | **delete** | Run finalize → destroy playbooks, then delete VM / firewall / SSH key. `--tags` is passed to both playbooks. |
287
+ | **delete** | Run finalize → destroy playbooks, then delete VM / firewall / SSH key. `--tags` and `--skip-tags` are passed to both playbooks. |
288
+
289
+ `provision.yml` and `authorize.yml` only call [bundled roles](docs/roles.md); skip any part with `--skip-tags` (or `ansible.skip_tags` in `rig.yml`). See [ADR 0007](docs/adr/0007-managed-playbook-content-ships-as-bundled-roles.md). **Existing Environments** created before tmux entered provision (before live agents) lack it: authorize no longer installs it, so run `rig apply --provision` or re-create them.
288
290
 
289
291
  Put secret-free installs in `configure.yml` (cached). Put clone/setup that needs credentials in `materialize.yml`.
290
292
 
@@ -0,0 +1,22 @@
1
+ # Managed playbook content ships as bundled roles
2
+
3
+ The tasks behind rig's managed Stages used to be inline in the generated `provision.yml` and `authorize.yml` (hundreds of lines each). They now live in **bundled roles** inside the rig package (`src/cli/roles/`), and the generated playbooks only list which roles run. Each role covers one concern (`rig_code_server`, `rig_claude_code`, `rig_git`, ...) and has an entry point per Stage it takes part in (`tasks/install.yml` for provision, `tasks/authorize.yml` for authorize). Every task is tagged with its role, a `<role>_<group>` group and, where it applies, a cross-cutting tag, so users can skip any part with `--skip-tags` or `ansible.skip_tags` in `rig.yml`.
4
+
5
+ ## Why
6
+
7
+ A fixed 800-line playbook could not be adjusted without rig changing it, and users had no way to leave out part of it (no GitLab CLI, no Cursor, no code-server). Roles give each concern a name, defaults and tags. They ship in the release package for now rather than as separate projects, so a rig release is the version of everything.
8
+
9
+ ## Considered Options
10
+
11
+ - **Roles per Stage** (`rig_provision_code_server`, `rig_authorize_code_server`): rejected. A concern's install and credentials halves would live apart, and every Stage would repeat the same names. One role per concern with Stage entry points keeps them together.
12
+ - **Per-role boolean variables** (`rig_claude_code_enabled: false`): rejected. Tags already skip at every granularity; a second mechanism means two things to document and test.
13
+ - **Run bundled playbooks straight from the package, no `.rig/` files**: rejected. Users read `.rig/provision.yml` to see what runs, and the per-Stage file model, `--provision`/`--authorize` and the snapshot hash all assume the files.
14
+ - **Role tag on the `include_role`** (`apply: tags`): rejected. It cannot reach group tags, so `--tags rig_x_group` would select nothing. The includes are tagged `always` and the tags live inside the roles.
15
+
16
+ ## Consequences
17
+
18
+ - Bundled roles are last on `ANSIBLE_ROLES_PATH`, so a Workspace role of the same name in `.rig/local_roles` shadows one. This is an escape hatch, not an interface.
19
+ - The provision snapshot hash covers every bundled role that has `tasks/install.yml`, minus its `authorize`, `materialize` and `destroy` task files, so editing credential logic never discards a cached image. It also covers any shadowing role and `ansible.skip_tags`. The first release with roles invalidates every cached snapshot once.
20
+ - `--tags` and `--skip-tags` on the command line make a run partial: `rig create --skip-tags` boots from the base image, and no such run saves a snapshot. A Workspace's own `ansible.skip_tags` builds its own cached image.
21
+ - Tag names become public once users pass them to `--skip-tags`; renaming one is a breaking change.
22
+ - `--skip-tags always` skips every role, because the includes carry that tag.
@@ -0,0 +1,65 @@
1
+ # Bundled roles
2
+
3
+ The playbooks rig generates (`provision.yml` and `authorize.yml`) are short: they call **bundled roles** that ship inside the rig package (`src/cli/roles/`). The roles do the work, so rig can change what an Environment gets without rewriting your `.rig/` files, and you can skip any part of it.
4
+
5
+ The playbooks are regenerated on every run. Do not edit them; skip or override through tags, variables or your own roles (below).
6
+
7
+ ## Roles
8
+
9
+ One role per concern. A role has a *Stage entry point* for each Stage it takes part in: `tasks/install.yml` runs in **provision** (cached in a snapshot) and `tasks/authorize.yml` runs in **authorize** (every create and apply, never cached).
10
+
11
+ | Role | Provision (`install`) | Authorize |
12
+ | --- | --- | --- |
13
+ | `rig_base` | wait for cloud-init, apt cache, base packages | |
14
+ | `rig_workspace_user` | the [Workspace user](../GLOSSARY.md), its sudo rule, `/workspace`, `AGENTS.md` | SSH key copied from root, docker group |
15
+ | `rig_git` | GitHub CLI and GitLab CLI, for the providers the Workspace's repos use | git author, provider tokens, git credential helper |
16
+ | `rig_live_agent` | tmux | tmux config, helper scripts, Claude's state hooks, the default Agent's env exports |
17
+ | `rig_code_server` | code-server and its config directory | browser password, systemd unit |
18
+ | `rig_opencode`, `rig_claude_code`, `rig_cursor_cli` | the Agent's CLI and config; only the enabled Agents run | API key and credentials file; Claude's onboarding seed; Cursor's workspace trust |
19
+ | `rig_mcp` | | render `.rig/mcp.json` into each enabled Agent's config |
20
+ | `rig_home_ownership` | hands `/home/<user>` to the Workspace user; always runs, last | same, after everything that wrote into it |
21
+
22
+ Authorize runs the roles in dependency order: the Agent roles seed `~/.claude.json` and `settings.json`, then `rig_mcp` merges into them and `rig_live_agent` adds its hooks. Each Agent role resolves only its own API key, so skipping a role also skips its key.
23
+
24
+ ## Tags
25
+
26
+ Every task has three kinds of tag:
27
+
28
+ 1. **Role tag**: the role's name, e.g. `rig_claude_code`. Skips or selects the whole role.
29
+ 2. **Group tag**: `<role>_<group>`, e.g. `rig_claude_code_install`, `rig_claude_code_config`, `rig_git_gh`, `rig_git_glab`, `rig_workspace_user_sudo`. Skips or selects one meaningful group of tasks.
30
+ 3. **Cross-cutting tags**: `packages`, `credentials`, `agents`, `mcp`, `git`. Select a kind of work across roles.
31
+
32
+ `rig_mcp` has one group (`rig_mcp_servers`) because its steps share facts. `rig_home_ownership` is also tagged `always`, so it still runs when you use `--tags`. `--skip-tags always` skips it, and also skips every role (they are all included under `always`; the tags above only act inside them).
33
+
34
+ List the exact tags with `grep -rn "tags:" src/cli/roles/<role>/` or in the installed package; a test keeps them consistent.
35
+
36
+ ## Skipping
37
+
38
+ ```bash
39
+ rig create --skip-tags rig_cursor_cli # per run
40
+ rig apply --provision --skip-tags rig_git_glab
41
+ rig delete --skip-tags cleanup
42
+ ```
43
+
44
+ Make it permanent for the Workspace in `rig.yml`:
45
+
46
+ ```yaml
47
+ ansible:
48
+ skip_tags: [rig_git_glab, rig_code_server]
49
+ ```
50
+
51
+ `rig.yml` skip tags and `--skip-tags` are added together and passed to every playbook rig runs.
52
+
53
+ ### Skipping and snapshots
54
+
55
+ - `ansible.skip_tags` in `rig.yml` is part of the snapshot hash, so a Workspace that skips something gets its own cached image.
56
+ - A run limited on the command line (`--skip-tags`, or `apply --tags`) is partial by definition: `rig create --skip-tags` boots from the base image, and no run limited that way saves a snapshot.
57
+ - Skipping a role whose output later Stages need (for example `rig_workspace_user`) breaks those Stages. Skip with care.
58
+
59
+ ## Overriding a role
60
+
61
+ Bundled roles are searched last on the role path, after `.rig/local_roles` and `.rig/roles`. A role of the same name in `.rig/local_roles` replaces the bundled one. This is an escape hatch, not a stable interface: the role's variables and task layout may change between releases. A shadowing role in `local_roles` is part of the snapshot hash.
62
+
63
+ ## Writing your own
64
+
65
+ Put roles in `.rig/local_roles/` and call them from `configure.yml` or `materialize.yml`, which you own. Name them anything but `rig_*`.
@@ -38,7 +38,7 @@ rig = "cli.main:main"
38
38
  where = ["src"]
39
39
 
40
40
  [tool.setuptools.package-data]
41
- cli = ["assets/*"]
41
+ cli = ["assets/*", "roles/**/*.yml"]
42
42
 
43
43
  [tool.setuptools_scm]
44
44
  fallback_version = "0.0.0"
@@ -115,6 +115,8 @@ def _cmd_create(args: argparse.Namespace) -> int:
115
115
  )
116
116
  force_system = bool(getattr(args, "force_system", False) or getattr(args, "force_playbooks", False))
117
117
  force_workspace = bool(getattr(args, "force_workspace", False) or getattr(args, "force_playbooks", False))
118
+ skip_tags = getattr(args, "skip_tags", None)
119
+ env.bypass_snapshots = bool(skip_tags)
118
120
  if not env.setup(project_dir=os.getcwd()):
119
121
  return 1
120
122
  # The VM exists now: remember it before provisioning so a playbook
@@ -128,6 +130,7 @@ def _cmd_create(args: argparse.Namespace) -> int:
128
130
  stream=True,
129
131
  force_system=force_system,
130
132
  force_workspace=force_workspace,
133
+ ansible_skip_tags=skip_tags,
131
134
  ):
132
135
  return 1
133
136
 
@@ -598,7 +601,7 @@ def _cmd_apply(args: argparse.Namespace) -> int:
598
601
  log.info(
599
602
  "Usage: rig apply [name] "
600
603
  "[--provision|--configure|--authorize|--materialize|--finalize|--destroy] "
601
- "[--tags TAGS]"
604
+ "[--tags TAGS] [--skip-tags TAGS]"
602
605
  )
603
606
  return 1
604
607
 
@@ -680,6 +683,7 @@ def _cmd_apply(args: argparse.Namespace) -> int:
680
683
  soft_fail_materialize=False,
681
684
  action="apply",
682
685
  ansible_tags=getattr(args, "tags", None),
686
+ ansible_skip_tags=getattr(args, "skip_tags", None),
683
687
  )
684
688
  return 0 if ok else 1
685
689
  except Exception as e:
@@ -883,6 +887,7 @@ def _cmd_delete(args: argparse.Namespace) -> int:
883
887
  env.cleanup(
884
888
  project_dir=os.getcwd(),
885
889
  ansible_tags=getattr(args, "tags", None),
890
+ ansible_skip_tags=getattr(args, "skip_tags", None),
886
891
  )
887
892
  clear_last_env(name)
888
893
  clear_last_session(name)
@@ -1248,6 +1253,16 @@ def main(argv=None):
1248
1253
  action="store_true",
1249
1254
  help="Force materialize even when it would otherwise be skipped",
1250
1255
  )
1256
+ create_parser.add_argument(
1257
+ "--skip-tags",
1258
+ action="append",
1259
+ default=None,
1260
+ metavar="TAGS",
1261
+ help=(
1262
+ "Ansible --skip-tags for every playbook (the run boots from the base image and caches no snapshot) (comma-separated; may be repeated). "
1263
+ "Added to ansible.skip_tags from rig.yml. See docs/roles.md for the tags."
1264
+ ),
1265
+ )
1251
1266
 
1252
1267
  apply_parser = subparsers.add_parser(
1253
1268
  "apply",
@@ -1300,6 +1315,16 @@ def main(argv=None):
1300
1315
  metavar="TAGS",
1301
1316
  help=("Ansible --tags for every playbook in this run (comma-separated; may be repeated)."),
1302
1317
  )
1318
+ apply_parser.add_argument(
1319
+ "--skip-tags",
1320
+ action="append",
1321
+ default=None,
1322
+ metavar="TAGS",
1323
+ help=(
1324
+ "Ansible --skip-tags for every playbook in this run (comma-separated; may be repeated). "
1325
+ "Added to ansible.skip_tags from rig.yml. See docs/roles.md for the tags."
1326
+ ),
1327
+ )
1303
1328
  # Legacy aliases
1304
1329
  apply_parser.add_argument(
1305
1330
  "--system",
@@ -1565,6 +1590,16 @@ def main(argv=None):
1565
1590
  metavar="TAGS",
1566
1591
  help=("Ansible --tags for the finalize and destroy playbooks (comma-separated; may be repeated)"),
1567
1592
  )
1593
+ delete_parser.add_argument(
1594
+ "--skip-tags",
1595
+ action="append",
1596
+ default=None,
1597
+ metavar="TAGS",
1598
+ help=(
1599
+ "Ansible --skip-tags for the finalize and destroy playbooks (comma-separated; may be repeated). "
1600
+ "Added to ansible.skip_tags from rig.yml. See docs/roles.md for the tags."
1601
+ ),
1602
+ )
1568
1603
 
1569
1604
  vars_parser = subparsers.add_parser(
1570
1605
  "vars",