%global pypi_name ceilometer
Name: openstack-ceilometer
-Version: 2014.2.b1
+Version: 2015.1.0b1
Release: 2%{?dist}
Summary: OpenStack measurement collection service
Source0: http://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
Source1: %{pypi_name}-dist.conf
Source2: %{pypi_name}.logrotate
-Source3: %{pypi_name}.conf.sample
+Source3: ceilometer-rootwrap-sudoers
+%if 0%{?rhel} && 0%{?rhel} <= 6
Source10: %{name}-api.init
Source100: %{name}-api.upstart
Source11: %{name}-collector.init
Source150: %{name}-alarm-evaluator.upstart
Source16: %{name}-notification.init
Source160: %{name}-notification.upstart
+Source17: %{name}-ipmi.init
+Source170: %{name}-ipmi.upstart
+%else
+Source10: %{name}-api.service
+Source11: %{name}-collector.service
+Source12: %{name}-compute.service
+Source13: %{name}-central.service
+Source14: %{name}-alarm-notifier.service
+Source15: %{name}-alarm-evaluator.service
+Source16: %{name}-notification.service
+Source17: %{name}-ipmi.service
+%endif
#
# patches_base=2014.1.1
BuildRequires: python-pbr
BuildRequires: python-d2to1
BuildRequires: python2-devel
-
BuildRequires: openstack-utils
+# These are required to generate ceilometer configuration file
+BuildRequires: python-tox
+BuildRequires: python-oslo-db
+BuildRequires: python-oslo-messaging
+BuildRequires: python-keystonemiddleware
+
# These are required to build due to the requirements check added
BuildRequires: python-sqlalchemy
-BuildRequires: python-webob1.2
+BuildRequires: python-webob
+%if ! (0%{?rhel} && 0%{?rhel} <= 6)
+BuildRequires: systemd-units
+%endif
%description
OpenStack ceilometer provides services to measure and
Summary: OpenStack ceilometer python libraries
Group: Applications/System
+Requires: python-retrying >= 1.2.2, python-retrying < 1.3.0, python-retrying > 1.3.0
Requires: python-qpid
Requires: python-babel
-Requires: python-eventlet >= 0.13.0
+Requires: python-eventlet >= 0.15.2
Requires: python-iso8601 >= 0.1.9
Requires: python-lxml >= 2.3
Requires: python-anyjson >= 0.3.3
Requires: python-jsonpath-rw >= 1.2.0, python-jsonpath-rw < 2.0
-Requires: python-stevedore >= 0.14
+Requires: python-stevedore >= 1.1.0
Requires: python-msgpack >= 0.4.0
Requires: python-posix_ipc
Requires: python-six >= 1.7.0
-Requires: PyYAML
+Requires: PyYAML >= 3.1.0
+Requires: python-sqlalchemy >= 0.8.4, python-sqlalchemy <= 0.8.99, python-sqlalchemy >= 0.9.7, python-sqlalchemy <= 0.9.99
Requires: python-argparse
-Requires: python-croniter >= 0.3.4
Requires: python-happybase >= 0.5, python-happybase < 0.7, python-happybase > 0.7
Requires: python-jsonschema >= 2.0.0, python-jsonschema < 3.0.0
Requires: python-lockfile >= 0.8
-Requires: python-netaddr >= 0.7.6
+Requires: python-netaddr >= 0.7.12
Requires: python-pbr >= 0.6, python-pbr < 0.7, python-pbr > 0.7, python-pbr < 1.0
-Requires: python-requests >= 1.1
+Requires: python-requests >= 2.2.0, python-requests < 2.4.0, python-requests > 2.4.0
Requires: python-tooz >= 0.3
-Requires: python-sqlalchemy >= 0.8.4, python-sqlalchemy < 0.95, python-sqlalchemy > 0.9.5, python-sqlalchemy <= 0.9.99
Requires: python-alembic >= 0.6.4
-Requires: python-migrate >= 0.9.1
+Requires: python-migrate >= 0.9.1, python-migrate < 0.9.2, python-migrate > 0.9.2
Requires: python-webob >= 1.2.3
-Requires: python-oslo-config >= 1:1.2.1
-Requires: python-oslo.db >= 0.2.0
-Requires: python-oslo-vmware >= 0.4
-Requires: python-oslo-utils >= 0.1.1
-Requires: python-oslo-messaging >= 1.3.0
-Requires: python-oslo.serialization >= 0.1.0
+Requires: python-oslo-concurrency >= 0.4.0
+Requires: python-oslo-config >= 1:1.4.0
+Requires: python-oslo-db >= 1.0.0
+Requires: python-oslo-rootwrap >= 1.3.0
+Requires: python-oslo-vmware >= 0.6.0
+Requires: python-oslo-utils >= 1.0.0
+Requires: python-oslo-messaging >= 1.4.0
+Requires: python-oslo-serialization >= 1.0.0
+Requires: python-oslo-middleware >= 0.1.0
Requires: pysnmp > 4.2.1, pysnmp < 5.0.0
Requires: pytz
Requires: python-flask
Requires: python-pecan >= 0.5.0
Requires: python-wsme >= 0.6
-Requires: python-neutronclient >= 2.3.5
-Requires: python-novaclient >= 2.17.0
-Requires: python-keystoneclient >= 0.9.0
-Requires: python-glanceclient >= 0.13.1
-Requires: python-swiftclient >= 2.0.2
+Requires: python-neutronclient >= 2.3.6
+Requires: python-novaclient >= 2.18.0
+Requires: python-keystoneclient >= 0.11.1
+Requires: python-glanceclient >= 0.14.0
+Requires: python-swiftclient >= 2.2.0
Requires: python-ceilometerclient >= 1.0.6
Requires: libvirt-python
Requires: python-ceilometer = %{version}-%{release}
Requires: openstack-utils
+%if 0%{?rhel} && 0%{?rhel} <= 6
Requires(post): chkconfig
Requires(postun): initscripts
Requires(preun): chkconfig
+%else
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%endif
Requires(pre): shadow-utils
-
%description common
OpenStack ceilometer provides services to measure and
collect metrics from OpenStack components.
Requires: %{name}-common = %{version}-%{release}
-Requires: python-novaclient >= 2.17.0
-Requires: python-keystoneclient >= 0.9.0
+Requires: python-novaclient >= 2.18.0
+Requires: python-keystoneclient >= 0.11.1
Requires: libvirt-python
%description compute
Requires: %{name}-common = %{version}-%{release}
-Requires: python-novaclient >= 2.17.0
-Requires: python-keystoneclient >= 0.9.0
-Requires: python-glanceclient >= 0.13.1
-Requires: python-swiftclient >= 2.0.2
+Requires: python-novaclient >= 2.18.0
+Requires: python-keystoneclient >= 0.11.1
+Requires: python-glanceclient >= 0.14.0
+Requires: python-swiftclient >= 2.2.0
%description central
OpenStack ceilometer provides services to measure and
Requires: %{name}-common = %{version}-%{release}
+Requires: python-keystonemiddleware
+Requires: python-oslo-db
Requires: python-pymongo
Requires: python-flask
-Requires: python-pecan >= 0.4.5
Requires: python-wsme >= 0.6
+Requires: python-pecan >= 0.5.0
+Requires: python-paste-deploy
%description api
OpenStack ceilometer provides services to measure and
and evaluation services.
+%package ipmi
+Summary: OpenStack ceilometer ipmi agent
+Group: Applications/System
+
+Requires: %{name}-common = %{version}-%{release}
+
+Requires: python-novaclient
+Requires: python-keystoneclient
+Requires: python-neutronclient
+Requires: python-tooz
+Requires: python-oslo-rootwrap
+Requires: ipmitool
+
+%description ipmi
+OpenStack ceilometer provides services to measure and
+collect metrics from OpenStack components.
+
+This package contains the ipmi agent to be run on OpenStack
+nodes from which IPMI sensor data is to be collected directly,
+by-passing Ironic's management of baremetal.
+
+
%if 0%{?with_doc}
%package doc
Summary: Documentation for OpenStack ceilometer
popd
+# Genenrate ceilometer.conf.sample
+oslo-config-generator --output-file etc/ceilometer/ceilometer.conf.sample \
+ --namespace ceilometer \
+ --namespace oslo.db \
+ --namespace oslo.messaging \
+ --namespace keystonemiddleware.auth_token
+
# Setup directories
install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer
install -d -m 755 %{buildroot}%{_sharedstatedir}/ceilometer/tmp
# Install config files
install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer
+install -d -m 755 %{buildroot}%{_sysconfdir}/ceilometer/rootwrap.d
+install -d -m 755 %{buildroot}%{_sysconfdir}/sudoers.d
install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/ceilometer/ceilometer-dist.conf
-install -p -D -m 640 %{SOURCE3} %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
+install -p -D -m 640 %{SOURCE3} %{buildroot}%{_sysconfdir}/sudoers.d/ceilometer
+install -p -D -m 640 etc/ceilometer/ceilometer.conf.sample %{buildroot}%{_sysconfdir}/ceilometer/ceilometer.conf
install -p -D -m 640 etc/ceilometer/policy.json %{buildroot}%{_sysconfdir}/ceilometer/policy.json
install -p -D -m 640 etc/ceilometer/pipeline.yaml %{buildroot}%{_sysconfdir}/ceilometer/pipeline.yaml
install -p -D -m 640 etc/ceilometer/event_definitions.yaml %{buildroot}%{_sysconfdir}/ceilometer/event_definitions.yaml
install -p -D -m 640 etc/ceilometer/api_paste.ini %{buildroot}%{_sysconfdir}/ceilometer/api_paste.ini
+install -p -D -m 640 etc/ceilometer/rootwrap.conf %{buildroot}%{_sysconfdir}/ceilometer/rootwrap.conf
+install -p -D -m 640 etc/ceilometer/rootwrap.d/ipmi.filters %{buildroot}/%{_sysconfdir}/ceilometer/rootwrap.d/ipmi.filters
# Install initscripts for services
+%if 0%{?rhel} && 0%{?rhel} <= 6
install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/%{name}-api
install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/%{name}-collector
install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/%{name}-compute
install -p -D -m 755 %{SOURCE14} %{buildroot}%{_initrddir}/%{name}-alarm-notifier
install -p -D -m 755 %{SOURCE15} %{buildroot}%{_initrddir}/%{name}-alarm-evaluator
install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initrddir}/%{name}-notification
+install -p -D -m 755 %{SOURCE17} %{buildroot}%{_initrddir}/%{name}-ipmi
# Install upstart jobs examples
install -d -m 755 %{buildroot}%{_datadir}/ceilometer
install -p -m 644 %{SOURCE140} %{buildroot}%{_datadir}/ceilometer/
install -p -m 644 %{SOURCE150} %{buildroot}%{_datadir}/ceilometer/
install -p -m 644 %{SOURCE160} %{buildroot}%{_datadir}/ceilometer/
+install -p -m 644 %{SOURCE170} %{buildroot}%{_datadir}/ceilometer/
+%else
+install -p -D -m 644 %{SOURCE10} %{buildroot}%{_unitdir}/%{name}-api.service
+install -p -D -m 644 %{SOURCE11} %{buildroot}%{_unitdir}/%{name}-collector.service
+install -p -D -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/%{name}-compute.service
+install -p -D -m 644 %{SOURCE13} %{buildroot}%{_unitdir}/%{name}-central.service
+install -p -D -m 644 %{SOURCE14} %{buildroot}%{_unitdir}/%{name}-alarm-notifier.service
+install -p -D -m 644 %{SOURCE15} %{buildroot}%{_unitdir}/%{name}-alarm-evaluator.service
+install -p -D -m 644 %{SOURCE16} %{buildroot}%{_unitdir}/%{name}-notification.service
+install -p -D -m 644 %{SOURCE17} %{buildroot}%{_unitdir}/%{name}-ipmi.service
+%endif
# Install logrotate
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
+%if 0%{?rhel} && 0%{?rhel} <= 6
# Install pid directory
install -d -m 755 %{buildroot}%{_localstatedir}/run/ceilometer
+%endif
# Remove unneeded in production stuff
rm -f %{buildroot}%{_bindir}/ceilometer-debug
exit 0
%post compute
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -eq 1 ] ; then
# Initial installation
/sbin/chkconfig --add %{name}-compute
fi
+%else
+%systemd_post %{name}-compute.service
+%endif
%post collector
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -eq 1 ] ; then
# Initial installation
/sbin/chkconfig --add %{name}-collector
fi
+%else
+%systemd_post %{name}-collector.service
+%endif
%post notification
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -eq 1 ] ; then
# Initial installation
/sbin/chkconfig --add %{name}-notification
fi
+%else
+%systemd_post %{name}-notification.service
+%endif
%post api
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -eq 1 ] ; then
# Initial installation
/sbin/chkconfig --add %{name}-api
fi
+%else
+%systemd_post %{name}-api.service
+%endif
%post central
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -eq 1 ] ; then
# Initial installation
/sbin/chkconfig --add %{name}-central
fi
+%else
+%systemd_post %{name}-central.service
+%endif
+
%post alarm
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -eq 1 ] ; then
# Initial installation
for svc in alarm-notifier alarm-evaluator; do
/sbin/chkconfig --add %{name}-${svc}
done
fi
+%else
+%systemd_post %{name}-alarm-notifier.service %{name}-alarm-evaluator.service
+%endif
+
+%post ipmi
+%if 0%{?rhel} && 0%{?rhel} <= 6
+if [ $1 -eq 1 ] ; then
+ # Initial installation
+ /sbin/chkconfig --add %{name}-ipmi
+fi
+%else
+%systemd_post %{name}-alarm-ipmi.service
+%endif
%preun compute
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -eq 0 ] ; then
for svc in compute; do
/sbin/service %{name}-${svc} stop > /dev/null 2>&1
/sbin/chkconfig --del %{name}-${svc}
done
fi
+%else
+%systemd_preun %{name}-compute.service
+%endif
%preun collector
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -eq 0 ] ; then
for svc in collector; do
/sbin/service %{name}-${svc} stop > /dev/null 2>&1
/sbin/chkconfig --del %{name}-${svc}
done
fi
+%else
+%systemd_preun %{name}-collector.service
+%endif
%preun notification
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -eq 0 ] ; then
for svc in notification; do
/sbin/service %{name}-${svc} stop > /dev/null 2>&1
/sbin/chkconfig --del %{name}-${svc}
done
fi
+%else
+%systemd_preun %{name}-notification.service
+%endif
%preun api
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -eq 0 ] ; then
for svc in api; do
/sbin/service %{name}-${svc} stop > /dev/null 2>&1
/sbin/chkconfig --del %{name}-${svc}
done
fi
+%else
+%systemd_preun %{name}-api.service
+%endif
%preun central
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -eq 0 ] ; then
for svc in central; do
/sbin/service %{name}-${svc} stop > /dev/null 2>&1
/sbin/chkconfig --del %{name}-${svc}
done
fi
+%else
+%systemd_preun %{name}-central.service
+%endif
+
%preun alarm
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -eq 0 ] ; then
for svc in alarm-notifier alarm-evaluator; do
/sbin/service %{name}-${svc} stop > /dev/null 2>&1
/sbin/chkconfig --del %{name}-${svc}
done
fi
+%else
+%systemd_preun %{name}-alarm-notifier.service %{name}-alarm-evaluator.service
+%endif
+
+%preun ipmi
+%if 0%{?rhel} && 0%{?rhel} <= 6
+if [ $1 -eq 0 ] ; then
+ for svc in ipmi; do
+ /sbin/service %{name}-${svc} stop > /dev/null 2>&1
+ /sbin/chkconfig --del %{name}-${svc}
+ done
+fi
+%else
+%systemd_preun %{name}-ipmi.service
+%endif
%postun compute
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
for svc in compute; do
/sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
done
fi
+%else
+%systemd_postun_with_restart %{name}-compute.service
+%endif
%postun collector
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
for svc in collector; do
/sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
done
fi
+%else
+%systemd_postun_with_restart %{name}-collector.service
+%endif
%postun notification
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
for svc in notification; do
/sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
done
fi
+%else
+%systemd_postun_with_restart %{name}-notification.service
+%endif
%postun api
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
for svc in api; do
/sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
done
fi
+%else
+%systemd_postun_with_restart %{name}-api.service
+%endif
%postun central
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
for svc in central; do
/sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
done
fi
+%else
+%systemd_postun_with_restart %{name}-central.service
+%endif
+
%postun alarm
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+%if 0%{?rhel} && 0%{?rhel} <= 6
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
for svc in alarm-notifier alarm-evaluator; do
/sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
done
fi
+%else
+%systemd_postun_with_restart %{name}-alarm-notifier.service %{name}-alarm-evaluator.service
+%endif
+%postun ipmi
+%if 0%{?rhel} && 0%{?rhel} <= 6
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ for svc in ipmi; do
+ /sbin/service %{name}-${svc} condrestart > /dev/null 2>&1 || :
+ done
+fi
+%else
+%systemd_postun_with_restart %{name}-ipmi.service
+%endif
%files common
%doc LICENSE
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%dir %attr(0755, ceilometer, root) %{_localstatedir}/log/ceilometer
+%if 0%{?rhel} && 0%{?rhel} <= 6
%dir %attr(0755, ceilometer, root) %{_localstatedir}/run/ceilometer
+%endif
-%{_bindir}/ceilometer-agent-ipmi
%{_bindir}/ceilometer-dbsync
%{_bindir}/ceilometer-expirer
-%{_bindir}/ceilometer-rootwrap
%{_bindir}/ceilometer-send-sample
+%{_bindir}/ceilometer-polling
%defattr(-, ceilometer, ceilometer, -)
%files compute
%{_bindir}/ceilometer-agent-compute
+%if 0%{?rhel} && 0%{?rhel} <= 6
%{_initrddir}/%{name}-compute
%{_datarootdir}/ceilometer/%{name}-compute.upstart
+%else
+%{_unitdir}/%{name}-compute.service
+%endif
%files collector
%{_bindir}/ceilometer-collector*
+%if 0%{?rhel} && 0%{?rhel} <= 6
%{_initrddir}/%{name}-collector
%{_datarootdir}/ceilometer/%{name}-collector.upstart
+%else
+%{_unitdir}/%{name}-collector.service
+%endif
%files notification
%{_bindir}/ceilometer-agent-notification
+%if 0%{?rhel} && 0%{?rhel} <= 6
%{_initrddir}/%{name}-notification
%{_datarootdir}/ceilometer/%{name}-notification.upstart
+%else
+%{_unitdir}/%{name}-notification.service
+%endif
%files api
%{_bindir}/ceilometer-api
+%if 0%{?rhel} && 0%{?rhel} <= 6
%{_initrddir}/%{name}-api
%{_datarootdir}/ceilometer/%{name}-api.upstart
+%else
+%{_unitdir}/%{name}-api.service
+%endif
%files central
%{_bindir}/ceilometer-agent-central
+%if 0%{?rhel} && 0%{?rhel} <= 6
%{_initrddir}/%{name}-central
%{_datarootdir}/ceilometer/%{name}-central.upstart
+%else
+%{_unitdir}/%{name}-central.service
+%endif
+
+
+%files ipmi
+%config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/rootwrap.conf
+%config(noreplace) %attr(-, root, ceilometer) %{_sysconfdir}/ceilometer/rootwrap.d/ipmi.filters
+%{_bindir}/ceilometer-rootwrap
+%{_bindir}/ceilometer-agent-ipmi
+%{_sysconfdir}/sudoers.d/ceilometer
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%{_initrddir}/%{name}-ipmi
+%{_datarootdir}/ceilometer/%{name}-ipmi.upstart
+%else
+%{_unitdir}/%{name}-ipmi.service
+%endif
%files alarm
%{_bindir}/ceilometer-alarm-notifier
%{_bindir}/ceilometer-alarm-evaluator
+%if 0%{?rhel} && 0%{?rhel} <= 6
%{_initrddir}/%{name}-alarm-notifier
%{_datarootdir}/ceilometer/%{name}-alarm-notifier.upstart
%{_initrddir}/%{name}-alarm-evaluator
%{_datarootdir}/ceilometer/%{name}-alarm-evaluator.upstart
+%else
+%{_unitdir}/%{name}-alarm-notifier.service
+%{_unitdir}/%{name}-alarm-evaluator.service
+%endif
%changelog
+* Wed Jan 21 2015 Ivan Berezovskiy <iberezovskiy@mirantis.com> - 2015.1.0b1
+- Update version to 2015.1.0b1
+
+* Wed Nov 19 2014 Daniil Trishkin <dtrishkin@mirantis.com> - 2014.2
+- Update to upstream 2014.2
+- Update requirements
+
* Fri Jul 4 2014 Ivan Berezovskiy <iberezovskiy@mirantis.com> - 2014.2.b1
- Update to upstream 2014.2.b1
- Update requirements