From 574d2994d1524a5420eebbaece1bf028d30a2b29 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Thu, 9 Jan 2025 16:16:59 -0500 Subject: [PATCH] use cmd.run instead of cmd.script to resolve issue 64962 --- salt/libvirt/64962/init.sls | 13 ++++++++++--- .../{fix-salt-ldap.py => so-fix-salt-ldap.py} | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) rename salt/libvirt/64962/scripts/{fix-salt-ldap.py => so-fix-salt-ldap.py} (96%) diff --git a/salt/libvirt/64962/init.sls b/salt/libvirt/64962/init.sls index a6b13c3e5..e20f24f2d 100644 --- a/salt/libvirt/64962/init.sls +++ b/salt/libvirt/64962/init.sls @@ -2,10 +2,17 @@ python3_lief: pkg.installed: - name: securityonion-python3-lief +so-fix-salt-ldap_script: + file.managed: + - name: /usr/sbin/so-fix-salt-ldap.py + - source: salt://libvirt/64962/scripts/so-fix-salt-ldap.py + - mode: 744 + fix-salt-ldap: - cmd.script: - - source: salt://libvirt/64962/scripts/fix-salt-ldap.py + cmd.run: + - name: /usr/sbin/so-fix-salt-ldap.py - require: - pkg: python3_lief + - file: so-fix-salt-ldap_script - onchanges: - - pkg: python3_lief + - file: so-fix-salt-ldap_script diff --git a/salt/libvirt/64962/scripts/fix-salt-ldap.py b/salt/libvirt/64962/scripts/so-fix-salt-ldap.py similarity index 96% rename from salt/libvirt/64962/scripts/fix-salt-ldap.py rename to salt/libvirt/64962/scripts/so-fix-salt-ldap.py index 56fcce8aa..919b50261 100644 --- a/salt/libvirt/64962/scripts/fix-salt-ldap.py +++ b/salt/libvirt/64962/scripts/so-fix-salt-ldap.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +# this script comes from the user nf-brentsaner located here https://github.com/saltstack/salt/issues/64962 + import datetime import grp import os @@ -11,8 +13,6 @@ import dbus # dnf -y install python3-dbus ## import lief # https://pypi.org/project/lief/ -# https://github.com/saltstack/salt/issues/64962 - salt_root = pathlib.Path('/opt/saltstack') src_lib = pathlib.Path('/lib64/libldap.so.2') dst_lib = salt_root.joinpath('salt', 'lib', 'libldap.so.2')