!1 [WIP]Adds spec/configs/source for openstack-ironic
From: @huangtianhua Reviewed-by: Signed-off-by:
This commit is contained in:
commit
d3efdfaed1
BIN
ironic-stable-victoria.tar.gz
Normal file
BIN
ironic-stable-victoria.tar.gz
Normal file
Binary file not shown.
17
openstack-ironic-api.service
Normal file
17
openstack-ironic-api.service
Normal file
@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=OpenStack Ironic - API
|
||||
After=syslog.target network.target
|
||||
After=mariadb.service postgresql.service rabbitmq-server.service
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
User=ironic
|
||||
Group=ironic
|
||||
WorkingDirectory=/var/lib/ironic
|
||||
PrivateTmp=yes
|
||||
ExecStartPre=-/usr/bin/ironic-dbsync
|
||||
ExecStart=/usr/bin/ironic-api
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
16
openstack-ironic-conductor.service
Normal file
16
openstack-ironic-conductor.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=OpenStack Ironic - Conductor
|
||||
After=syslog.target network.target
|
||||
After=mariadb.service postgresql.service rabbitmq-server.service
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
User=ironic
|
||||
Group=ironic
|
||||
WorkingDirectory=/var/lib/ironic
|
||||
PrivateTmp=yes
|
||||
ExecStart=/usr/bin/ironic-conductor
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
30
openstack-ironic.README.config
Normal file
30
openstack-ironic.README.config
Normal file
@ -0,0 +1,30 @@
|
||||
The main service configuration (/etc/$project/$project.conf) can still be used
|
||||
for configuration but the preferred way is to add config file snippets into
|
||||
/etc/$project/$project.conf.d/ instead.
|
||||
|
||||
As part of the packaging, the package itself installs a config snippet at
|
||||
/etc/$project/$project.conf.d/010-$project.conf with basic configuration. This
|
||||
file should not be modified. In case there is a need to overwrite or add
|
||||
settings, a XXX-$project.conf (XXX being a 3 digit number) should be created
|
||||
instead.
|
||||
|
||||
Config directory file snippet naming should follow these conventions:
|
||||
- snippets should start with "XXX-" where "X" is a number
|
||||
- snippets must end with ".conf"
|
||||
- config management systems (Crowbar, Salt, ...) should use numbers
|
||||
between 100 and 499
|
||||
- users should use numbers starting from 500
|
||||
|
||||
Configuring just a single $program (eg for Nova, $project is "nova" and
|
||||
$program is "nova-api", "nova-compute", "nova-scheduler", ...) can be done
|
||||
in a similar way. The config snippets should be placed in
|
||||
/etc/$project/$program.conf.d/ . The same snippets rules apply here, too.
|
||||
|
||||
$program reads the configuration files in the following order:
|
||||
- /etc/$project/$project.conf
|
||||
- /etc/$project/$project.conf.d/*.conf (lexically sorted)
|
||||
- /etc/$project/$program.conf.d/*.conf (lexically sorted)
|
||||
|
||||
The last configured key overwrites all previous ones. In particular, settings
|
||||
in /etc/$project/$project.conf are overwritten by config values from any file
|
||||
in /etc/$project/$project.conf.d/XXX-$project.conf .
|
||||
7
openstack-ironic.defaultconf
Normal file
7
openstack-ironic.defaultconf
Normal file
@ -0,0 +1,7 @@
|
||||
[DEFAULT]
|
||||
log_dir = /var/log/ironic
|
||||
rootwrap_config = /etc/ironic/rootwrap.conf
|
||||
state_path = /var/lib/ironic
|
||||
|
||||
[oslo_concurrency]
|
||||
lock_path = /run/ironic
|
||||
10
openstack-ironic.logrotate
Normal file
10
openstack-ironic.logrotate
Normal file
@ -0,0 +1,10 @@
|
||||
/var/log/ironic/*.log {
|
||||
compress
|
||||
rotate 15
|
||||
size 1M
|
||||
dateext
|
||||
missingok
|
||||
notifempty
|
||||
su ironic ironic
|
||||
sharedscripts
|
||||
}
|
||||
318
openstack-ironic.spec
Normal file
318
openstack-ironic.spec
Normal file
@ -0,0 +1,318 @@
|
||||
%global with_doc 0
|
||||
Name: openstack-ironic
|
||||
Epoch: 0
|
||||
Version: 16.0.4
|
||||
Release: 0.1.dev3
|
||||
Summary: Openstack Provisioning of Bare Metal Servers
|
||||
License: ASL 2.0
|
||||
URL: https://launchpad.net/ironic
|
||||
Source0: ironic-stable-victoria.tar.gz
|
||||
Source1: openstack-ironic.sudoers
|
||||
Source2: openstack-ironic.logrotate
|
||||
Source3: openstack-ironic.tmpfiles
|
||||
Source4: openstack-ironic.defaultconf
|
||||
Source5: openstack-ironic.README.config
|
||||
# systemd service files
|
||||
Source6: openstack-ironic-api.service
|
||||
Source7: openstack-ironic-conductor.service
|
||||
BuildRequires: openstack-macros
|
||||
BuildRequires: python3-jinja2
|
||||
BuildRequires: python3-sqlalchemy
|
||||
BuildRequires: python3-wsme
|
||||
BuildRequires: python3-webob
|
||||
BuildRequires: python3-alembic
|
||||
BuildRequires: python3-automaton
|
||||
BuildRequires: python3-cinderclient
|
||||
BuildRequires: python3-ddt
|
||||
BuildRequires: python3-eventlet
|
||||
BuildRequires: python3-fixtures
|
||||
BuildRequires: python3-futurist
|
||||
BuildRequires: python3-glanceclient
|
||||
BuildRequires: python3-ironic-lib
|
||||
BuildRequires: python3-iso8601
|
||||
BuildRequires: python3-jsonpatch
|
||||
BuildRequires: python3-jsonschema
|
||||
BuildRequires: python3-keystoneauth1
|
||||
BuildRequires: python3-keystonemiddleware
|
||||
BuildRequires: python3-mock
|
||||
BuildRequires: python3-neutronclient
|
||||
BuildRequires: python3-os-traits
|
||||
BuildRequires: python3-oslo-concurrency
|
||||
BuildRequires: python3-oslo-config
|
||||
BuildRequires: python3-oslo-context
|
||||
BuildRequires: python3-oslo-db
|
||||
BuildRequires: python3-oslo-i18n
|
||||
BuildRequires: python3-oslo-log
|
||||
BuildRequires: python3-oslo-messaging
|
||||
BuildRequires: python3-oslo-middleware
|
||||
BuildRequires: python3-oslo-policy
|
||||
BuildRequires: python3-oslo-reports
|
||||
BuildRequires: python3-oslo-rootwrap
|
||||
BuildRequires: python3-oslo-serialization
|
||||
BuildRequires: python3-oslo-service
|
||||
BuildRequires: python3-oslo-upgradecheck
|
||||
BuildRequires: python3-oslo-utils
|
||||
BuildRequires: python3-oslo-versionedobjects
|
||||
BuildRequires: python3-oslotest
|
||||
BuildRequires: python3-osprofiler
|
||||
BuildRequires: python3-pbr
|
||||
BuildRequires: python3-pecan
|
||||
BuildRequires: python3-psutil
|
||||
BuildRequires: python3-pysendfile
|
||||
BuildRequires: python3-pysnmp
|
||||
BuildRequires: python3-pytz
|
||||
BuildRequires: python3-requests
|
||||
BuildRequires: python3-retrying
|
||||
BuildRequires: python3-rfc3986
|
||||
BuildRequires: python3-stestr
|
||||
BuildRequires: python3-stevedore
|
||||
BuildRequires: python3-swiftclient
|
||||
BuildRequires: python3-testtools
|
||||
BuildRequires: python3-tooz
|
||||
BuildRequires: sudo
|
||||
Requires: logrotate
|
||||
Requires: python3-ironic = %{epoch}:%{version}-%{release}
|
||||
BuildArch: noarch
|
||||
%if 0%{?suse_version}
|
||||
BuildRequires: systemd-rpm-macros
|
||||
%{?systemd_requires}
|
||||
%else
|
||||
BuildRequires: systemd
|
||||
Requires(post): systemd
|
||||
Requires(postun): systemd
|
||||
Requires(pre): shadow-utils
|
||||
Requires(preun): systemd
|
||||
%endif
|
||||
|
||||
%description
|
||||
Ironic is an Incubated OpenStack project which aims to provision bare metal
|
||||
machines instead of virtual machines, forked from the Nova Baremetal driver.
|
||||
It is best thought of as a bare metal hypervisor API and a set of plugins
|
||||
which interact with the bare metal hypervisors. By default, it will use
|
||||
PXE and IPMI in concert to provision and turn on/off machines, but Ironic
|
||||
also supports vendor-specific plugins which may implement additional functionality.
|
||||
|
||||
%package -n python3-ironic
|
||||
Summary: OpenStack shared file system service (ironic) - Python module
|
||||
Group: Development/Languages/Python
|
||||
Requires: python3-jinja2
|
||||
Requires: python3-sqlalchemy
|
||||
Requires: python3-wsme
|
||||
Requires: python3-webob
|
||||
Requires: python3-alembic
|
||||
Requires: python3-automaton
|
||||
Requires: python3-cinderclient
|
||||
Requires: python3-eventlet
|
||||
Requires: python3-futurist
|
||||
Requires: python3-glanceclient
|
||||
Requires: python3-ironic-lib
|
||||
Requires: python3-jsonpatch
|
||||
Requires: python3-jsonschema
|
||||
Requires: python3-keystoneauth1
|
||||
Requires: python3-keystonemiddleware
|
||||
Requires: python3-neutronclient
|
||||
Requires: python3-os-traits
|
||||
Requires: python3-oslo-concurrency
|
||||
Requires: python3-oslo-config
|
||||
Requires: python3-oslo-context
|
||||
Requires: python3-oslo-db
|
||||
Requires: python3-oslo-i18n
|
||||
Requires: python3-oslo-log
|
||||
Requires: python3-oslo-messaging
|
||||
Requires: python3-oslo-middleware
|
||||
Requires: python3-oslo-policy
|
||||
Requires: python3-oslo-reports
|
||||
Requires: python3-oslo-rootwrap
|
||||
Requires: python3-oslo-serialization
|
||||
Requires: python3-oslo-service
|
||||
Requires: python3-oslo-upgradecheck
|
||||
Requires: python3-oslo-utils
|
||||
Requires: python3-oslo-versionedobjects
|
||||
Requires: python3-osprofiler
|
||||
Requires: python3-pbr
|
||||
Requires: python3-pecan
|
||||
Requires: python3-psutil
|
||||
Requires: python3-pysendfile
|
||||
Requires: python3-pysnmp
|
||||
Requires: python3-pytz
|
||||
Requires: python3-requests
|
||||
Requires: python3-retrying
|
||||
Requires: python3-rfc3986
|
||||
Requires: python3-stevedore
|
||||
Requires: python3-swiftclient
|
||||
Requires: python3-tooz
|
||||
Requires: sudo
|
||||
|
||||
%description -n python3-ironic
|
||||
This package contains the core code of OpenStack Ironic.
|
||||
|
||||
%if 0%{?with_doc}
|
||||
%package doc
|
||||
Summary: OpenStack bare metal provisioning service (ironic) - Documentation
|
||||
Group: Documentation/HTML
|
||||
BuildRequires: python3-sphinx
|
||||
BuildRequires: python3-openstackdocstheme
|
||||
BuildRequires: python3-sphinxcontrib-apidoc
|
||||
BuildRequires: python3-sphinxcontrib-httpdomain
|
||||
BuildRequires: python3-sphinxcontrib-pecanwsme
|
||||
BuildRequires: python3-sphinxcontrib-seqdiag
|
||||
BuildRequires: python3-sphinxcontrib-rsvgconverter
|
||||
|
||||
%description doc
|
||||
OpenStack bare metal provisioning service.
|
||||
This package contains the Documentation.
|
||||
%endif
|
||||
|
||||
%package api
|
||||
Summary: OpenStack Ironic - API
|
||||
Group: System/Management
|
||||
Requires: openstack-ironic = %{epoch}:%{version}-%{release}
|
||||
|
||||
%description api
|
||||
This package contains the OpenStack Ironic API Daemon.
|
||||
|
||||
%package conductor
|
||||
Summary: OpenStack Ironic - Conductor
|
||||
Group: System/Management
|
||||
Requires: openstack-ironic = %{epoch}:%{version}-%{release}
|
||||
|
||||
%description conductor
|
||||
This package contains the OpenStack Ironic Conductor Manager Daemon.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n ironic-16.0.4.dev3
|
||||
%py_req_cleanup
|
||||
|
||||
%build
|
||||
%{py3_build}
|
||||
|
||||
%if 0%{?with_doc}
|
||||
PYTHONPATH=. PBR_VERSION=16.0.4.dev3 %sphinx_build --keep-going -b html doc/source doc/build/html
|
||||
PYTHONPATH=. PBR_VERSION=16.0.4.dev3 %sphinx_build --keep-going -b man doc/source doc/build/man
|
||||
# remove the Sphinx-build leftovers
|
||||
rm -rf doc/build/html/.{doctrees,buildinfo}
|
||||
rm -rf doc/build/man/.{doctrees,buildinfo}
|
||||
%endif
|
||||
|
||||
%install
|
||||
%{py3_install}
|
||||
|
||||
### Setup directories
|
||||
install -d -m 750 %{buildroot}%{_localstatedir}/{lib,log,cache}/ironic
|
||||
install -d -m 755 %{buildroot}%{_sysconfdir}/ironic
|
||||
install -d -m 755 %{buildroot}%{_sysconfdir}/ironic/ironic.conf.d/
|
||||
install -d -m 700 %{buildroot}%{_localstatedir}/run/ironic
|
||||
|
||||
### Install configuration files
|
||||
install -D -m 644 %{SOURCE3} %{buildroot}/%_tmpfilesdir/ironic.conf
|
||||
install -p -D -m 640 %{SOURCE4} %{buildroot}%{_sysconfdir}/ironic/ironic.conf.d/010-ironic.conf
|
||||
mv %{buildroot}%{_prefix}%{_sysconfdir}/ironic/* %{buildroot}%{_sysconfdir}/ironic/
|
||||
cp -a etc/ironic/rootwrap.d/ %{buildroot}%{_sysconfdir}/ironic/
|
||||
install -p -D -m 640 %{SOURCE5} %{buildroot}%{_sysconfdir}/ironic/README.config
|
||||
|
||||
### Install systemd service files
|
||||
install -p -D -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}-api.service
|
||||
install -p -D -m 644 %{SOURCE7} %{buildroot}%{_unitdir}/%{name}-conductor.service
|
||||
|
||||
### install symlinks on SUSE
|
||||
%if 0%{?suse_version}
|
||||
mkdir -p %{buildroot}%{_sbindir}
|
||||
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-api
|
||||
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-conductor
|
||||
%endif
|
||||
|
||||
### sudoers configuration for ironic-rootwrap:
|
||||
install -D -m 440 %{SOURCE1} %{buildroot}%{_sysconfdir}/sudoers.d/openstack-ironic
|
||||
|
||||
### Install logrotate
|
||||
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-ironic
|
||||
|
||||
### man pages
|
||||
%if 0%{?with_doc}
|
||||
mkdir -p %{buildroot}%{_mandir}/man1
|
||||
install -p -D -m 644 doc/build/man/*.1 %{buildroot}%{_mandir}/man1/
|
||||
%endif
|
||||
|
||||
%check
|
||||
export LC_ALL=en_US.UTF-8
|
||||
python3 -m stestr.cli run
|
||||
|
||||
%pre
|
||||
%openstack_pre_user_group_create ironic ironic /sbin/nologin
|
||||
exit 0
|
||||
|
||||
%post
|
||||
%tmpfiles_create %{_tmpfilesdir}/ironic.conf
|
||||
|
||||
%post api
|
||||
%systemd_post %{name}-api.service
|
||||
|
||||
%preun api
|
||||
%systemd_preun %{name}-api.service
|
||||
|
||||
%postun api
|
||||
%systemd_postun %{name}-api.service
|
||||
|
||||
%post conductor
|
||||
%systemd_post %{name}-conductor.service
|
||||
|
||||
%preun conductor
|
||||
%systemd_preun %{name}-conductor.service
|
||||
|
||||
%postun conductor
|
||||
%systemd_postun %{name}-conductor.service
|
||||
|
||||
%files
|
||||
%doc README.rst
|
||||
%license LICENSE
|
||||
%dir %attr(0750, ironic, ironic) %{_localstatedir}/lib/ironic
|
||||
%dir %attr(0750, ironic, ironic) %{_localstatedir}/cache/ironic
|
||||
%dir %attr(0750, ironic, ironic) %{_localstatedir}/log/ironic
|
||||
%_tmpfilesdir/ironic.conf
|
||||
%dir %{_sysconfdir}/ironic
|
||||
%dir %{_sysconfdir}/ironic/ironic.conf.d/
|
||||
%{_sysconfdir}/ironic/README.config
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/openstack-ironic
|
||||
%config(noreplace) %{_sysconfdir}/sudoers.d/openstack-ironic
|
||||
%config(noreplace) %attr(0640, root, ironic) %{_sysconfdir}/ironic/ironic.conf.d/010-ironic.conf
|
||||
%config %{_sysconfdir}/ironic/rootwrap.conf
|
||||
%dir %{_sysconfdir}/ironic/rootwrap.d
|
||||
%config(noreplace) %{_sysconfdir}/ironic/rootwrap.d/ironic-utils.filters
|
||||
%{_bindir}/ironic-status
|
||||
%{_bindir}/ironic-rootwrap
|
||||
%{_bindir}/ironic-dbsync
|
||||
%if 0%{?with_doc}
|
||||
%{_mandir}/man1/ironic.1.gz
|
||||
%endif
|
||||
|
||||
%files -n python3-ironic
|
||||
%license LICENSE
|
||||
%{python3_sitelib}/ironic/
|
||||
%{python3_sitelib}/ironic-*.egg-info
|
||||
|
||||
%if 0%{?with_doc}
|
||||
%files doc
|
||||
%license LICENSE
|
||||
%doc doc/build/html
|
||||
%endif
|
||||
|
||||
%files api
|
||||
%license LICENSE
|
||||
%{_unitdir}/%{name}-api.service
|
||||
%if 0%{?suse_version}
|
||||
%{_sbindir}/rc%{name}-api
|
||||
%endif
|
||||
%{_bindir}/ironic-api
|
||||
%{_bindir}/ironic-api-wsgi
|
||||
|
||||
%files conductor
|
||||
%license LICENSE
|
||||
%{_unitdir}/%{name}-conductor.service
|
||||
%if 0%{?suse_version}
|
||||
%{_sbindir}/rc%{name}-conductor
|
||||
%endif
|
||||
%{_bindir}/ironic-conductor
|
||||
|
||||
%changelog
|
||||
* Mon Feb 08 2021 OpenStack rpm-packaging <huangtianhua223@gmail.com>
|
||||
- Package Spec generated
|
||||
2
openstack-ironic.sudoers
Normal file
2
openstack-ironic.sudoers
Normal file
@ -0,0 +1,2 @@
|
||||
Defaults:ironic syslog_goodpri=none, !pam_session
|
||||
ironic ALL = (root) NOPASSWD: /usr/bin/ironic-rootwrap /etc/ironic/rootwrap.conf *
|
||||
1
openstack-ironic.tmpfiles
Normal file
1
openstack-ironic.tmpfiles
Normal file
@ -0,0 +1 @@
|
||||
d /run/ironic 0700 ironic ironic -
|
||||
Loading…
x
Reference in New Issue
Block a user