Cherry-picking salt 3006.7 changes from 5.0 to dev

- cherry-picked commit - 3ef0bfa9ae

Change-Id: If3c2796d6fb0da0e91234c521d12e21ceab226ec
Signed-off-by: praffulmehrotra <prafful.mehrotra@broadcom.com>
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/c/photon/+/23798
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Shreenidhi Shedi <shreenidhi.shedi@broadcom.com>
This commit is contained in:
praffulmehrotra 2024-04-24 13:45:01 -07:00 committed by Shreenidhi Shedi
parent 6401806181
commit 955e8e1911
11 changed files with 455 additions and 0 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ common/data/pkg_info.json
SPECS/falco/*.spec
SPECS/sysdig/*.spec
SPECS/kernels-drivers-intel/*.spec
.idea/

View File

@ -0,0 +1,41 @@
Name: python3-backports_abc
Version: 0.5
Release: 1%{?dist}
Summary: A backport of recent additions to the 'collections.abc' module.
License: PSFL
Group: Development/Languages/Python
Url: https://github.com/cython/backports_abc
Vendor: VMware, Inc.
Distribution: Photon
Source0: https://pypi.python.org/packages/68/3c/1317a9113c377d1e33711ca8de1e80afbaf4a3c950dd0edfaf61f9bfe6d8/backports_abc-%{version}.tar.gz
%define sha512 backports_abc=7c8a30857a1199e2539279d8fe82456db53fc2c8f0be2c696e029406756f6b7ad3628f4fc5203b58e6a89cb3a0bffdf85feb5af9e7d0bcd4ce0641ac469c9a1a
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Requires: python3
BuildArch: noarch
%description
%prep
%autosetup -n backports_abc-%{version}
%build
%{py3_build}
%install
%{py3_install}
%check
python3 tests.py
%files
%defattr(-,root,root,-)
%{python3_sitelib}/*
%changelog
* Wed Apr 17 2024 Prafful Mehrotra <prafful.mehrotra@broadcom.com> 0.5-1
- Bringing python-backports_abc to Ph5 for SALT 3006.7

View File

@ -0,0 +1,49 @@
Summary: Version numbering for anarchists and software realists
Name: python3-looseversion
Version: 1.3.0
Release: 1%{?dist}
License: Python Software Foundation License
Group: Development/Languages/Python
Vendor: VMware, Inc.
Distribution: Photon
Url: https://github.com/effigies/looseversion
Source0: https://files.pythonhosted.org/packages/64/7e/f13dc08e0712cc2eac8e56c7909ce2ac280dbffef2ffd87bd5277ce9d58b/looseversion-%{version}.tar.gz
%define sha512 looseversion=a54c788ba698b07308cfc75b5afba2cda59451d72d178be92b43c433deac9b24bffafa26f121af79a3d42eca8f83e7f50477498e1a17aec47cc213d39aa47eb2
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-wheel
BuildRequires: python3-pip
BuildRequires: python3-hatchling
BuildRequires: python3-pathspec
BuildRequires: python3-pluggy
BuildRequires: python3-packaging
Requires: python3
BuildArch: noarch
%description
Version numbering for anarchists and software realists
%prep
%autosetup -p1 -n looseversion-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%check
pip3 install tox
tox
%files
%defattr(-,root,root)
%{python3_sitelib}/*
%changelog
* Thu Apr 18 2024 Prafful Mehrotra <prafful.mehrotra@broadcom.com> 1.3.0-1
- Adding looseversion python package to Photon 5

View File

@ -0,0 +1,39 @@
/var/log/salt/master {
weekly
missingok
rotate 5
compress
notifempty
}
/var/log/salt/minion {
weekly
missingok
rotate 5
compress
notifempty
}
/var/log/salt/key {
weekly
missingok
rotate 5
compress
notifempty
}
/var/log/salt/cloud {
weekly
missingok
rotate 5
compress
notifempty
}
/var/log/salt/ssh {
weekly
missingok
rotate 5
compress
notifempty
}

View File

@ -0,0 +1,6 @@
diff --git a/requirements/base.txt b/requirements/base.txt
index 96037ccf14..712dcca023 100644
--- a/requirements/base.txt
+++ b/requirements/base.txt
@@ -7 +6,0 @@ distro>=1.0.1
-contextvars

View File

@ -0,0 +1,14 @@
[Unit]
Description=The Salt API
Documentation=man:salt-api(1) file:///usr/share/doc/salt/html/contents.html https://docs.saltproject.io/en/latest/contents.html
After=network.target
[Service]
Type=notify
NotifyAccess=all
LimitNOFILE=8192
ExecStart=/usr/bin/salt-api
TimeoutStopSec=3
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,4 @@
disable salt-api.service
disable salt-minion.service
disable salt-master.service
disable salt-syndic.service

View File

@ -0,0 +1,13 @@
[Unit]
Description=The Salt Master Server
Documentation=man:salt-master(1) file:///usr/share/doc/salt/html/contents.html https://docs.saltproject.io/en/latest/contents.html
After=network.target
[Service]
LimitNOFILE=100000
Type=notify
NotifyAccess=all
ExecStart=/usr/bin/salt-master
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,14 @@
[Unit]
Description=The Salt Minion
Documentation=man:salt-minion(1) file:///usr/share/doc/salt/html/contents.html https://docs.saltproject.io/en/latest/contents.html
After=network.target salt-master.service
[Service]
KillMode=process
Type=notify
NotifyAccess=all
LimitNOFILE=8192
ExecStart=/usr/bin/salt-minion
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,14 @@
[Unit]
Description=The Salt Master Server
Documentation=man:salt-syndic(1) file:///usr/share/doc/salt/html/contents.html https://docs.saltproject.io/en/latest/contents.html
After=network.target
PartOf=salt-master.service
[Service]
Type=notify
NotifyAccess=all
LimitNOFILE=8192
ExecStart=/usr/bin/salt-syndic
[Install]
WantedBy=multi-user.target

260
SPECS/salt3/salt3.spec Normal file
View File

@ -0,0 +1,260 @@
Name: salt3
Version: 3006.7
Release: 1%{?dist}
Summary: A parallel remote execution system with python3
Group: System Environment/Daemons
License: ASL 2.0
URL: http://saltstack.org/
Vendor: VMware, Inc.
Distribution: Photon
Source0: https://github.com/saltstack/salt/releases/download/v%{version}/salt-%{version}.tar.gz
%define sha512 salt=9d1759a7c0dfc9ad4fdc94460f0f3799483737207bfdc8ddd1424e5c6083ea74ef520f13c323d5cbd7f65c1d9bb13bbbeb5f2cafe6dcacbc2689e733794aef2d
Source2: salt-master.service
Source3: salt-syndic.service
Source4: salt-minion.service
Source5: salt-api.service
Source6: logrotate.salt
Source7: salt-default.preset
Patch0: requirements.patch
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: systemd
BuildRequires: python3-distro
Requires: pciutils
Requires: python3-backports_abc
Requires: python3-pycryptodomex
Requires: python3-jinja2
Requires: python3-msgpack
Requires: python3-PyYAML
Requires: python3-requests
Requires: python3-zmq
Requires: python3-tornado
Requires: python3-psutil
Requires: python3-distro
Requires: python3-looseversion
%ifarch x86_64
Requires: dmidecode
%endif
%description
Salt is a distributed remote execution system used to execute commands and
query data. It was developed in order to bring the best solutions found in
the world of remote execution together and make them better, faster and more
malleable. Salt accomplishes this via its ability to handle larger loads of
information, and not just dozens, but hundreds or even thousands of individual
servers, handle them quickly and through a simple and manageable interface.
%package master
Summary: Management component for salt, a parallel remote execution system with python3
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
%description master
The Salt master is the central server to which all minions connect.
%package minion
Summary: Client component for Salt, a parallel remote execution system
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
%description minion
The Salt minion is the agent component of Salt. It listens for instructions
from the master, runs jobs, and returns results back to the master.
%package syndic
Summary: Master-of-master component for Salt, a parallel remote execution system
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
%description syndic
The Salt syndic is a master daemon which can receive instruction from a
higher-level master, allowing for tiered organization of your Salt
infrastructure.
%package api
Summary: REST API for Salt, a parallel remote execution system
Group: System administration tools
Requires: %{name}-master = %{version}-%{release}
%description api
salt-api provides a REST interface to the Salt master.
%package cloud
Summary: Cloud provisioner for Salt, a parallel remote execution system
Group: System administration tools
Requires: %{name}-master = %{version}-%{release}
%description cloud
The salt-cloud tool provisions new cloud VMs, installs salt-minion on them, and
adds them to the master's collection of controllable minions.
%package ssh
Summary: Agentless SSH-based version of Salt, a parallel remote execution system
Group: System administration tools
Requires: %{name} = %{version}-%{release}
%description ssh
The salt-ssh tool can run remote execution functions and states without the use
of an agent (salt-minion) service.
%package proxy
Summary: Command Proxy of Salt, a parallel remote execution system
Group: System administration tools
Requires: %{name} = %{version}-%{release}
%description proxy
Receives commands from a Salt master and proxies these commands to devices
that are unable to run a full minion.
%package spm
Summary: Salt Package Manager of Salt, a parallel remote execution system
Group: System administration tools
Requires: %{name} = %{version}-%{release}
%description spm
Salt Package Manager
%prep
%autosetup -n salt-%{version} -p1
%build
%install
cd %{_builddir}/salt-%{version}
python3 setup.py install -O1 --root %{buildroot}
# Add some directories
install -d -m 0755 %{buildroot}%{_var}/cache/salt
install -d -m 0755 %{buildroot}%{_sysconfdir}/salt
install -d -m 0755 %{buildroot}%{_sysconfdir}/salt/cloud.conf.d
install -d -m 0755 %{buildroot}%{_sysconfdir}/salt/cloud.deploy.d
install -d -m 0755 %{buildroot}%{_sysconfdir}/salt/cloud.maps.d
install -d -m 0755 %{buildroot}%{_sysconfdir}/salt/cloud.profiles.d
install -d -m 0755 %{buildroot}%{_sysconfdir}/salt/cloud.providers.d
# Add the config files
install -p -m 0640 conf/minion %{buildroot}%{_sysconfdir}/salt/minion
install -p -m 0640 conf/master %{buildroot}%{_sysconfdir}/salt/master
install -p -m 0640 conf/cloud %{buildroot}%{_sysconfdir}/salt/cloud
install -p -m 0640 conf/roster %{buildroot}%{_sysconfdir}/salt/roster
mkdir -p %{buildroot}%{_unitdir}
install -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/
install -p -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/
install -p -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/
install -p -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d/
install -p -m 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/salt
install -v -D -m 0644 %{SOURCE7} %{buildroot}%{_presetdir}/50-salt.preset
%clean
rm -rf %{buildroot}
%preun master
%systemd_preun salt-master.service
%preun syndic
%systemd_preun salt-syndic.service
%preun minion
%systemd_preun salt-minion.service
%post master
%systemd_post salt-master.service
%post minion
%systemd_post salt-minion.service
%postun master
%systemd_postun salt-master.service
%postun syndic
%systemd_postun salt-syndic.service
%postun minion
%systemd_postun salt-minion.service
%files
%defattr(-,root,root,-)
%{python3_sitelib}/salt/*
%{python3_sitelib}/salt-*-py3.11.egg-info
%{_sysconfdir}/logrotate.d/salt
%{_var}/cache/salt
%{_bindir}/salt-pip
%{_presetdir}/50-salt.preset
%files master
%defattr(-,root,root)
%doc %{_mandir}/man7/salt.7.*
%doc %{_mandir}/man1/salt-cp.1.*
%doc %{_mandir}/man1/salt-key.1.*
%doc %{_mandir}/man1/salt-master.1.*
%doc %{_mandir}/man1/salt-run.1.*
%doc %{_mandir}/man1/salt.1.*
%{_bindir}/salt
%{_bindir}/salt-cp
%{_bindir}/salt-key
%{_bindir}/salt-master
%{_bindir}/salt-run
%{_unitdir}/salt-master.service
%config(noreplace) %{_sysconfdir}/salt/master
%files minion
%defattr(-,root,root)
%doc %{_mandir}/man1/salt-call.1.*
%doc %{_mandir}/man1/salt-minion.1.*
%{_bindir}/salt-minion
%{_bindir}/salt-call
%{_unitdir}/salt-minion.service
%config(noreplace) %{_sysconfdir}/salt/minion
%files syndic
%defattr(-,root,root,-)
%doc %{_mandir}/man1/salt-syndic.1.*
%{_bindir}/salt-syndic
%{_unitdir}/salt-syndic.service
%files api
%defattr(-,root,root)
%doc %{_mandir}/man1/salt-api.1.*
%{_bindir}/salt-api
%{_unitdir}/salt-api.service
%files cloud
%defattr(-,root,root,-)
%doc %{_mandir}/man1/salt-cloud.1.*
%{_bindir}/salt-cloud
%{_sysconfdir}/salt/cloud.conf.d
%{_sysconfdir}/salt/cloud.deploy.d
%{_sysconfdir}/salt/cloud.maps.d
%{_sysconfdir}/salt/cloud.profiles.d
%{_sysconfdir}/salt/cloud.providers.d
%config(noreplace) %{_sysconfdir}/salt/cloud
%files ssh
%defattr(-,root,root,-)
%doc %{_mandir}/man1/salt-ssh.1.*
%{_bindir}/salt-ssh
%{_sysconfdir}/salt/roster
%files proxy
%defattr(-,root,root,-)
%doc %{_mandir}/man1/salt-proxy.1.*
%{_bindir}/salt-proxy
%files spm
%defattr(-,root,root,-)
%doc %{_mandir}/man1/spm.1.*
%{_bindir}/spm
%changelog
* Wed Apr 17 2024 Prafful Mehrotra <prafful.mehrotra@broadcom.com> 3006.7-1
- Update to 3006.7-1 for Ph5 and adding python_backport_abc, looseversion