티스토리 뷰

개요

shell 이나 command 모듈을 사용하게 되면 아래와 같은 메시지가 나올 때가 있다.

뭐 요약하자면 file module 있으니 그거 사용하라는 말.

 [WARNING]: Consider using the file module with state=absent rather than running rm.  If you need to use command

because file is insufficient you can add warn=False to this command task or set command_warnings=False in

ansible.cfg to get rid of this message.



그럼 어떻게 설정하나?

두가지 방식

1. ansible.cfg 에서 전역 설정

2. task에서 설정


ansible.cfg

[defaults]

command_warnings = False



task

- name: test

  shell: rm -f /home/paint/test.txt

  args:

    warn: false







댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함