Accessing environmental variables on rundeck node

痞子三分冷 提交于 2019-12-10 23:34:57

问题


This is a two-part question. I am running a script using rundeck that depends on access to environmental variables system-wide on the node I'm executing the script on that I have set in /etc/environment.

First, how do I get rundeck to ingest the system environment? I can't find any option in rundeck to do this.

Second, why doesn't this happen by default? I'm under the impression that rundeck works through ssh; shouldn't the system environment be loaded every time it logs in to the node?


回答1:


First, how do I get rundeck to ingest the system environment? I can't find any option in rundeck to do this.

I succeeded to perform this by adding the following lines to:

set -a
. /etc/environment
. /etc/profile

1) put those lines into the file: /etc/rundeck/profile

2) put those lines into a script step

Remark: I'm using only script steps in my rundeck and I'm always put this lines in the first line of the script step:

#!/usr/bin/env bash

Second, why doesn't this happen by default? I'm under the impression that rundeck works through ssh; shouldn't the system environment be loaded every time it logs in to the node?

I think that you need to cinfigre something in the ssh_config file. check this link: Rundeck not setting up environment variable for remote execution with different ssh port



来源:https://stackoverflow.com/questions/38855378/accessing-environmental-variables-on-rundeck-node

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!