Skip to content

Commit

Permalink
Merge pull request #944 from iranzo/theyareback
Browse files Browse the repository at this point in the history
Theyareback
  • Loading branch information
iranzo committed Aug 22, 2024
2 parents c9d8008 + d8da222 commit 9183cbf
Show file tree
Hide file tree
Showing 711 changed files with 30,383 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=88
known_third_party = imp,setuptools
known_third_party = imp,pytest,setuptools
6 changes: 6 additions & 0 deletions risuclient/extensions/ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,14 @@ def get_metadata(plugin):
except:
description = ""

try:
long_name = doc[0]["vars"]["metadata"]["long_name"]
except:
long_name = ""

metadata = risu.generic_get_metadata(plugin=plugin)
metadata.update({"description": description})
metadata.update({"long_name": long_name})

return metadata

Expand Down
2 changes: 2 additions & 0 deletions risuclient/plugins/ansible/openstack/rabbitmq/ha-policies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
Make sure the RabbitMQ cluster has HA for all queues except the built-in amq.* ones
groups:
- post-deployment
long_name: >
Make sure the RabbitMQ cluster has HA for all queues except the built-in amq.* ones
become: true

tasks:
Expand Down
2 changes: 2 additions & 0 deletions risuclient/plugins/ansible/system/clock-ntpstat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
that it is indeed running and connected to an NPT server on all nodes.
groups:
- post-deployment
long_name: >
Check ntpstat sync status
tasks:
- name: Run ntpstat
# ntpstat returns 0 if synchronised and non-zero otherwise
Expand Down
Empty file.
Empty file.
35 changes: 35 additions & 0 deletions risuclient/plugins/core/bugzilla/docker/1493523.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# Copyright (C) 2021-2023 Pablo Iranzo Gómez <[email protected]>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# this can run against live and also any sort of snapshot of the filesystem

# long_name: docker 'orphan' error messages
# description: Continuous "orphan" and "/proc/.../stat" logs in /var/log/messages
# bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1493523
# priority: 600
# kb: https://access.redhat.com/solutions/3343541

# Load common functions
[[ -f "${RISU_BASE}/common-functions.sh" ]] && . "${RISU_BASE}/common-functions.sh"

is_required_file ${RISU_ROOT}/var/log/messages

if is_lineinfile ".*dockerd-current:.*containerd:.*has become an orphan, killing it.*" ${RISU_ROOT}/var/log/messages; then
echo $"https://bugzilla.redhat.com/show_bug.cgi?id=1493523" >&2
exit ${RC_FAILED}
fi

exit ${RC_OKAY}
Empty file.
33 changes: 33 additions & 0 deletions risuclient/plugins/core/bugzilla/httpd/1406417.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
# Copyright (C) 2021-2023 Pablo Iranzo Gómez <[email protected]>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# this can run against live and also any sort of snapshot of the filesystem

# long_name: MaxRequestWorkers limits
# description: This plugin checks if Apache reaches its MaxRequestWorkers
# bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1406417
# priority: 800
# kb: https://access.redhat.com/solutions/3024461

# Load common functions
[[ -f "${RISU_BASE}/common-functions.sh" ]] && . "${RISU_BASE}/common-functions.sh"

is_required_file "${RISU_ROOT}/var/log/httpd/error_log"
is_required_pkg openstack-gnocchi-common

is_lineinfile "MaxRequestWorkers" "${RISU_ROOT}/var/log/httpd/error_log" && echo $"https://bugzilla.redhat.com/show_bug.cgi?id=1406417" >&2 && exit ${RC_FAILED}

exit ${RC_OKAY}
Empty file.
Empty file.
54 changes: 54 additions & 0 deletions risuclient/plugins/core/bugzilla/openstack/ceilometer/1483456.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash
# Copyright (C) 2021-2023 Pablo Iranzo Gómez <[email protected]>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# this can run against live and also any sort of snapshot of the filesystem

# long_name: Mismatch between nova host and hostname
# description: Checks missconfigured host in nova vs hostname
# bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1483456
# priority: 700
# kb: https://access.redhat.com/solutions/3198662

# Load common functions
[[ -f "${RISU_BASE}/common-functions.sh" ]] && . "${RISU_BASE}/common-functions.sh"

if is_process nova-compute; then
is_required_file "${RISU_ROOT}/etc/nova/nova.conf"

