作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在试验是否可以检查 bundle
的版本在本地主机中使用 ansible-playbook local.yml
如local.yml
所示以下。
---
- hosts: local
remote_user: someuser
tasks:
- name: Check bundle version
shell: "{{ansible_user_shell}} -l -c 'bundle --version'"
args:
chdir: "/path/to/rails/dir"
[local]
127.0.0.1
[local:vars]
ansible_ssh_user=someuser
stderr: zsh:1: command not found: bundle`
-l
运行 zsh (使用登录外壳)选项。但它不起作用。有什么我想念的吗?
最佳答案
我自己解决了这个问题。问题是zsh的配置。我认为 .zshrc 在每次登录时都会执行。这是不准确的,因为 .zshrc 仅在登录和 时加载。互动 贝壳。在上述情况下,命令为 不是 在交互式 shell 上运行,因此未加载 .zshrc。
为了在每次使用登录 shell 时加载 .zshrc,我创建了 .zprofile
它在登录外壳上加载如下:
# include .zshrc if it exists
if [ -f "$HOME/.zshrc" ]; then
. "$HOME/.zshrc"
fi
关于ansible - .zshrc 没有在 Ansible 中加载?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32306653/
我是一名优秀的程序员,十分优秀!