Skip to content

Promote the HashiCorp APT key convergence to sandbox and modules/ (production) - #305

Merged
akuzminsky merged 1 commit into
mainfrom
promote-hashicorp-keyring-converge
Oct 3, 2026
Merged

akuzminsky merged 1 commit into
mainfrom
promote-hashicorp-keyring-converge

Conversation

@akuzminsky

Copy link
Copy Markdown
Member

Phase 3 of 3 for the HashiCorp signing-key rotation. A straight promotion of #304.

  1. Converge the HashiCorp APT key before apt_update (development) #304 added profile::hashicorp_repo to the development environment (build334).
  2. fix!: let Puppet own the HashiCorp APT repo instead of bundling its key terraform-aws-terraformer#42 (merged) stopped the module from bundling the key and seeding the repo.
  3. This PR promotes the Puppet change to environments/sandbox and modules/.

Proven in development

terraform-aws-terraformer#42's integration test runs with environment = "development". With the module no longer seeding the HashiCorp repo, both CI runs passed, and the new check confirmed Puppet configured the repo:

verify_terraform_from_hashicorp_repo(): Terraform v1.6.6
verify_terraform_from_hashicorp_repo(): ✓ Terraform installed from the HashiCorp APT repository
======================== 1 passed in 1015.30s (0:16:55) ========================

A finished bootstrap also means apt_update in stage init verified the repo with the key Puppet fetched.

What changed

hashicorp_repo.pp, converge-apt-keyring.sh and the terraformer.pp declaration are copied unchanged from environments/development. All three copies of each file are now byte-identical. Before the copy, sandbox's and modules/'s terraformer.pp matched development's pre-#304 version, and both declare apt in stage init the same way. Only role::terraformer includes profile::terraformer.

Verification of the production copy

I re-ran the #304 container test (Puppet 8.4.0, puppetlabs-apt 9.4.0, ubuntu:noble) against modules/profile. The container was seeded with the terraform-aws-terraformer 3.x state, where the 2023 key sits at /etc/apt/cloud-init.gpg.d/hashicorp.gpg:

apt-get update before Puppet: exit=100
/Stage[init]/Profile::Hashicorp_repo/Exec[profile::hashicorp_repo::converge]/returns: D55C0D1AC78A8D8126CB631CFC9CA96ACA026560
/Stage[init]/Profile::Hashicorp_repo/File[/etc/apt/sources.list.d/hashicorp.list]/content: content changed ...
/Stage[init]/Profile::Hashicorp_repo/File[/etc/apt/cloud-init.gpg.d/hashicorp.gpg]/ensure: removed
/Stage[init]/Apt::Update/Exec[apt_update]/returns: executed successfully
/Stage[main]/Test_terraformer/Package[terraform]/ensure: created
apt-get update after Puppet: exit=0

After merge

  • Once this build is published, terraform-aws-terraformer can be released (4.0.0, breaking). Until then, an instance in the production environment would boot without the HashiCorp repo.
  • Terraformers already broken on 3.x are stuck in stage init and may not get this package on their own. Fix them by hand with the one-liner in terraform-aws-terraformer's docs/troubleshooting.md, or replace them by upgrading the module.
  • Follow-up, not in this PR: profile::infrahouse_repo converges in stage main, so it has the same blind spot for our own key.

🤖 Generated with Claude Code

…oduction)

Straight promotion of #304, proven end to end by
infrahouse/terraform-aws-terraformer#42: with the module no longer seeding the
HashiCorp repository, a development-environment terraformer got Terraform from
apt.releases.hashicorp.com via profile::hashicorp_repo.

All three copies of hashicorp_repo.pp, converge-apt-keyring.sh and
terraformer.pp are now identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akuzminsky
akuzminsky merged commit a90ddc4 into main Oct 3, 2026
2 checks passed
@akuzminsky
akuzminsky deleted the promote-hashicorp-keyring-converge branch October 3, 2026 20:14
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.

2 participants