Brian, thank you for that workaround.

Your solution however forces `pkg` as a separate argument on a new line.
How would I supply `install_recommends` to that (specific) task? This for 
example doesn't work:

...

- apt:
  <<: *apt_defaults
  pkg: "{{item}}"
  install_recommends: yes

It would be nice if it was possible to simply set defaults for tasks.
Something like:

defaults:
  apt:
    cache_valid_time: 3600

And then allowing these defaults to be overridden by the actual task.
Even better if you could specify these defaults in the group_vars.


On Saturday, February 20, 2016 at 11:42:02 AM UTC-5, Brian Coca wrote:
>
> in both versions you can still solve this by using YAML references
>
> vars:
>   apt_defaults: &apt_defaults
> ...
>
> - apt:
>   <<: *apt_defaults
>   pkg: "{{item}}"
> ...
>
>
> ----------
> Brian Coca
>

-- 
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/b10958df-7c42-481b-adae-3608e8626b00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to