作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以我试图简单地返回 '/opt/omeka/apps'/但尽管在先前的语句中返回了调试语句返回我正在寻找的内容,但我得到的响应是它不存在。
我假设这里有一个愚蠢的语法错误,只是在寻找更正。
var.yml
omeka_cache_base: /opt/omeka
omeka_cache:
- app: "{{ omeka_cache_base }}/apps"
- plugins: "{{ omeka_cache_base }}/plugins"
- theme: "{{ omeka_cache_base }}/themes"
role.yml
- name: debug
debug: var=omeka_cache
- name: download applications files
unarchive:
src: "http://omeka.org/files/omeka-{{ inst.value.version }}.zip"
copy: no
dest: "{{ omeka_cache.app }}"
Ansible 返回
TASK [debug] *******************************************************************
ok: [localhost] => {
"omeka_cache": [
{
"app": "/opt/omeka/apps"
},
{
"plugins": "/opt/omeka/plugins"
},
{
"theme": "/opt/omeka/themes"
}
]
}
TASK [download applications files] *********************************************
fatal: [localhost]: FAILED! => {"failed": true, "msg": "'list object' has no attribute 'app'"}
最佳答案
你已经创建了一个列表,而你想要的是一个字典。尝试像这样存储您的 var。
omeka_cache:
app: "{{ omeka_cache_base }}/apps"
plugins: "{{ omeka_cache_base }}/plugins"
theme: "{{ omeka_cache_base }}/themes"
然后 "{{ omeka_cache.app }}"
应该可以工作
关于yaml - 我的 Ansible 语法有什么愚蠢之处?当我调用 list_item 时,我被告知它不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38131553/
有没有办法判断 Android 设备何时处于 sleep 模式?测试我的应用程序时,我按电源按钮关闭屏幕,需要等到 sleep 模式激活。然后,我使用 Google Cloud Messaging (
我想弄清楚如何查询一个表(该表实际上是一个结果集,所以它将是一个子查询),按 ColA=ColB 对其进行分组(见下文),并一步创建一个计算字段。 所以,如果我的测试数据看起来像 可乐 可乐 可乐 1
我是一名优秀的程序员,十分优秀!