if [[ "x$RISU_LIVE" == "x1" ]]; then
HOST=$(hostname)
elif [[ "x$RISU_LIVE" == "x0" ]]; then
is_required_file "${RISU_ROOT}/hostname"
HOST=$(cat "${RISU_ROOT}/hostname")
fi

NOVAHOST=$(grep ^host.* "${RISU_ROOT}/etc/nova/nova.conf" | cut -d "=" -f2 | tail -1)

if [[ -z $NOVAHOST ]]; then
echo "nova.conf host= undefined" >&2
exit ${RC_SKIPPED}
fi

if [[ $HOST != "$NOVAHOST" ]]; then
echo $"https://bugzilla.redhat.com/show_bug.cgi?id=1483456" >&2
exit ${RC_FAILED}
else
exit ${RC_OKAY}
fi
else
echo "works only on compute node" >&2
exit ${RC_SKIPPED}
fi
Empty file.
62 changes: 62 additions & 0 deletions risuclient/plugins/core/bugzilla/openstack/ceph/1358697.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash
# Copyright (C) 2021-2023 Pablo Iranzo Gómez <[email protected]>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# this can run against live and also any sort of snapshot of the filesystem

# long_name: Old Ceph packages
# description: Checks for outdated ceph packages
# bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1358697
# priority: 400
# kb: https://access.redhat.com/site/solutions/2462281

# Load common functions
[[ -f "${RISU_BASE}/common-functions.sh" ]] && . "${RISU_BASE}/common-functions.sh"

if [[ "x$RISU_LIVE" == "x1" ]]; then
VERSIONS=$(rpm -qa ceph-common* python-rbd* librados2* python-rados* | sed -n -r -e 's/.*-0.([0-9]+).([0-9]+)-([0-9]+).*$/\1-\2-\3/p')
elif [[ "x$RISU_LIVE" == "x0" ]]; then
is_required_file "${RISU_ROOT}/installed-rpms"
VERSIONS=$(grep -E 'ceph-common|python-rbd|librados2|python-rados' "${RISU_ROOT}/installed-rpms" | awk '{print $1}' | sed -n -r -e 's/.*-0.([0-9]+).([0-9]+)-([0-9]+).*$/\1-\2-\3/p')
fi

exitoudated() {
echo $"outdated ceph packages: https://bugzilla.redhat.com/show_bug.cgi?id=1358697" >&2
exit ${RC_FAILED}
}

if [[ "x$VERSIONS" == "x" ]]; then
echo "required packages not found" >&2
exit ${RC_SKIPPED}
else
# Affected versions are lower than ceph-0.94.5-15
for package in ${VERSIONS}; do
MAJOR=$(echo ${package} | cut -d "-" -f1)
MID=$(echo ${package} | cut -d "-" -f2)
MINOR=$(echo ${package} | cut -d "-" -f3)
if [[ ${MAJOR} -ge "94" ]]; then
if [[ ${MID} -ge "5" ]]; then
if [[ ${MINOR} -lt "15" ]]; then
exitoudated
fi
else
exitoudated
fi
else
exitoudated
fi
done
exit ${RC_OKAY}
fi
80 changes: 80 additions & 0 deletions risuclient/plugins/core/bugzilla/openstack/cinder/1261083.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/bin/bash
# Copyright (C) 2021-2023 Pablo Iranzo Gómez <[email protected]>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# this can run against live and also any sort of snapshot of the filesystem

# long_name: Check lvm filter in compute nodes
# description: Verify lvm.conf filter/global_filter
# bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1261083
# priority: 900
# kb: https://access.redhat.com/solutions/3213311

# Load common functions
[[ -f "${RISU_BASE}/common-functions.sh" ]] && . "${RISU_BASE}/common-functions.sh"

is_required_file "${RISU_ROOT}/etc/lvm/lvm.conf"
is_required_pkg lvm2
show_warn() {
echo $"lvm created inside cinder volume, might get exposed to the host system causing migration, guest boot or cinder actions to fail" >&2
echo $"https://bugzilla.redhat.com/show_bug.cgi?id=1261083" >&2
exit ${RC_FAILED}
}
lvmetad=$(cat "${RISU_ROOT}/etc/lvm/lvm.conf" | grep -i use_lvmetad | grep -iv "#" | cut -f2 -d "=" | tr -d '[:space:]')
filter=$(cat "${RISU_ROOT}/etc/lvm/lvm.conf" | grep -i filter | grep -iv global | grep -iv "#" | cut -f2 -d "=" | tr -d '[:space:]')
global_filter=$(cat "${RISU_ROOT}/etc/lvm/lvm.conf" | grep -i global_filter | grep -iv "#" | cut -f2 -d "=" | tr -d '[:space:]')
filter_eval=$(echo $filter | grep -E -i '\["r[/,|].\*[/,|][|]*"\]')
global_filter_eval=$(echo $global_filter | grep -E -i '\["r[/,|].\*[/,|][|]*"\]')

