If I understand the usecase correctly, you are building a job (so creating a Job Template), that will be executed on host, e.g. target.example.com to join some domain. The resulting script should be executed on the target machine. The target is typically not specified as an input. Instead, you run the job on a given host. That means the host target.example.com must be registered to your Foreman first. Given the job is then executed on the host, Foreman opens SSH connection to it, therefore Foreman’s SSH key must be installed on the target.example.com
Once you have the Job Template ready, navigate the Host detail page on which you want to execute that. There’s a “Schedule a job” drop down, click on that and select the job you want to run.
There are other ways how you can run the job, e.g. on multiple hosts at a same time. But the point is, the target machine is not a job input.
I may have misunderstood the goal completely, so please try to explain what your’e after if that’s the case.