I am running a terragrunt
script through the ansible play using the ansible shell
module.
Ansible task
environment:
AWS_ACCESS_KEY_ID: "{{aws_access_key_id}}"
AWS_SECRET_ACCESS_KEY: "{{aws_secret_access_key}}"
AWS_DEFAULT_REGION: "{{aws_region}}"
AWS_SESSION_TOKEN: "{{aws_session_token}}"
shell: "{{command}}"
Here I am giving the command
as an argument, its look like
terragrunt plan --terragrunt-working-dir /workspace/terraform/vpc
Inside my terragrunt script, some terraform modules are referring from private a Github repo and its should be downloaded as part of the command execution.
terraform {
source = "git::https://<accesstoken>@<domanian>/vpc.git?ref=v0.2.0"
}
But when I run the ansible role I am getting authentication error from the git, but the repo cloning in the host machine works fine (No authentication issues).
I am having the git authentication issue from the ansible play not from the host machine(For now my host is localhost)
ERROR FROM TERRAGRUNT
error downloading 'https://<token>@<domain>/repo.git?ref=v0.7.0': /usr/local/bin/git exited with 128: Cloning into '/Users/<name>/Projects/terraform/integration/hli/eks/.terragrunt-cache/odeTjZcnAck1LSD4uQ9-Wn_30cQ/xBn6R6SbWXfZ6nabGc-LFpX6RXk'...
fatal: Authentication failed for 'https://<token>@<domain>/repo.git/'