The apt module has been updated to allow this, it will be available in a 2.1 release
On Thu, Mar 10, 2016 at 6:33 AM, 'Benjamin Loehner' via Ansible Project < [email protected]> wrote: > Hi, > > when you use "command: apt-get autoremove -y" ansible bugs you with > "[WARNING]: Consider using apt-get module rather than running apt-get". > > Is it possible to use something like "apt: package=XYZ state=installed"? > > This is the code i want to replace: > > - name: Remove unneeded packages. > become: yes > command: apt-get autoremove -y > register: autoremove_result > changed_when: "'0 upgraded' not in autoremove_result.stdout" > tags: > - apt > - autoremove > > -- > 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/089a6f40-5aab-49fe-9dd1-13fbf32802c9%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/089a6f40-5aab-49fe-9dd1-13fbf32802c9%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- ---------- 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/CACVha7dCWNi8LYUK%3DnnS2uzLLxDqEn1DE9i1%2BKwr-EgNHb1HDQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
