Remote Host Configuration (rhc) worker for executing scripts on hosts managed by Red Hat Insights. Interpreter used to execute the script is defined inside the supplied yaml file - served by insights.
Everything starts when message is sent to rhcd. Worker then:
- Picks up the message from rhcd
- Downloads the worker playbook as temporary file (see Worker playbooks)
- Verify the integrity of the playbook with
insights-client
- Executes the script
- Reads stdout of the script
- Sends the stdout wrapped in JSON back to rhcd
Then rhcd sends the message to upload service (with data from worker) in order to show the results in Insights UI - our setup for local development simulates the upload with minio storage.
There is one special variable that must be set in order to run our worker and that is YGG_SOCKET_ADDR
, this variable value is set by rhcd
via --socket-addr
option.
Other than that there are no special variables, however if downloaded yaml file contained content_vars
(like the example above), then before the execution of the bash script (content
) all such variables are set as environment variables and prefixed with RHC_WORKER_
, after script execution is done they are unset.
Yes, some values can be changed in the config file located at /etc/rhc/workers/rhc-worker-script.yml
. After installing the rhc-worker-script
package, a config file will be created with the default values required for the worker to start processing messages, the config must have valid yaml format, see all available fields in the rhc-worker-script.yml in the root of the repository.
No, not right now. If you want this feature please create an issue or upvote already existing issue.
- Rodolfo Olivieri - [email protected]
- Andrea Waltlova - [email protected]