Untested, but maybe this:

==
- shell: {{ base_dir }} {{ item }}
  with_items: deploy_env.keys() | sort
==

And then be sure to name your keys so they sort the way you need.

On 10/03/2014 12:39 PM, Guy Matz wrote:
not sure what you mean . . . my data comes from json that looks like this:
deploy_env =
{
    "cmd_build": [
        "gem install rake bundler",
"bundle install --deployment --without development test --path $BUNDLE_DIR"
    ],
    "cmd_release": [
        "bundle exec rake deploy:release",
        "bundle exec rake db:migrate"
    ]
}

and I loop through the cmd_* hashes with my custom iterator like:
- shell: {{ base_dir }}{{ item.key }}
  with_12fcmds: deploy_env

I need the cmd_build to come before cmd_release as defined in the json, bu it seems that somewhere along the line the json is getting turned into a dict and losing its order . . .

On Fri, Oct 3, 2014 at 11:57 AM, Brian Coca <brianc...@gmail.com <mailto:brianc...@gmail.com>> wrote:

    have you tried |sort?

    --
    Brian Coca
    Stultorum infinitus est numerus
    
0110000101110010011001010110111000100111011101000010000001111001011011110111010100100000011100110110110101100001011100100111010000100001
    Pedo mellon a minno

    --
    You received this message because you are subscribed to the Google
    Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to ansible-project+unsubscr...@googlegroups.com
    <mailto:ansible-project%2bunsubscr...@googlegroups.com>.
    To post to this group, send email to
    ansible-project@googlegroups.com
    <mailto:ansible-project@googlegroups.com>.
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/ansible-project/CADn%2BHswakpYOn%2BepvVKsTLYPCxzTpJzCH5bG_7phOYttNQrwyQ%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com <mailto:ansible-project+unsubscr...@googlegroups.com>. To post to this group, send email to ansible-project@googlegroups.com <mailto:ansible-project@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CABnTgtU-zS6Hr9_WE6w09k%3DtpgwPme1k6MwgaAWe4t2J7CugEQ%40mail.gmail.com <https://groups.google.com/d/msgid/ansible-project/CABnTgtU-zS6Hr9_WE6w09k%3DtpgwPme1k6MwgaAWe4t2J7CugEQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/542EE087.70904%40brainfood.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to