Add spec file for basic puppet configuration on client & server
[myops.git] / myops.spec
diff --git a/myops.spec b/myops.spec
new file mode 100644 (file)
index 0000000..9647ed4
--- /dev/null
@@ -0,0 +1,113 @@
+#
+# $Id$
+# 
+
+%define url $URL: git://git.planet-lab.org/myops.git$
+
+%define name myops
+# keep this version in sync with monitor/monitor_version.py
+%define version 1.0
+%define taglevel 0
+
+%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+%global python_sitearch        %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
+
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Source0: %{name}-%{version}.tar.bz2
+License: GPL
+Group: Applications/System
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+
+Vendor: PlanetLab
+Packager: PlanetLab Central <support@planet-lab.org>
+Distribution: PlanetLab %{plrelease}
+URL: %(echo %{url} | cut -d ' ' -f 2)
+
+
+Summary: MyOps operational packages.
+Group: Applications/System
+
+%description
+MyOps is a collection of support services and scripts for operating a MyPLC
+deployment.
+
+%package client
+Summary: MyOps for client
+Group: Applications/System
+
+Requires: puppet
+Requires: coreutils
+
+%description client
+Client side configuration.
+
+######################################## Server
+%package server
+Summary: MyOps the server side
+Group: Applications/System
+
+Requires: puppet-server
+Requires: puppet
+Requires: coreutils
+
+%description server
+Server side services
+
+%prep
+%setup -q
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+
+#################### SERVER
+echo "Reminder: open ports 8139,8140,8141 in iptables"
+install -d $RPM_BUILD_ROOT/usr/share/%{name}
+install -d $RPM_BUILD_ROOT/etc/puppet/manifests
+install -d $RPM_BUILD_ROOT/etc/puppet/bin
+install -d $RPM_BUILD_ROOT/etc/cron.hourly
+install -d $RPM_BUILD_ROOT/var/lib/puppet
+
+rsync -a ./puppet  $RPM_BUILD_ROOT/usr/share/myops/
+
+# Generate an autosign list from plc node hostnames
+install -D -m 755 puppet/cron.d/autosign.plcsh $RPM_BUILD_ROOT/%{_sysconfdir}/cron.hourly/
+install -D -m 755 puppet/server/bin/node_classifier $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/bin/
+install -D -m 644 puppet/server/manifests/site.pp $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/manifests/
+install -D -m 644 puppet/server/puppetmaster.conf $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/
+install -D -m 644 puppet/client/hardcoded.conf $RPM_BUILD_ROOT/%{_sysconfdir}/puppet
+
+rsync -ar ./puppet/server/modules $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files puppet-server
+%defattr(-,root,root)
+/%{_sysconfdir}/cron.hourly/autosign.plcsh
+/%{_sysconfdir}/puppet/bin/node_classifier
+/%{_sysconfdir}/puppet/manifests/site.pp
+/%{_sysconfdir}/puppet/puppetmaster.conf
+/%{_sysconfdir}/puppet/modules
+
+%files puppet-client
+%defattr(-,root,root)
+/%{_sysconfdir}/puppet/hardcoded.conf
+/usr/share/%{name}
+
+%post server
+chkconfig --add puppetmaster
+chkconfig puppetmaster on
+
+%post client
+chkconfig --add puppet
+chkconfig puppet on
+
+cat /etc/puppet/hardcoded.conf >> /etc/puppet/puppet.conf
+
+
+%changelog
+%define module_current_branch 1.0