ansible [경고]: 잘못된 속성 무시: update_cache

ansible [경고]: 잘못된 속성 무시: update_cache

왜 이런 경고가 표시되는지 잘 모르겠습니다. 이미 apt 모듈을 확인했는데 다음과 같이 표시됩니다.

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.

update_cache가 존재하는 두 가지 인스턴스는 다음과 같습니다.

- 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

왜 이 경고가 나타나는지 아시나요?

답변1

update_cache명령 에 대한 인수로 사용되었지만 apt대신 작업에 대한 인수로 배치했습니다.

현재 위치에서 제거하고 apt명령에 추가합니다. 즉:

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

PS update_cache문제가 발생하는 경우 해결 방법은 적성을 설치하는 것입니다. 예를 들어:

- 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'

관련 정보