Create a Ansible dictionary which keeps order
<p>How could I create dictionary with order?</p>

<p>I have dictionary as </p>

<pre><code>vars:
  myDict:
    Bob: 30
    Alice: 20
</code></pre>

<p>How could I keep <code>"Bob"</code> in front of <code>"Alice"</code>? Ansible orders this map for me based on key letters</p>

<p>There is no way to do this. Please, search for "python dict order".</p>

<p>You can only replace your original dict with a list:</p>

<pre><code>myListofDict:
  - key: Bob
    value: 30
  - key: Alice
    value: 20
</code></pre>

python ansible