| Monty Taylor | 36ddea3 | 2017-10-02 10:05:17 -0500 | [diff] [blame] | 1 | - name: Check for /bin/journalctl file |
| 2 | command: which journalctl |
| 3 | changed_when: False |
| 4 | failed_when: False |
| 5 | register: which_out |
| 6 | |
| 7 | - block: |
| 8 | - name: Get current date |
| 9 | command: date +"%Y-%m-%d %H:%M:%S" |
| 10 | register: date_out |
| 11 | |
| 12 | - name: Copy current date to log-start-timestamp.txt |
| 13 | copy: |
| 14 | dest: "{{ devstack_base_dir }}/log-start-timestamp.txt" |
| 15 | content: "{{ date_out.stdout }}" |
| 16 | when: which_out.rc == 0 |
| 17 | become: yes |
| 18 | |
| 19 | - block: |
| 20 | - name: Stop rsyslog |
| 21 | service: name=rsyslog state=stopped |
| 22 | |
| 23 | - name: Save syslog file prior to devstack run |
| 24 | command: mv /var/log/syslog /var/log/syslog-pre-devstack |
| 25 | |
| 26 | - name: Save kern.log file prior to devstack run |
| 27 | command: mv /var/log/kern.log /var/log/kern_log-pre-devstack |
| 28 | |
| 29 | - name: Recreate syslog file |
| 30 | file: name=/var/log/syslog state=touch |
| 31 | |
| 32 | - name: Recreate syslog file owner and group |
| 33 | command: chown /var/log/syslog --ref /var/log/syslog-pre-devstack |
| 34 | |
| 35 | - name: Recreate syslog file permissions |
| 36 | command: chmod /var/log/syslog --ref /var/log/syslog-pre-devstack |
| 37 | |
| 38 | - name: Add read permissions to all on syslog file |
| 39 | file: name=/var/log/syslog mode=a+r |
| 40 | |
| 41 | - name: Recreate kern.log file |
| 42 | file: name=/var/log/kern.log state=touch |
| 43 | |
| 44 | - name: Recreate kern.log file owner and group |
| 45 | command: chown /var/log/kern.log --ref /var/log/kern_log-pre-devstack |
| 46 | |
| 47 | - name: Recreate kern.log file permissions |
| 48 | command: chmod /var/log/kern.log --ref /var/log/kern_log-pre-devstack |
| 49 | |
| 50 | - name: Add read permissions to all on kern.log file |
| 51 | file: name=/var/log/kern.log mode=a+r |
| 52 | |
| 53 | - name: Start rsyslog |
| 54 | service: name=rsyslog state=started |
| 55 | when: which_out.rc == 1 |
| 56 | become: yes |