Hi James,

The first doesn't fail with the "multiple actions specified" message
because you're defining a dictionary (aka a hash, or associative array) and
your second declaration overwrites the first.

Split this into two separate tasks.

- name: Install JCE
  when: jce_install == true
  copy: src=US_export_policy.jar dest={{item}}
  with_items:
    - "{{jre_path}}"
    - "{{jdk_path}}"

- name: Install jar
  copy: src=local_policy.jar dest={{item}}
  with_items:
    - "{{jre_path}}"
    - "{{jdk_path}}"


On Mon, Apr 7, 2014 at 11:22 AM, James Carroll
<[email protected]>wrote:

> I have two tasks, one works (sorta) and the other doesn't (at all).
>
> The first:
>
> - name: Install JCE
>   when: jce_install == true
>   copy: src=US_export_policy.jar dest={{item}}
>   with_items:
>     - "{{jre_path}}"
>     - "{{jdk_path}}"
>   copy: src=local_policy.jar dest={{item}}
>   with_items:
>     - "{{jre_path}}"
>     - "{{jdk_path}}"
>
> This task runs, but only the second copy action happens not the first.
> Why?
>
> The second task:
>
> - name: Install Ping
>   user: name={{ping_user}}
>   file: path={{ping_home}} state=directory
>   unarchive: src=Ping.zip dest={{ping_home}}
>
> This task flat out kills the playbook/role with "*ERROR: multiple actions
> specified in task Install Ping*".  The first one doesn't though. Is it
> because they are the same task type (copy)? Is the second one 'shadowing'
> the first?
>
> Everything works fine if I split every thing out and having lots of
> messages about where script is at any moment in time is good (I suppose).
> But I would appreciate a little more insight into the above and how to
> group related actions into logical tasks.
>
> Thanks,
>
>
>
>
>
> __________________________________________________________________
> The information contained in this email message and any attachment may be 
> privileged, confidential, proprietary or otherwise protected from disclosure. 
> If the reader of this message is not the intended recipient, you are hereby 
> notified that any dissemination, distribution, copying or use of this message 
> and any attachment is strictly prohibited. If you have received this message 
> in error, please notify us immediately by replying to the message and 
> permanently delete it from your computer and destroy any printout thereof.
>
>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/6f8ce869-4da8-47d8-ab89-c9fb5d5b1ead%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/6f8ce869-4da8-47d8-ab89-c9fb5d5b1ead%40googlegroups.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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAK6JQEHBDorbwh1woYpHbcGfwzqYAKa%3D6LTF8goSk1PLc7qjXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to