1
我想通過ansible導出多個變量。我有這樣的任務,我的劇本運行.bash_profile出現問題的原因
- name: Set the MIRA_ROOT and Binding_Address in Profile
lineinfile: dest=/root/.bash_profile insertbefore='^export PATH' line=" {{item.line}}"
with_items:
- { line: 'export JAVA_HOME=/usr/java/jdk{{jdk_version}}' }
- { line: 'export MIRA_ROOT=/opt/data/rg01/mira' }
如何運行.bash_profile中?我寫了這個代碼的.bash_profile運行,但它不能正常工作
- name: Run the bash_profile
shell: source /root/.bash_profile
我要永久設定的變量,我試圖在/ etc /環境,但它不能正常工作請用示例幫助我 – user3345734