1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# pylint: disable=missing-docstring
from openshift_checks import OpenShiftCheck, get_var
from openshift_checks.mixins import NotContainerizedMixin
class PackageAvailability(NotContainerizedMixin, OpenShiftCheck):
"""Check that required RPM packages are available."""
name = "package_availability"
tags = ["preflight"]
def run(self, tmp, task_vars):
rpm_prefix = get_var(task_vars, "openshift", "common", "service_type")
group_names = get_var(task_vars, "group_names", default=[])
packages = set()
if "masters" in group_names:
packages.update(self.master_packages(rpm_prefix))
if "nodes" in group_names:
packages.update(self.node_packages(rpm_prefix))
args = {"packages": sorted(set(packages))}
return self.execute_module("check_yum_update", args, tmp, task_vars)
@staticmethod
def master_packages(rpm_prefix):
return [
"{rpm_prefix}".format(rpm_prefix=rpm_prefix),
"{rpm_prefix}-clients".format(rpm_prefix=rpm_prefix),
"{rpm_prefix}-master".format(rpm_prefix=rpm_prefix),
"bash-completion",
"cockpit-bridge",
"cockpit-docker",
"cockpit-kubernetes",
"cockpit-shell",
"cockpit-ws",
"etcd",
"httpd-tools",
]
@staticmethod
def node_packages(rpm_prefix):
return [
"{rpm_prefix}".format(rpm_prefix=rpm_prefix),
"{rpm_prefix}-node".format(rpm_prefix=rpm_prefix),
"{rpm_prefix}-sdn-ovs".format(rpm_prefix=rpm_prefix),
"bind",
"ceph-common",
"dnsmasq",
"docker",
"firewalld",
"flannel",
"glusterfs-fuse",
"iptables-services",
"iptables",
"iscsi-initiator-utils",
"libselinux-python",
"nfs-utils",
"ntp",
"openssl",
"pyparted",
"python-httplib2",
"PyYAML",
"yum-utils",
]
|