You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
381 lines
11 KiB
381 lines
11 KiB
4 years ago
|
%global numcomm @numcomm@
|
||
|
%global alphatag @alphatag@
|
||
|
%global dirty @dirty@
|
||
|
|
||
7 years ago
|
%define debug_package %{nil}
|
||
7 years ago
|
%define anviluser admin
|
||
|
%define anvilgroup admin
|
||
4 years ago
|
|
||
7 years ago
|
Name: anvil
|
||
4 years ago
|
Version: @version@
|
||
|
Release: 1%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
|
||
7 years ago
|
Summary: Alteeve Anvil! complete package.
|
||
|
|
||
|
License: GPLv2+
|
||
4 years ago
|
URL: https://github.com/ClusterLabs/anvil
|
||
4 years ago
|
Source0: %{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}.tar.gz
|
||
7 years ago
|
BuildArch: noarch
|
||
|
|
||
4 years ago
|
# required to detect paths to:
|
||
|
# systemd unit files
|
||
|
BuildRequires: systemd
|
||
|
# fence-agents binaries
|
||
|
BuildRequires: fence-agents-common
|
||
|
# OCFROOT
|
||
|
BuildRequires: resource-agents
|
||
7 years ago
|
|
||
|
%description
|
||
|
This package generates the anvil-core, anvil-striker, anvil-node and anvil-dr
|
||
|
RPM's. The 'core' RPM is common to all machines in an Anvil! cluster, with the
|
||
|
other three used for each machine, given its roll.
|
||
|
|
||
|
WARNING: This is an alpha-stage project. Many features are missing and this
|
||
|
should not be used for anything other than development purposes! The
|
||
|
first stable release will be 3.1. Anything 3.0 is UNSTABLE.
|
||
|
|
||
|
%package core
|
||
|
Summary: Alteeve's Anvil! Core package
|
||
|
Requires: bash-completion
|
||
4 years ago
|
Requires: binutils
|
||
5 years ago
|
Requires: chrony
|
||
4 years ago
|
Requires: cyrus-sasl
|
||
|
Requires: cyrus-sasl-gssapi
|
||
|
Requires: cyrus-sasl-lib
|
||
|
Requires: cyrus-sasl-md5
|
||
|
Requires: cyrus-sasl-plain
|
||
7 years ago
|
Requires: bind-utils
|
||
7 years ago
|
Requires: dmidecode
|
||
6 years ago
|
Requires: dnf-utils
|
||
6 years ago
|
Requires: expect
|
||
7 years ago
|
Requires: fence-agents-all
|
||
|
Requires: fence-agents-virsh
|
||
|
Requires: firewalld
|
||
4 years ago
|
Requires: freeipmi
|
||
7 years ago
|
Requires: gpm
|
||
6 years ago
|
Requires: hdparm
|
||
6 years ago
|
Requires: htop
|
||
6 years ago
|
Requires: iproute
|
||
4 years ago
|
Requires: kernel-core
|
||
|
Requires: kernel-devel
|
||
|
Requires: kernel-headers
|
||
6 years ago
|
Requires: lsscsi
|
||
5 years ago
|
Requires: mailx
|
||
7 years ago
|
Requires: mlocate
|
||
4 years ago
|
Requires: net-snmp-utils
|
||
4 years ago
|
Requires: nvme-cli
|
||
6 years ago
|
Requires: perl-Capture-Tiny
|
||
7 years ago
|
Requires: perl-Data-Dumper
|
||
5 years ago
|
Requires: perl-Data-Validate-Domain
|
||
5 years ago
|
Requires: perl-Data-Validate-IP
|
||
7 years ago
|
Requires: perl-DBD-Pg
|
||
7 years ago
|
Requires: perl-DBI
|
||
5 years ago
|
Requires: perl-Data-Validate-Domain
|
||
7 years ago
|
Requires: perl-Digest-SHA
|
||
6 years ago
|
Requires: perl-File-MimeInfo
|
||
6 years ago
|
Requires: perl-HTML-FromText
|
||
|
Requires: perl-HTML-Strip
|
||
6 years ago
|
Requires: perl-IO-Tty
|
||
7 years ago
|
Requires: perl-JSON
|
||
|
Requires: perl-Log-Journald
|
||
5 years ago
|
Requires: perl-Mail-RFC822-Address
|
||
5 years ago
|
Requires: perl-Net-Domain-TLD
|
||
7 years ago
|
Requires: perl-Net-SSH2
|
||
6 years ago
|
Requires: perl-Net-Netmask
|
||
6 years ago
|
Requires: perl-Net-OpenSSH
|
||
7 years ago
|
Requires: perl-NetAddr-IP
|
||
6 years ago
|
Requires: perl-Proc-Simple
|
||
7 years ago
|
Requires: perl-Sys-Syslog
|
||
4 years ago
|
Requires: perl-Sys-Virt
|
||
6 years ago
|
Requires: perl-Text-Diff
|
||
7 years ago
|
Requires: perl-Time-HiRes
|
||
6 years ago
|
Requires: perl-UUID-Tiny
|
||
5 years ago
|
Requires: perl-XML-LibXML
|
||
7 years ago
|
Requires: perl-XML-Simple
|
||
6 years ago
|
Requires: postfix
|
||
7 years ago
|
Requires: postgresql-contrib
|
||
|
Requires: postgresql-plperl
|
||
7 years ago
|
Requires: rsync
|
||
4 years ago
|
Requires: screen
|
||
4 years ago
|
Requires: smartmontools
|
||
6 years ago
|
Requires: syslinux
|
||
6 years ago
|
Requires: tmux
|
||
4 years ago
|
Requires: unzip
|
||
4 years ago
|
Requires: usbutils
|
||
7 years ago
|
Requires: vim
|
||
6 years ago
|
Requires: wget
|
||
7 years ago
|
# iptables-services conflicts with firewalld
|
||
|
Conflicts: iptables-services
|
||
|
# We handle interface naming
|
||
|
Conflicts: biosdevname
|
||
|
|
||
|
%description core
|
||
|
Common base libraries required for the Anvil! system.
|
||
|
|
||
|
|
||
|
%package striker
|
||
|
Summary: Alteeve's Anvil! Striker dashboard package
|
||
4 years ago
|
Requires: anvil-core == %{version}-%{release}
|
||
6 years ago
|
Requires: anvil-striker-extra
|
||
5 years ago
|
Requires: bpg-dejavu-sans-fonts
|
||
6 years ago
|
Requires: createrepo
|
||
5 years ago
|
Requires: dejavu-fonts-common
|
||
|
Requires: dejavu-sans-fonts
|
||
|
Requires: dejavu-sans-mono-fonts
|
||
|
Requires: dejavu-serif-fonts
|
||
6 years ago
|
Requires: dhcp-server
|
||
6 years ago
|
Requires: firefox
|
||
5 years ago
|
Requires: gcc
|
||
6 years ago
|
Requires: gdm
|
||
5 years ago
|
Requires: gnome-terminal
|
||
7 years ago
|
Requires: httpd
|
||
|
Requires: nmap
|
||
|
Requires: perl-CGI
|
||
7 years ago
|
Requires: postgresql-server
|
||
6 years ago
|
Requires: syslinux
|
||
6 years ago
|
Requires: syslinux-nonlinux
|
||
6 years ago
|
Requires: tftp-server
|
||
7 years ago
|
Requires: virt-manager
|
||
7 years ago
|
|
||
7 years ago
|
|
||
7 years ago
|
# A Striker dashboard is not allowed to host servers or be a migration target.
|
||
|
# So the node and dr packages can not be installed.
|
||
|
Conflicts: anvil-node
|
||
|
Conflicts: anvil-dr
|
||
|
%description striker
|
||
|
Web interface of the Striker dashboard for Alteeve Anvil! systems
|
||
|
|
||
7 years ago
|
NOTE: This installs and enables Gnome desktop.
|
||
7 years ago
|
|
||
7 years ago
|
%package node
|
||
7 years ago
|
Summary: Alteeve's Anvil! node package
|
||
4 years ago
|
Requires: anvil-core == %{version}-%{release}
|
||
6 years ago
|
Requires: drbd90-utils
|
||
|
Requires: kmod-drbd90
|
||
7 years ago
|
Requires: libvirt
|
||
|
Requires: libvirt-daemon
|
||
|
Requires: libvirt-daemon-driver-qemu
|
||
|
Requires: libvirt-daemon-kvm
|
||
|
Requires: libvirt-docs
|
||
7 years ago
|
Requires: pacemaker
|
||
7 years ago
|
Requires: pcs
|
||
|
Requires: qemu-kvm
|
||
7 years ago
|
Requires: qemu-kvm-core
|
||
7 years ago
|
Requires: virt-install
|
||
4 years ago
|
Requires: virt-top
|
||
7 years ago
|
# A node is allowed to host servers and be a live migration target. It is not
|
||
|
# allowed to host a database or be a DR host.
|
||
6 years ago
|
Conflicts: anvil-striker
|
||
|
Conflicts: anvil-dr
|
||
7 years ago
|
|
||
|
%description node
|
||
|
|
||
|
Provides support for active node in an Anvil! pair.
|
||
|
|
||
|
NOTE: On RHEL proper, this requires the node had the "High-Availability
|
||
|
Add-on".
|
||
|
|
||
|
NOTE: LINBIT customers must have access to the LINBIT repositories configured.
|
||
|
|
||
|
%package dr
|
||
|
Summary: Alteeve's Anvil! DR host package
|
||
4 years ago
|
Requires: anvil-core == %{version}-%{release}
|
||
6 years ago
|
Requires: drbd90-utils
|
||
|
Requires: kmod-drbd90
|
||
7 years ago
|
Requires: libvirt
|
||
|
Requires: libvirt-daemon
|
||
|
Requires: libvirt-daemon-driver-qemu
|
||
|
Requires: libvirt-daemon-kvm
|
||
|
Requires: libvirt-docs
|
||
|
Requires: qemu-kvm
|
||
7 years ago
|
Requires: qemu-kvm-core
|
||
7 years ago
|
Requires: virt-install
|
||
4 years ago
|
Requires: virt-top
|
||
7 years ago
|
# A DR host is not allowed to be a live-migration target or host a database.
|
||
|
Conflicts: anvil-striker
|
||
|
Conflicts: anvil-node
|
||
|
|
||
|
%description dr
|
||
|
|
||
|
Provides support for asynchronous disaster recovery hosts in an Anvil! cluster.
|
||
|
|
||
|
|
||
|
%prep
|
||
4 years ago
|
%autosetup -n %{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
|
||
7 years ago
|
|
||
|
%build
|
||
4 years ago
|
./autogen.sh
|
||
|
%{configure}
|
||
|
make %{_smp_mflags}
|
||
7 years ago
|
|
||
|
%install
|
||
4 years ago
|
rm -rf %{buildroot}
|
||
|
make install DESTDIR=%{buildroot}
|
||
7 years ago
|
|
||
7 years ago
|
%pre core
|
||
6 years ago
|
if [ ! -d /usr/share/anvil ];
|
||
|
then
|
||
|
mkdir /usr/share/anvil
|
||
|
fi
|
||
7 years ago
|
getent group %{anvilgroup} >/dev/null || groupadd -r %{anvilgroup}
|
||
|
getent passwd %{anviluser} >/dev/null || useradd --create-home \
|
||
|
--gid %{anvilgroup} --comment "Anvil! user account" %{anviluser}
|
||
|
|
||
7 years ago
|
%post core
|
||
7 years ago
|
# TODO: Remove this!! This is only for use during development, all SELinux
|
||
|
# issues must be resolved before final release!
|
||
7 years ago
|
echo "WARNING: Setting SELinux to 'permissive' during development."
|
||
7 years ago
|
sed -i.anvil 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
|
||
7 years ago
|
setenforce 0
|
||
6 years ago
|
# Enable and start the anvil-daemon
|
||
5 years ago
|
### TODO: check it if was disabled (if it existed before) and, if so, leave it disabled.
|
||
5 years ago
|
systemctl enable chronyd.service
|
||
|
systemctl start chronyd.service
|
||
6 years ago
|
systemctl enable anvil-daemon.service
|
||
5 years ago
|
systemctl restart anvil-daemon.service
|
||
6 years ago
|
|
||
7 years ago
|
|
||
|
%post striker
|
||
6 years ago
|
### NOTE: PostgreSQL is initialized and enabled by striker-prep-database later.
|
||
7 years ago
|
echo "Enabling and starting apache."
|
||
7 years ago
|
systemctl enable httpd.service
|
||
|
systemctl start httpd.service
|
||
7 years ago
|
restorecon -rv /%{_localstatedir}/www
|
||
7 years ago
|
if ! $(ls -l /etc/systemd/system/default.target | grep -q graphical);
|
||
|
then
|
||
|
echo "Seting graphical interface as default on boot."
|
||
|
systemctl set-default graphical.target
|
||
|
systemctl enable gdm.service
|
||
|
fi
|
||
|
|
||
7 years ago
|
echo "Preparing the database"
|
||
6 years ago
|
striker-prep-database
|
||
7 years ago
|
anvil-update-states
|
||
7 years ago
|
|
||
5 years ago
|
# Touch the system type file.
|
||
|
echo "Touching the system type file"
|
||
|
if [ -e '/etc/anvil/type.node' ]
|
||
|
then
|
||
|
rm -f /etc/anvil/type.node
|
||
|
elif [ -e '/etc/anvil/type.dr' ]
|
||
|
then
|
||
|
rm -f /etc/anvil/type.dr
|
||
|
fi
|
||
5 years ago
|
touch /etc/anvil/type.striker
|
||
5 years ago
|
|
||
|
|
||
6 years ago
|
### TODO: I don't think we need this anymore
|
||
7 years ago
|
# Open access for Striker. The database will be opened after initial setup.
|
||
7 years ago
|
echo "Opening the web and postgresql ports."
|
||
7 years ago
|
firewall-cmd --add-service=http
|
||
|
firewall-cmd --add-service=http --permanent
|
||
|
firewall-cmd --add-service=https
|
||
|
firewall-cmd --add-service=https --permanent
|
||
|
firewall-cmd --add-service=postgresql
|
||
|
firewall-cmd --add-service=postgresql --permanent
|
||
7 years ago
|
|
||
6 years ago
|
%pre node
|
||
|
|
||
5 years ago
|
|
||
|
%post node
|
||
|
# Touch the system type file.
|
||
|
echo "Touching the system type file"
|
||
5 years ago
|
if [ -e '/etc/anvil/type.striker' ]
|
||
5 years ago
|
then
|
||
5 years ago
|
rm -f /etc/anvil/type.striker
|
||
5 years ago
|
elif [ -e '/etc/anvil/type.dr' ]
|
||
|
then
|
||
|
rm -f /etc/anvil/type.dr
|
||
|
fi
|
||
|
touch /etc/anvil/type.node
|
||
|
|
||
|
|
||
|
%pre dr
|
||
|
|
||
|
|
||
|
%post dr
|
||
|
# Touch the system type file.
|
||
|
echo "Touching the system type file"
|
||
5 years ago
|
if [ -e '/etc/anvil/type.striker' ]
|
||
5 years ago
|
then
|
||
5 years ago
|
rm -f /etc/anvil/type.striker
|
||
5 years ago
|
elif [ -e '/etc/anvil/type.node' ]
|
||
|
then
|
||
|
rm -f /etc/anvil/type.node
|
||
|
fi
|
||
|
touch /etc/anvil/type.dr
|
||
|
|
||
6 years ago
|
### Remove stuff - Disabled for now, messes things up during upgrades
|
||
7 years ago
|
%postun core
|
||
6 years ago
|
## This is breaking on upgrades - (note: switch back to single percent sign
|
||
|
## when re-enabling)
|
||
|
#getent passwd %%{anviluser} >/dev/null && userdel %%{anviluser}
|
||
|
#getent group %%{anvilgroup} >/dev/null && groupdel %%{anvilgroup}
|
||
|
# echo "NOTE: Re-enabling SELinux."
|
||
|
# sed -i.anvil 's/SELINUX=permissive/SELINUX=enforcing/' /etc/selinux/config
|
||
|
# setenforce 1
|
||
7 years ago
|
|
||
|
%postun striker
|
||
6 years ago
|
### TODO: Stopping postgres breaks the Anvil! during OS updates. Need to find a
|
||
|
### way to run this only during uninstalls, and not during updates.
|
||
7 years ago
|
### TODO: This breaks the repos
|
||
6 years ago
|
# rm -rf /usr/share/anvil
|
||
|
# echo "Closing the postgresql ports."
|
||
7 years ago
|
#firewall-cmd --zone=public --remove-service=http
|
||
|
#firewall-cmd --zone=public --remove-service=http --permanent
|
||
6 years ago
|
# firewall-cmd --zone=public --remove-service=postgresql
|
||
|
# firewall-cmd --zone=public --remove-service=postgresql --permanent
|
||
|
# echo "Disabling and stopping postgresql-9.6."
|
||
7 years ago
|
# systemctl disable httpd.service
|
||
|
# systemctl stop httpd.service
|
||
6 years ago
|
# systemctl disable postgresql.service
|
||
|
# systemctl stop postgresql.service
|
||
7 years ago
|
|
||
5 years ago
|
# Remove the system type file.
|
||
5 years ago
|
if [ -e '/etc/anvil/type.striker' ]
|
||
5 years ago
|
then
|
||
5 years ago
|
rm -f /etc/anvil/type.striker
|
||
5 years ago
|
fi
|
||
|
|
||
|
%postun node
|
||
|
# Remove the system type file.
|
||
|
if [ -e '/etc/anvil/type.node' ]
|
||
|
then
|
||
|
rm -f /etc/anvil/type.node
|
||
|
fi
|
||
|
|
||
|
%postun dr
|
||
|
# Remove the system type file.
|
||
|
if [ -e '/etc/anvil/type.dr' ]
|
||
|
then
|
||
|
rm -f /etc/anvil/type.dr
|
||
|
fi
|
||
|
|
||
7 years ago
|
|
||
7 years ago
|
%files core
|
||
|
%doc README.md notes
|
||
|
%config(noreplace) %{_sysconfdir}/anvil/anvil.conf
|
||
|
%{_usr}/lib/*
|
||
4 years ago
|
%config(noreplace) %{_datadir}/anvil/anvil.sql
|
||
|
%{_usr}/share/anvil/firewall.txt
|
||
|
%{_usr}/share/anvil/words.xml
|
||
7 years ago
|
%{_sbindir}/*
|
||
|
%{_sysconfdir}/anvil/anvil.version
|
||
|
%{_datadir}/perl5/*
|
||
4 years ago
|
%{_mandir}/*
|
||
7 years ago
|
|
||
|
%files striker
|
||
4 years ago
|
%{_localstatedir}/www/*/*
|
||
7 years ago
|
%ghost %{_sysconfdir}/anvil/snmp-vendors.txt
|
||
|
|
||
|
%files node
|
||
5 years ago
|
%{_usr}/lib/ocf/resource.d/alteeve/server
|
||
7 years ago
|
|
||
|
%files dr
|
||
|
#<placeholder for node specific files>
|
||
|
|
||
|
|
||
|
%changelog
|
||
4 years ago
|
* @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
|
||
|
- Autotools generated version.
|
||
|
- These aren't the droids you're looking for.
|