有没有办法在 Ansible 中评估相对路径?
tasks:
- name: Run docker containers
include: tasks/dockerup.yml src_code='..'
基本上我有兴趣将源代码路径传递给我的任务。恰好源代码是
{{ansible_inventory}}
的父路径但似乎没有任何东西可以开箱即用。---- 更多信息 ----
项目结构:
myproj
app
deploy
deploy.yml
所以我试图访问
app
来自 deploy.yml
.
最佳答案
关于path - 在 Ansible 中获取父目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35271368/