Loading deploy/ansible/roles/data/tasks/fileserver_install.yml +15 −4 Original line number Diff line number Diff line Loading @@ -32,10 +32,21 @@ src: /dev/stderr force: yes - name: Make the access log pipe command: mkfifo /esg/logs/fileserver/access.log args: creates: /esg/logs/fileserver/access.log - name: Get stats of a file stat: path: /esg/logs/fileserver/access.log register: log_file - name: Delete log pipe from previous playbook versions file: path: /esg/logs/fileserver/access.log state: absent when: log_file.stat.isfifo - name: Ensure access log file exists file: path: /esg/logs/fileserver/access.log state: touch - name: Transfer ownership of logs to security context user file: Loading deploy/ansible/roles/data/tasks/logstash_install.yml +8 −0 Original line number Diff line number Diff line --- - name: Ensure logrotate is installed command: dnf install -y logrotate - name: Install the logrotate configuration file template: src: esg.logrotate.j2 dest: /etc/logrotate.d/esg - name: Create Docker network docker_network: name: esgf Loading deploy/ansible/roles/data/tasks/thredds_install.yml +15 −4 Original line number Diff line number Diff line Loading @@ -52,10 +52,21 @@ - cache.log - localhost.log - name: Make the access log pipe command: mkfifo /esg/logs/thredds/localhost_access_log.txt args: creates: /esg/logs/thredds/localhost_access_log.txt - name: Get stats of a file stat: path: /esg/logs/thredds/localhost_access_log.txt register: log_file - name: Delete log pipe from previous playbook versions file: path: /esg/logs/thredds/localhost_access_log.txt state: absent when: log_file.stat.isfifo - name: Ensure access log file exists file: path: /esg/logs/thredds/localhost_access_log.txt state: touch - name: Transfer ownership of logs to security context user file: Loading deploy/ansible/roles/data/templates/esg.logrotate.j2 0 → 100644 +23 −0 Original line number Diff line number Diff line {% set containers = [] %} {% if 'data' in group_names and fileserver_enabled %} {{ containers.append(['fileserver', 'access.log']) }} {% endif %} {% if 'data' in group_names and thredds_enabled %} {{ containers.append(['thredds', 'localhost_access_log.txt']) }} {% endif %} {% for container in containers %} /esg/logs/{{ container.0 }}/{{ container.1 }} { create 0640 root root daily rotate 10 missingok notifempty compress delaycompress sharedscripts postrotate /usr/bin/docker restart {{ container.0 }} > /dev/null 2>/dev/null || true endscript } {% endfor %} Loading
deploy/ansible/roles/data/tasks/fileserver_install.yml +15 −4 Original line number Diff line number Diff line Loading @@ -32,10 +32,21 @@ src: /dev/stderr force: yes - name: Make the access log pipe command: mkfifo /esg/logs/fileserver/access.log args: creates: /esg/logs/fileserver/access.log - name: Get stats of a file stat: path: /esg/logs/fileserver/access.log register: log_file - name: Delete log pipe from previous playbook versions file: path: /esg/logs/fileserver/access.log state: absent when: log_file.stat.isfifo - name: Ensure access log file exists file: path: /esg/logs/fileserver/access.log state: touch - name: Transfer ownership of logs to security context user file: Loading
deploy/ansible/roles/data/tasks/logstash_install.yml +8 −0 Original line number Diff line number Diff line --- - name: Ensure logrotate is installed command: dnf install -y logrotate - name: Install the logrotate configuration file template: src: esg.logrotate.j2 dest: /etc/logrotate.d/esg - name: Create Docker network docker_network: name: esgf Loading
deploy/ansible/roles/data/tasks/thredds_install.yml +15 −4 Original line number Diff line number Diff line Loading @@ -52,10 +52,21 @@ - cache.log - localhost.log - name: Make the access log pipe command: mkfifo /esg/logs/thredds/localhost_access_log.txt args: creates: /esg/logs/thredds/localhost_access_log.txt - name: Get stats of a file stat: path: /esg/logs/thredds/localhost_access_log.txt register: log_file - name: Delete log pipe from previous playbook versions file: path: /esg/logs/thredds/localhost_access_log.txt state: absent when: log_file.stat.isfifo - name: Ensure access log file exists file: path: /esg/logs/thredds/localhost_access_log.txt state: touch - name: Transfer ownership of logs to security context user file: Loading
deploy/ansible/roles/data/templates/esg.logrotate.j2 0 → 100644 +23 −0 Original line number Diff line number Diff line {% set containers = [] %} {% if 'data' in group_names and fileserver_enabled %} {{ containers.append(['fileserver', 'access.log']) }} {% endif %} {% if 'data' in group_names and thredds_enabled %} {{ containers.append(['thredds', 'localhost_access_log.txt']) }} {% endif %} {% for container in containers %} /esg/logs/{{ container.0 }}/{{ container.1 }} { create 0640 root root daily rotate 10 missingok notifempty compress delaycompress sharedscripts postrotate /usr/bin/docker restart {{ container.0 }} > /dev/null 2>/dev/null || true endscript } {% endfor %}