Prathisrihas Reddy
Prathisrihas Reddy

Reputation: 434

How to clean apt cache using ansible?

This link hints at existence of a module but I am unable to implement it. Any solution is anticipated.

Upvotes: 3

Views: 8552

Answers (1)

Xiong Chiamiov
Xiong Chiamiov

Reputation: 13684

If you're using Ansible 2.13 or later, you can use the clean parameter:

- ansible.builtin.apt:
    clean: yes
  become: yes

In older versions, you can use the command module:

- command: apt-get clean
  become: yes

Upvotes: 11

Related Questions