I am setting up an EC2 instance with Terraform, and I need to run a large script during this process. I want to download the script from our gitlab repository with something like:
git clone [email protected]:a_name/project.git
Cloning into 'project'...
The authenticity of host 'gitlab.something.org (12.34.56.78)' can't be established.
ECDSA key fingerprint is SHA256:....
Are you sure you want to continue connecting (yes/no)? yes
Cloning into ...
When I run this from the command line, I have to confirm, but this isn't possible in my situation.
However in /var/log/cloud-init-output.log
I see this (after having uploaded the correct, private key):
Cloning into 'project'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I am hoping this error is simply the result of not responding with a 'yes' - is there a way to tell git that it's OK, I know what I am doing, and just get on with it?