ansible [AVISO]: Ignorando atributo inválido: update_cache

ansible [AVISO]: Ignorando atributo inválido: update_cache

Não sei por que estou recebendo esse aviso. Já verifiquei o módulo apt e diz:

update_cache 
bool
Choices:
no ←
yes
Run the equivalent of apt-get update before the operation. Can be run as part of the package installation or as a separate step.

Estas são as duas instâncias em que update_cache está presente:

- name: Install Apache
      apt:
        name: apache2
        state: present
        update_cache: yes

- name: install php7.2-fpm and all necessary modules
      apt: name={{ item }} state=present
      with_items:
         - php7.2-fpm
         - php7.2-gd
         - php7.2-curl
         - php7.2-mysql
         #- php7.2-mcrypt
         - php7.2-mbstring
         - php7.2-xml
      update_cache: yes
      when: ppastable is success

Alguma idéia de por que estou recebendo esse aviso?

Responder1

update_cachepretende ser um argumento para o aptcomando, mas você o colocou como um argumento para a tarefa.

Remova-o de sua posição atual e adicione-o ao aptcomando, ou seja:

apt: name={{item}} state=present update_cache=yes

PS Se update_cacheexplodir, a solução alternativa é instalar o aptitude. Por exemplo:

- name: Install aptitude on Debian systems (https://github.com/ansible/ansible/issues/18987)
  apt: pkg=aptitude state=latest
  when: ansible_os_family == 'Debian'

- name: Update apt cache (https://github.com/ansible/ansible/issues/18987)
  apt: update_cache=yes
  when: ansible_os_family == 'Debian'

informação relacionada