- main github repo with Terraform12 code
- module in secondary repo which is referred as
source = "firstname.lastname@example.org:user/mod_repo?ref=v1.0.0"
- Jenkins 2.249 (can’t update now)
- a private ssh key in Jenkins to access
When I try to run
terraform init in Jenkins pipeline I get
Could not download module "vpc" (main.tf:1) source code from "email@example.com:user/mod_repo?ref=v1.0.0": error downloading 'ssh://firstname.lastname@example.org/user/mod_repo?ref=v1.0.0': /usr/bin/git exited with 128: Cloning into '.terraform/modules/vpc'... Permission denied (publickey).
Locally I can do it without issues.
How should I configure the key in
Jenkinsfile (or where else?) to allow access to the secondary repo?
Could anyone advise, please? Thank you.