ManageIQ / manageiq-providers-embedded_terraform

ManageIQ plugin for the Embedded Terraform provider.
Apache License 2.0
0 stars 11 forks source link

Fix `Terraform::Runner.available?` #70

Closed agrare closed 2 months ago

agrare commented 2 months ago

The endpoint for opentofu-runner ping is just /ping not /api/ping:

With the opentofu-runner running:

# systemctl status opentofu-runner
● opentofu-runner.service - Opentofu Runner Container
     Loaded: loaded (/usr/lib/systemd/system/opentofu-runner.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/opentofu-runner.service.d
             └─override.conf
     Active: active (running) since Fri 2024-08-30 10:28:33 EDT; 47min ago

Running Terraform::Runner.available?:

irb(main):001:0> Terraform::Runner.available?
=> false

After this change:

irb(main):001:0> Terraform::Runner.available?
=> true

We can see from the output that the path is just /ping from the journalctl -u opentofu-runner output:

opentofu-runner[6767]: Server is running at https://[::1]:6000
opentofu-runner[6767]: Try https://[::1]:6000/ping

This was added in https://github.com/ManageIQ/manageiq-providers-embedded_terraform/pull/14 I'm not sure if the opentofu-runner image changed or if it was just always the wrong ping path.

Fryguy commented 2 months ago

Backported to radjabov in commit 2c80e39d9d2b8cd2da2508f32ddbf57b43b3a424.

commit 2c80e39d9d2b8cd2da2508f32ddbf57b43b3a424
Author: Jason Frey <fryguy9@gmail.com>
Date:   Fri Aug 30 11:44:21 2024 -0400

    Merge pull request #70 from agrare/fix_terraform_runner_available

    Fix `Terraform::Runner.available?`

    (cherry picked from commit 5021cc4d035e2bced1d701d835f2fed1d4331f06)