擅长:python、mysql、java
<p>这应该做到:</p>
<pre class="lang-yaml prettyprint-override"><code>- name: Seperate Dictionary Creation
set_fact:
master_nodes: "{{ (master_nodes | default({})) | combine({item.key: item.value}) }}"
when: item.key is search(".*master.*")
with_dict: "{{ all_host_dict }}"
</code></pre>
<p>此外,正则表达式应该从<code>*.master.*</code>修改为<code>.*master.*</code></p>