Page MenuHomeDevCentral

D2609.id6584.diff
No OneTemporary

D2609.id6584.diff

diff --git a/roles/paas-docker/monitoring/init.sls b/roles/paas-docker/monitoring/init.sls
--- a/roles/paas-docker/monitoring/init.sls
+++ b/roles/paas-docker/monitoring/init.sls
@@ -7,6 +7,44 @@
{% from "map.jinja" import dirs with context %}
+# -------------------------------------------------------------
+# Install a modern Python interpreter on CentOS/Rocky 7/8
+#
+# Our checks uses subprocess features to capture output,
+# and as such won't work correctly on Python 3.6.
+#
+# Provide python3.9 as python3 is safe as:
+# - Salt RPM package hardcode a version, e.g. #!/usr/bin/python3.6
+# - systems scripts like dnf use #!/usr/libexec/platform-python
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if grains["pythonversion"] < [3, 9] %}
+
+{% if grains["os_family"] == "RedHat" %}
+epel_repositories:
+ pkg.installed:
+ - pkgs:
+ - epel-release
+ - epel-next-release
+
+python_packages:
+ pkg.installed:
+ - pkgs:
+ - python39
+ - python39-pyyaml
+ - python39-requests
+ - require:
+ - pkg: epel_repositories
+
+/etc/alternatives/python3:
+ file.symlink:
+ - target: /usr/bin/python3.9
+ - require:
+ - pkg: python_packages
+{% endif %}
+
+{% endif %}
+
# -------------------------------------------------------------
# Platform checks
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 10:38 (19 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2272725
Default Alt Text
D2609.id6584.diff (1 KB)

Event Timeline