R&D/클라우드

Ansible 에서 디렉토리 안에 모든 파일 지우기

sunshout 2018. 10. 14. 00:53

/var/log/MY_FOLDER 안에 파일을 모두 지우는 방법


- name: Cleanup directory

  hosts: abc

  become: yes

  tasks:

    - file:

        state: "{{ item }}"

        path: "/var/log/MY_FOLDER"

        owner: apache

        group: apache

        mode: '0775'

      with_items:

        - absent

        - directory