是否可以运行ansible playbook,看起来像这样(这是来自这个网站的一个例子:http://docs.ansible.com/playbooks_roles.html):
- name: this is a play at the top level of a file
hosts: all
remote_user: root
tasks:
- name: say hi
tags: foo
shell: echo "hi..."
- include: load_balancers.yml
- include: webservers.yml
- include: dbservers.yml
Run Code Online (Sandbox Code Playgroud)
在多线程模式?
我想在同一时间运行三个"包含"(它正在部署到不同的主机),如下图所示:
http://www.gliffy.com/go/publish/5267618
可能吗?
我有具有属性id的对象列表,我想找到具有特定id的对象的索引.我写了这样的东西:
index = -1
for i in range(len(my_list)):
if my_list[i].id == 'specific_id'
index = i
break
Run Code Online (Sandbox Code Playgroud)
但它看起来不太好.还有更好的选择吗?
我尝试使用lxml在Python中解析XML文件,如下所示:
objectify.parse(xmlPath, parserWithSchema)
Run Code Online (Sandbox Code Playgroud)
但XML文件可能包含奇怪的地方的评论:
<root>
<text>Sam<!--comment-->ple text</text>
<!--comment-->
<float>1.2<!--comment-->3456</float>
</root>
Run Code Online (Sandbox Code Playgroud)
这是一种在解析之前不加载或删除注释的方法吗?