Open odise opened 2 years ago
I was able to replicate the issue on the ARM64v8 architecture, but not on the AMD64. I'll have to dig to see why the different builds have different results for ssh keys.
Any help determining why the arm build isn't working is greatly appreciated.
Found the issue. In the arm build I don't have ssh installed.
~/generations/2/main$ ssh
bash: ssh: command not found
Fix should be relatively easy, but the tftask
pods usually take a long time to build for all the versions. Hopefully I'll have them all updated for next week.
Oh, but in the error you posted, it has to do with Bad owner or permissions on /home/tfo-runner/.ssh/config
. Then I haven't replicated that issue yet. Ok still looking then. :(
@odise I made some changes in the task scripts to attempt to fix the .ssh dir. I hope this fixes the issue you're having.
https://github.com/GalleyBytes/terraform-operator-tasks/pull/9
To make use of the changes, the following additions to the spec may be used:
spec:
# ...
taskOptions:
- for: [ init, plan, apply, init-delete, plan-delete, apply-delete ]
script:
source: https://raw.githubusercontent.com/GalleyBytes/terraform-operator-tasks/always-attempt-to-fix-ssh/tf.sh
- for: [ setup ]
script:
source: https://raw.githubusercontent.com/GalleyBytes/terraform-operator-tasks/always-attempt-to-fix-ssh/setup.sh
@isaaguilar this seems to fix the issue. Just to satisfy me curiosity: I think I tried to achieve exactly the same with a preinit
step. Why didn't it took effect though?
The preinit
should have worked. Perhaps the chmod in the preinit
used 660
in order to produce -rw-rw----
permissions:
-rw-rw---- 1 tfo-runn 2000 399 Oct 7 12:40 github.com
and the fix uses 600
which produces -rw-------
permissions:
-rw------- 1 tfo-runner 2000 1.7K Oct 10 20:17 /home/tfo-runner/.ssh/github.com
I noticed some weird behaviour when TF code to be deployed is depending on private GIT repositories. The
terraform init
step fails with the following error:Interestingly the
setup
step runs successful although it depends on an internal GIT repository. The error above is a result ofterraform init
trying to download further modules from the same GIT repo.Here is my Terraform manifest:
I defines a
preinit
step to investigate the/home/tfo-runner/.ssh
directory and found this:All attempts to change the permissions within
preinit
failed ininit
with same result.I'm using the Helm chart v0.2.15 from https://galleybytes.github.io/helm-charts which installs
terraform-operator:v0.9.0-pre3
.