if [[ "x${lvmetad}" == "x0" ]]; then
filter_in_use="filter"
set_filter=$filter
else
filter_in_use="global_filter"
set_filter=$global_filter
fi

if ! is_process nova-compute; then
echo "This check is specific to openstack compute node" >&2
exit ${RC_SKIPPED}
fi
if [[ ${filter_in_use} == "global_filter" ]]; then
if [[ -z $global_filter ]]; then
flag=2
elif [[ -z $global_filter_eval ]]; then
flag=1
else
flag=0
fi
elif [[ ${filter_in_use} == "filter" ]]; then
if [[ -z $filter ]]; then
flag=2
elif [[ -z $filter_eval ]]; then
flag=1
else
flag=0
fi
fi

if [[ $flag == "2" ]]; then
echo $"lvm $filter_in_use is not set in compute node" >&2
show_warn
elif [[ $flag == "1" ]]; then
echo $"lvm $filter_in_use is set, however it might not restrict all devices" >&2
echo "$filter_in_use is set to: $set_filter" >&2
show_warn
else
exit ${RC_OKAY}
fi
Empty file.
40 changes: 40 additions & 0 deletions risuclient/plugins/core/bugzilla/openstack/httpd/1478042.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
# Copyright (C) 2021-2023 Pablo Iranzo Gómez <[email protected]>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# this can run against live and also any sort of snapshot of the filesystem

# long_name: WSGIApplicationGroup definition in mod_wsgi
# description: Checks httpd WSGIApplication defined to avoid wrong redirection
# bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1478042
# priority: 600

# Load common functions
[[ -f "${RISU_BASE}/common-functions.sh" ]] && . "${RISU_BASE}/common-functions.sh"

is_required_file ${RISU_ROOT}/etc/httpd/conf.d/*-horizon_vhost.conf
if ! is_lineinfile "WSGIApplicationGroup %{GLOBAL}" ${RISU_ROOT}/etc/httpd/conf.d/*-horizon_vhost.conf; then
echo $"https://bugzilla.redhat.com/show_bug.cgi?id=1478042" >&2
exit ${RC_FAILED}
fi

if [[ -f "${RISU_ROOT}/var/log/httpd/horizon_error.log" ]]; then
if is_lineinfile "End of script output before headers: django.wsgi" "${RISU_ROOT}/var/log/httpd/horizon_error.log"; then
echo $"possible error on WSGIApplicationGroup in horizon, check: https://bugzilla.redhat.com/show_bug.cgi?id=1478042" >&2
exit ${RC_FAILED}
fi
fi

exit ${RC_OKAY}
Empty file.
36 changes: 36 additions & 0 deletions risuclient/plugins/core/bugzilla/openstack/keystone/1473713.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
# Copyright (C) 2021-2023 Pablo Iranzo Gómez <[email protected]>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# this can run against live and also any sort of snapshot of the filesystem

# Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1473713

# long_name: Removal of expired tokens
# description: Checks for keystone transaction errors on cleanup
# bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1473713
# priority: 600
# bz: https://access.redhat.com/solutions/2263851

# Load common functions
[[ -f "${RISU_BASE}/common-functions.sh" ]] && . "${RISU_BASE}/common-functions.sh"

is_required_file "${RISU_ROOT}/var/log/keystone/keystone.log"

if is_lineinfile "ERROR keystone DBDeadlock: .*pymysql.err.Internal.* try restarting transaction.*DELETE FROM token WHERE token.expires.*" "${RISU_ROOT}/var/log/keystone/keystone.log"; then
echo $"errors on token expiration, check: https://bugzilla.redhat.com/show_bug.cgi?id=1473713" >&2
exit ${RC_FAILED}
fi
exit ${RC_OKAY}
Empty file.
Loading

0 comments on commit 9183cbf

Please sign in to comment.