My job run on 2.0 and I am trying to run a simple terraform pipeline with init, plan… etc… It used to work fine, but we decided to use our modules in a separate repository and they’re both private repositories. Well, the problem is that now during the terraform init command I get an error because it looks like circleci is trying to ssh to the repo and is waiting for an answer to the following:
terraform init . terraform plan Initializing modules... Downloading githubDOTcom/my-modules-repo.git for module_name... The authenticity of host 'github(220.127.116.11)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes/no/[fingerprint])? Step was canceled
By googling it I found a few tricks that could probably solve it, such as including ssh-keyscan 18.104.22.168 >> ~/.ssh/known_hosts or even mkdir ~/.ssh/ && echo -e “Host githubDOTcom\n\tStrictHostKeyChecking no\n” > ~/.ssh/config. None worked for me. In fact, when I include that ip, I receive a new one on the console… so it’s always a different one, which makes me believe it should have a better solution to this.
Here’s my current configuration: (Oh, and since new users can’t post more than two links here, I changed the urls to githubDOTcom
- image: hashicorp/terraform:light
# - “nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8”
# name: Avoid hosts unknown for github
# command: mkdir ~/.ssh/ && echo -e “Host githubDOTcom\n\tStrictHostKeyChecking no\n” > ~/.ssh/config
name: Feature branch terraform plan o
ssh-keyscan 22.214.171.124 >> ~/.ssh/known_hosts
ssh-keyscan 126.96.36.199 >> ~/.ssh/known_hosts
ssh-keyscan 188.8.131.52 >> ~/.ssh/known_hosts
#mkdir ~/.ssh/ && echo -e “Host githubDOTcom\n\tStrictHostKeyChecking no\n” > ~/.ssh/config
terraform init .
Init and Plan:
Any tips? Thanks.