Using facts as variables in a task main file

27 views
Skip to first unread message

Mzp45

unread,
Jul 11, 2014, 4:37:48 PM7/11/14
to ansible...@googlegroups.com
Hi,
I'm trying to install a package but the package manager varies across the distro. I'd like to implement something like this for e.g

- name: install the latest version of vmware-tools
  {{ ansible_pkg_mgr }}: name=vmware-tools-esx-nox state=latest
  tags: 
        - vmware-tools

Is this possible within the main tasks file?

Thanks

Michael DeHaan

unread,
Jul 11, 2014, 5:37:12 PM7/11/14
to ansible...@googlegroups.com
This is a bad idea because it won't group multiple package installs into one transaction, so you'll spend more time in updates, and also you don't have the various apt controls that you need.

However, if you want to:

action: "{{ ansible_pkg_mgr }} name=blah state=latest"




--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c4c68d87-3de1-4823-adfd-183b4c0e3d8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mzp45

unread,
Jul 11, 2014, 6:06:51 PM7/11/14
to ansible...@googlegroups.com
Thanks - that works for me. 
Reply all
Reply to author
Forward
0 new messages