Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let k8s_ca_certificates_install depend on var.depends_on_ #164

Merged

Conversation

sschaeffner
Copy link
Contributor

Hi, thanks for providing this module.

I think this line is missing unintentionally. Without the change I get the following error:

│ Error: remote-exec provisioner error
│ 
│   with module.k3s.null_resource.k8s_ca_certificates_install[4],
│   on .terraform/modules/k3s/server_nodes.tf line 158, in resource "null_resource" "k8s_ca_certificates_install":
│  158:   provisioner "remote-exec" {
│ 
│ timeout - last error: SSH authentication failed (core@[...ipv4...]:22): ssh: handshake failed: ssh: unable to authenticate, attempted methods [none
│ publickey], no supported methods remain

The context is a single node on hcloud (Hetzner) booted to rescue system, Flatcar Linux installation through calling their install script, k3s installation through your module (and finally a fluxCD installation).

I think the issue is that authenticating to the different install steps requires different credentials and this one step tries to authenticate too early, which fails. Waiting for the correct - later - install step allows authentication.

As far as I can tell, this change does not have any negative impact, so I didn't investigate the exact reason / issue. If you need any further information (e.g. minimal example), I'd be happy to help.

@sschaeffner sschaeffner force-pushed the add-certificate-install-dependency branch from 8cf37e1 to 77daedd Compare December 29, 2023 14:23
@sschaeffner sschaeffner force-pushed the add-certificate-install-dependency branch from 77daedd to ed49c28 Compare December 29, 2023 14:24
@xunleii
Copy link
Owner

xunleii commented Jan 7, 2024

Hi @sschaeffner, thanks for your PR.

Yup, you're right; all "actions" on the machine should be done after de depends_on_ (I would love to see module with a true depends_on field :( )

@xunleii xunleii merged commit 442266d into xunleii:master Jan 7, 2024
4 of 5 checks passed
@sschaeffner sschaeffner deleted the add-certificate-install-dependency branch January 7, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants