yohoweb-containers.yml 1.17 KB
# logrotate config for containers

# How to run:
# ansible-playbook -i inventories/containers/hosts  playbooks/yohoweb-containers.yml

- hosts: web-containers
  vars:
    logrotate_scripts:
      - name: yohoweb-containers
        paths: 
          - "/Data/logs/nginx/yohobuywap-node/*.log"
          - "/Data/logs/nginx/yohobuy-node/*.log"
          - "/Data/logs/nginx/yoho-activity-platform-admin/*.log"
          - "/Data/logs/nginx/yoho-activity-platform/*.log"
          - "/Data/logs/yoho-seo/*.log"
          - "/Data/logs/yoho-doom-spider/*.log"
          - "/Data/logs/java-yohobuy-global/nginx/*.log"
        options:
          - daily
          - size 50M
          - rotate 7
          - missingok
          - notifempty
          - compress
          - copytruncate
  remote_user: root
  roles: 
    - logrotate

- hosts: yoho-java-container
  vars:
    logrotate_scripts:
      - name: yoho-java-container
        paths:
          - "/Data/logs/yoho-canal/canal/*.log"
        options:
          - daily
          - size 50M
          - rotate 7
          - missingok
          - notifempty
          - compress
          - copytruncate
  remote_user: root
  roles:
    - logrotate