Skip to content

Commit

Permalink
Merge pull request #123 from brianhlin/SOFTWARE-4841.gratia-probe-fixups
Browse files Browse the repository at this point in the history
Add OSPool specific ProbeConfig changes to the RPM (SOFTWARE-4841)
  • Loading branch information
brianhlin authored Nov 4, 2021
2 parents 4a018a3 + 01ebdf0 commit e8bc205
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions rpm/osg-flock.spec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Name: osg-flock
Version: 1.6
Release: 2%{?dist}
Release: 3%{?dist}
Summary: OSG configurations for a flocking host

License: Apache 2.0
URL: https://opensciencegrid.org/docs/submit/osg-flock

BuildArch: noarch

Requires: gratia-probe-condor-ap
Requires(post): gratia-probe-condor-ap
Requires: condor

Source0: %{name}-%{version}%{?gitrev:-%{gitrev}}.tar.gz
Expand All @@ -32,6 +32,25 @@ install -m 644 rpm/80-osg-flocking.conf $RPM_BUILD_ROOT/%{_sysconfdir}/condor/co
# Install gratia configuration
install -d $RPM_BUILD_ROOT/%{_sysconfdir}/gratia/condor/

%post
# Set OSPool specific Gratia probe config
probeconfig=/etc/gratia/condor-ap/ProbeConfig
overrides=(
'MapUnknownToGroup="1"'
'MapGroupToRole="1"'
'VOOverride="OSG"'
)

for override in "${overrides[@]}"; do
if grep "$override" $probeconfig 2>&1 > /dev/null; then
# override already present
continue
else
# add override if not present
sed -i -e "s/\(EnableProbe.*\)/\1\n $override/" $probeconfig
fi
done

%clean
rm -rf $RPM_BUILD_ROOT

Expand All @@ -43,6 +62,10 @@ rm -rf $RPM_BUILD_ROOT


%changelog
* Thu Nov 4 2021 Brian Lin <[email protected]> - 1.6-3
- Append OSPool specific ProbeConfig changes in post-installation
(SOFTWARE-4846)

* Wed Oct 27 2021 Brian Lin <[email protected]> 1.6-2
- Remove reference to old ProbeConfig

Expand Down

0 comments on commit e8bc205

Please sign in to comment.