Package: ansible
Version: 2.1.0.0-1
Severity: normal

I have the following rule in a role used by my playbook:

    - name: free up disk space by removing apt package cache
      shell: |
        apt-get clean

This results in the following warning:

    [WARNING]: Consider using apt module rather than running apt-get

Unfortunately, the apt module doesn't support a clean operation. The
checker emitting the warning is too eager. The workaround is to change
'apt-get' into 'apt-"get"', which is semantically equivalent to sh,
but hides the use of apt-get from the checker.

Note that this is different from #814371, which was about the fact
that the warning used to suggest the apt-get module.

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages ansible depends on:
ii  python-crypto         2.6.1-6+b1
ii  python-httplib2       0.9.1+dfsg-1
ii  python-jinja2         2.8-1
ii  python-netaddr        0.7.18-1
ii  python-paramiko       2.0.0-1
ii  python-pkg-resources  20.10.1-1.1
ii  python-yaml           3.11-3+b1
pn  python:any            <none>

Versions of packages ansible recommends:
ii  python-selinux  2.5-3

Versions of packages ansible suggests:
pn  sshpass  <none>

-- no debconf information

Reply via email to