Hi,

i already changed all my playbooks from "command: apt-get install..." to 
"apt: package=XYZ state=installed...". Can i do the same with autoremove so 
it stops bugging me with "[WARNING]: Consider using apt-get module rather 
than running apt-get"?

Example:

- 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/081b79b8-7e51-46ed-a3ec-0010ab0b6004%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to