我正在使用Ubuntu 12.04作为salt-master和salt-minion.当我尝试使用salt在salt-minion中安装一个包时,它只安装在特定于系统的系统中.但我需要在用户特定的安装.如何将RVM和RUBY安装到salt-minion中的特定用户?
您可以在
cmd
状态下使用用户arg以特定用户身份运行它,例如:
RVM / init.sls:
curl: pkg: - installed rvm: cmd: - run - name: curl -L get.rvm.io | bash -s stable - user: vagrant - unless: test -s "$HOME/.rvm/scripts/rvm" - require: - pkg: curl rvm_bashrc: cmd: - run - name: echo "[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm" >> $HOME/.bashrc - user: vagrant - unless: grep ".rvm/scripts/rvm" ~/.bashrc - require: - cmd: rvm
RVM /红宝石/ init.sls:
include: - rvm ruby: cmd: - run - name: rvm install 2.1.0 - user: vagrant - unless: test -d $HOME/.rvm/rubies/2.1.0 - require: - cmd: rvm_bashrc