Skip to content

refactor(ami): share provisioning steps between qemu and ami builds - #2567

Draft
brainrake wants to merge 3 commits into
developfrom
martonboros/mpg-1383-share-provisioning-script
Draft

brainrake wants to merge 3 commits into
developfrom
martonboros/mpg-1383-share-provisioning-script

Conversation

@brainrake

@brainrake brainrake commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Moves the steps that the QEMU and AMI builds duplicated into ebssurrogate/scripts/provision-common.sh. Both Packer builds upload it to /tmp/provision-common.sh and source it. The AMI chroot scripts get a copy in /mnt/tmp.

Shared:

  • Nix install, apt update and cleanup, the playbook run, Nix GC, package and disk reports.
  • Locale, postgres env, sshd password auth.
  • The image cleanup tail: history, logs, SSH keys, zero-fill, login records.
  • The log directory setup.

Target-specific steps stay in each script, including the package purge lists.

Behavior changes

  • AMI: /var/log/wal-g and its files go from 0300 to 0310, and pitr.log is 0340. QEMU already used these values. The salt vector formula enforces them on v2 hosts so vector can read pitr.log. The image now carries them for hosts without salt.
  • QEMU: lastlog and wtmp are emptied after the zero-fill, as on the AMI.
  • --extra-vars JSON loses its inner space. The arguments are otherwise the same.

Testing

Checked with stubbed ansible-playbook and stubbed cleanup commands: the command streams match the old scripts apart from the changes above. No image was built.

🤖 Generated with Claude Code

MPG-1383

Move the Nix install, playbook run, Nix GC and report steps that
qemu-bootstrap-nix.sh and nix-provision.sh duplicated into
provision-common.sh. Both Packer builds upload it to /tmp.

Refs: MPG-1383

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Package version diff: none (aarch64-linux, x86_64-linux)

brainrake and others added 2 commits October 16, 2026 15:26
Move locale, postgres env, sshd password auth and the image cleanup
tail into provision-common.sh. The AMI chroot scripts get the library
copied into /mnt/tmp.

Refs: MPG-1383

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Share the image log setup between both builds. The AMI now ships
/var/log/wal-g as 0310 and pitr.log as 0340, matching QEMU and the
salt vector formula, so vector can read pitr.log without salt.

Refs: MPG-1383

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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