https://pulumi.com logo
s

sparse-student-54516

10/22/2021, 12:28 PM
Hi, I am trying to set admin password and also GitHub auth provider for rancher using typescript. I am using below code after converting it from terraform. What could be the issue? I am getting following error:
error: Rancher is not ready: Doing get: Get "<https://65.21.242.158/ping>": dial tcp 65.21.242.158:443: connect: connection refused
Copy code
const bootstrap = new rancher2.Provider("bootstrap", {
    apiUrl: rancherUrl,
    bootstrap: true,
    insecure: true,
});


const admin = new rancher2.Bootstrap("admin", {
    password: "focuswow",
    telemetry: true,
}, {
    provider: bootstrap,
    dependsOn: [rancherServer],
});


const github = new rancher2.AuthConfigGithub("github", {
    clientId: "<CLIENT_ID>",
    clientSecret: "<CLIENT_SECRET>",
}, {
    provider: bootstrap,
    dependsOn: [admin],
});
b

billowy-army-68599

10/22/2021, 3:06 PM
@sparse-student-54516 the clue is in the error message, your rancher server isn't responding on that IP address
s

sparse-student-54516

10/22/2021, 3:07 PM
Yes…..I thought that as well, but that’s the generic message, I waited and tried to run the rancher is up, still facing the same isse. For time being I have created API keys manually and moving on with the rest of the automation.
thanks @billowy-army-68599
b

billowy-army-68599

10/22/2021, 3:08 PM
ah got it, things are now working?
s

sparse-student-54516

10/22/2021, 3:09 PM
Now I am doing like this: Automate part1 -> manual API keys creation -> automate part 2
😢
Since I am using hetzner cloud for installing rancher, very less example available.
b

billowy-army-68599

10/22/2021, 3:12 PM
@sparse-student-54516 after you provision your rancher cluster, if you do
curl <https://65.21.242.158/ping>
what happens?
also do you have a signed certificate for it?
s

sparse-student-54516

10/22/2021, 3:14 PM
woah
1. I do not have a signed certificate for now 2. Curl gives error related to not using SSL I guess
Copy code
➜  devops-rancher-next git:(feat/pre-prod-next) ✗ curl <https://65.21.242.158/ping>
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: <https://curl.haxx.se/docs/sslcerts.html>

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
it returns pong if curl is used with
http
b

billowy-army-68599

10/22/2021, 3:22 PM
that's more than likely the issue, have you tried setting:
Copy code
RANCHER_INSECURE
or
pulumi config set rancher:insecure true
s

sparse-student-54516

10/22/2021, 3:23 PM
in provider I have mentioned, as you can see in the code snippet I used
@billowy-army-68599
pulumi config set rancher:insecure true
worked for me to create github as Auth provider. Thank you very much
b

billowy-army-68599

10/22/2021, 3:40 PM
no worries!
s

sparse-student-54516

10/27/2021, 8:26 AM
Even though it worked but it still doesn't directly work from pulumi.
The Terraform code for the same thing works but after converting it to pulumi using tf2pulumi.
It doesn't work.
I could use some help