Skip to content

refactor(ansible): extract AWS CLI install bundle into internal/insta…#2153

Open
dliappis wants to merge 2 commits into
developfrom
refactor/extract-aws-ec2-host-tooling
Open

refactor(ansible): extract AWS CLI install bundle into internal/insta…#2153
dliappis wants to merge 2 commits into
developfrom
refactor/extract-aws-ec2-host-tooling

Conversation

@dliappis
Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Refactor (ansible task structure, no behavior change).

What is the current behavior?

A number of AWS install/setup tasks live inside ansible/tasks/setup-supabase-internal.yml, mixed in with the rest of the supabase-internal install steps. There's no atomic "AWS CLI install bundle" boundary.

What is the new behavior?

Same install behavior. The AWS tasks now live in a dedicated ansible/tasks/internal/install-aws-cli.yml, imported from the same spot in setup-supabase-internal.yml.

This lays cleaner boundaries for future postgres AMI runtime decomposition work, without changing any install behavior, conditionals, or tags.

Preserved precisely:

  • Conditional gating: parent Install Supabase specific content import still gates on when: debpkg_mode or nixpkg_mode. The new file inherits this implicitly.
  • Tag inheritance: the new import_tasks line carries no extra tags, so the moved tasks continue to inherit only install-supabase-internal from the outermost wrapper — identical to before.
  • ec2-instance-connect in playbook.yml is intentionally not moved. It stays as a top-level task in playbook.yml with its existing aws-only tag and when: qemu_mode is undefined gate. (Moving it would have changed tag semantics with possible risk hence out of scope for this refactor.)

Additional context

Related https://linear.app/supabase/project/postgres-ami-runtime-decomposition-90ecfc1d03d4/overview

…ll-aws-cli.yml

Move the 6 inline AWS CLI / amazon-ec2-utils tasks from
ansible/tasks/setup-supabase-internal.yml into a single
ansible/tasks/internal/install-aws-cli.yml file.

Behavior preserved:
- AWS CLI + amazon-ec2-utils still run under the same conditions
  (parent import gated on debpkg_mode or nixpkg_mode).
- ec2-instance-connect is intentionally NOT moved; it stays as a
  top-level task in playbook.yml with its existing aws-only tag and
  'when: qemu_mode is undefined' gate.

Tags preserved:
- AWS CLI tasks + amazon-ec2-utils continue to inherit only
  'install-supabase-internal' via the parent import in playbook.yml.
  The import line inside setup-supabase-internal.yml carries no
  additional tags, matching the pre-refactor semantics.

Motivation: collecting these 6 tasks into a single file makes the
ansible boundary cleaner and is a small step toward per-component
task files (the larger setup-supabase-internal.yml decomposition
already underway via internal/*.yml).

Cross-repo scan (postgres + supabox + salt) shows no broken references:
- supabox-playbook.yml only mentions amazon-ec2-utils in a comment;
  the supabox build skips this path by not importing
  setup-supabase-internal.yml.
- salt repo has zero references to install-supabase-internal or aws-only.
@dliappis dliappis self-assigned this May 13, 2026
@dliappis dliappis requested review from a team as code owners May 13, 2026 10:47
@dliappis
Copy link
Copy Markdown
Contributor Author

I did a small sanity check by comparing tasks created via

# confirm we are on the branch for this PR
git --no-pager log -1 --format="%D %h %s"
HEAD -> refactor/extract-aws-ec2-host-tooling, origin/refactor/extract-aws-ec2-host-tooling d109fc0c refactor(ansible): extract AWS CLI install bundle into internal/install-aws-cli.yml

# list of tasks created by this branch `refactor/extract-aws-ec2-host-tooling`
ansible-playbook --list-tasks ansible/playbook.yml \
    --extra-vars '{"nixpkg_mode":true,"debpkg_mode":false,"stage2_nix":false}' \
    2>/dev/null > /tmp/branch.txt

# list of tasks by latest develop branch
git worktree add /tmp/pg-develop develop
cd /tmp/pg-develop && ansible-playbook --list-tasks ansible/playbook.yml \
    --extra-vars '{"nixpkg_mode":true,"debpkg_mode":false,"stage2_nix":false}' \
    2>/dev/null) > /tmp/develop.txt

# compare them, shows no change
diff /tmp/develop.txt /tmp/branch.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant