rhevm-qe-automation / ovirt-ansible

Ansible playbooks for ovirt management
GNU General Public License v3.0
26 stars 28 forks source link

role ovirt-collect-logs fails on CentOS 7 #102

Closed lukas-bednar closed 7 years ago

lukas-bednar commented 7 years ago

In order to reproduce just enable test in tests/test.yml for ovirt-collect-logs role.

TASK [ovirt-collect-logs : Dump system information using shell commands] *******

changed: [engine_centos7] => (item={'key': u'iptables', 'value': u'iptables -L'})

changed: [engine_centos7] => (item={'key': u'sysctl', 'value': u'sysctl -a'})

failed: [engine_centos7] (item={'key': u'netstat', 'value': u'netstat -lnp'}) => {"changed": true, "cmd": "netstat -lnp &> /var/tmp/ovirt-logs/netstat.txt", "delta": "0:00:00.037480", "end": "2017-03-03 15:12:59.485342", "failed": true, "item": {"key": "netstat", "value": "netstat -lnp"}, "rc": 127, "start": "2017-03-03 15:12:59.447862", "stderr": "", "stdout": "", "stdout_lines": [], "warnings": []}

changed: [engine_centos7] => (item={'key': u'rpm-list', 'value': u'rpm -qa | sort -f'})

changed: [engine_centos7] => (item={'key': u'yum-list', 'value': u'yum list installed'})

changed: [engine_centos7] => (item={'key': u'services', 'value': u"systemctl -t service --failed --no-legend | awk '{print $1}' | xargs -r -n1 journalctl -u"})

changed: [engine_centos7] => (item={'key': u'lsmod', 'value': u'lsmod'})

changed: [engine_centos7] => (item={'key': u'memory_usage', 'value': u'ps -e -orss=,args= | sort  -b -k1,1n | tac'})

failed: [engine_centos7] (item={'key': u'lspci', 'value': u'lspci'}) => {"changed": true, "cmd": "lspci &> /var/tmp/ovirt-logs/lspci.txt", "delta": "0:00:00.037323", "end": "2017-03-03 15:13:02.818711", "failed": true, "item": {"key": "lspci", "value": "lspci"}, "rc": 127, "start": "2017-03-03 15:13:02.781388", "stderr": "", "stdout": "", "stdout_lines": [], "warnings": []}

failed: [engine_centos7] (item={'key': u'lsof', 'value': u'lsof -P'}) => {"changed": true, "cmd": "lsof -P &> /var/tmp/ovirt-logs/lsof.txt", "delta": "0:00:00.037518", "end": "2017-03-03 15:13:03.225583", "failed": true, "item": {"key": "lsof", "value": "lsof -P"}, "rc": 127, "start": "2017-03-03 15:13:03.188065", "stderr": "", "stdout": "", "stdout_lines": [], "warnings": []}

...ignoring

failed: [engine_centos7] (item={'key': u'pstree', 'value': u'pstree -p'}) => {"changed": true, "cmd": "pstree -p &> /var/tmp/ovirt-logs/pstree.txt", "delta": "0:00:00.037774", "end": "2017-03-03 15:13:03.655815", "failed": true, "item": {"key": "pstree", "value": "pstree -p"}, "rc": 127, "start": "2017-03-03 15:13:03.618041", "stderr": "", "stdout": "", "stdout_lines": [], "warnings": []}

TASK [ovirt-collect-logs : Link common logs] ***********************************

failed: [engine_centos7] (item={u'dest': u'messages', u'src': u'/var/log/messages'}) => {"failed": true, "item": {"dest": "messages", "src": "/var/log/messages"}, "msg": "src file does not exist, use \"force=yes\" if you really want to create the link: /var/log/messages", "path": "/var/tmp/ovirt-logs/messages", "src": "/var/log/messages", "state": "absent"}
KKoukiou commented 7 years ago

rsyslog (or any other syslog daemon) is not installed by default any more in Centos (because it was deemed unnecessary to have the persistent logs twice on the disk, in systemd's journal and /var/log/messages). Thus /var/log/messages is missing. We should make it ignore errors when this directory is missing and clean logs with journalctl