Setting environment variables with puppet

前端 未结 5 2055
离开以前
离开以前 2021-02-05 22:36

I\'m trying to work out the best way to set some environment variables with puppet.

I could use exec and just do export VAR=blah. However, that would only

5条回答
  •  时光说笑
    2021-02-05 23:01

    Or an alternate means to an indempotent result:

    Example

    if [[ ! grep PINTO_HOME /root/.bashrc | wc -l > 0 ]] ; then
            echo "export PINTO_HOME=/opt/local/pinto" >> /root/.bashrc ;
    fi
    

    This option permits this environmental variable to be set when the presence of the pinto application makes it warrented rather than having to compose a user's .bash_profile regardless of what applications may wind up on the box.

提交回复
热议问题