ansible-playbook下执行环境变量添加的问题

2019-08-08  本文已影响0人  张都尉

ansible-playbook在执行操作环境变量时,如何添加都不生效

---
- name: tocat environment /etc/profile
  shell: echo -e '#tomcat environment\nexport CATALINA_HOME=/usr/share/tomcat\nexport PATH=$PATH:$CATALINA_HOME/bin'>> ~/.bash_profile; source /etc/profile

如上添加执行未果

---
- name: tocat environment /root/.bashrc
  shell: echo -e '#tomcat environment\nexport CATALINA_HOME=/usr/share/tomcat\nexport PATH=$PATH:$CATALINA_HOME/bin'>> ~/.bash_profile; source ~/.bash_profile
上一篇 下一篇

猜你喜欢

热点阅读