diff --git a/README.md b/README.md index 696b6b5c..6182ea71 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,40 @@ See the section on plugins in the [ManageIQ Developer Setup](http://manageiq.org For quick local setup run `bin/setup`, which will clone the core ManageIQ repository under the *spec* directory and setup necessary config files. If you have already cloned it, you can run `bin/update` to bring the core ManageIQ code up to date. +### Running Opentofu Runner locally +First create the certs +``` +mkdir certs +openssl req -x509 -newkey rsa -days 1095 -keyout certs/tf_runner.key -out certs/tf_runner.crt -subj "/CN=server" -nodes -batch +chmod 666 certs/tf_runner.crt certs/tf_runner.key +``` + +Next ensure that you have the opentofu-runner image pulled locally: +``` +docker pull docker.io/manageiq/opentofu-runner:latest +``` + +If your database connection requires a password then create a secret: +``` +echo '{"DATABASE_PASSWORD":"mypassword"}' | docker secret create opentofu-runner-secret - +``` + +And add `--secret opentofu-runner-secret` to the command below + +Now you can start your opentofu-runner: +``` +docker run --name=opentofu-runner --rm --network=host -v ./certs/tf_runner.crt:/opt/app-root/src/config/cert/tls.crt:z -v ./certs/tf_runner.key:/opt/app-root/src/config/cert/tls.key --env DATABASE_HOSTNAME=localhost --env DATABASE_NAME=vmdb_development --env DATABASE_USERNAME=root --env MEMCACHE_SERVERS=127.0.0.1:11211 --env PORT=6000 --expose=6000 docker.io/manageiq/opentofu-runner:latest +``` + +Verify that everything is working by checking `Terraform::Runner.available?` with a rails console: +``` +$ TERRAFORM_RUNNER_URL=https://localhost:6000 rails c +>> Terraform::Runner.available? +=> true +``` + +To stop the opentofu-runner `docker stop opentofu-runner` in another terminal. + ## License The gem is available as open source under the terms of the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).