Skip to content

Commit 217070c

Browse files
author
Kevin Paulisse
committed
Add documentation about the ENC environment
1 parent f0fc0fb commit 217070c

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

doc/configuration-enc.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,37 @@ For example, when compiling the catalog for `some-node.github.net`, Puppet will
6767
```
6868
6969
Sometimes the ENC script requires credentials or makes other assumptions about the system on which it is running. To be able to run the ENC script on systems other than your Puppet master, you will need to ensure that any such credentials are supplied and other assumptions are met.
70+
71+
## Environment
72+
73+
When the ENC is executed, the following environment variables are set to match the environment of the shell in which octocatalog-diff executes:
74+
75+
- `HOME`
76+
- `PATH`
77+
- `PWD` (set to the temporary directory as previously described)
78+
79+
No other environment variables are passed from the shell. If you wish to pass additional environment variables, you must explicitly list them with the `--pass-env-vars` CLI flag or `settings[:pass_env_vars]` array in your configuration file.
80+
81+
As an example, consider that your ENC is written in Python, and needs the `PYTHONPATH` variable set to `/usr/local/lib/python-custom`. Even if this environment variable is set when octocatalog-diff is run, it will not be available to the ENC script. You may pass the variable via the command line:
82+
83+
```
84+
octocatalog-diff --pass-env-vars PYTHONPATH ...
85+
```
86+
87+
Or you may specify it in your configuration file:
88+
89+
```
90+
settings[:pass_env_vars] = [ 'PYTHONPATH' ]
91+
```
92+
93+
If you wish to specify multiple environment variables to pass:
94+
95+
```
96+
octocatalog-diff --pass-env-vars PYTHONPATH,SECONDVAR,THIRDVAR ...
97+
```
98+
99+
or
100+
101+
```
102+
settings[:pass_env_vars] = [ 'PYTHONPATH', 'SECONDVAR', 'THIRDVAR' ]
103+
```

0 commit comments

Comments
 (0)