Re: [ansible-project] Alternative for "command: apt-get autoremove -y"?

85 views
Skip to first unread message
Message has been deleted

Brian Coca

unread,
Mar 10, 2016, 9:49:46 AM3/10/16
to ansible...@googlegroups.com
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 <ansible...@googlegroups.com> 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 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/089a6f40-5aab-49fe-9dd1-13fbf32802c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
----------
Brian Coca

Benjamin Loehner

unread,
Mar 11, 2016, 5:21:57 AM3/11/16
to Ansible Project
Thanks a lot, apt: autoremove is now available, but how do i use it?

Brian Coca

unread,
Mar 11, 2016, 11:08:22 AM3/11/16
to ansible...@googlegroups.com
Like any option:

- apt: .... autoremove=yes


----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages