Add opensuse spec file

Add rpm specfile and changes file for Open build service (OBS) to
use with the _service file

Testing with OBS is complete and works correctly with the %post

Story: 2006508
Task: 36782
Change-Id: I3460dd8c542b594bbf6bc2b1ad854b85db951021
Signed-off-by: Saul Wold <sgw@linux.intel.com>
This commit is contained in:
Saul Wold 2019-09-24 10:13:55 -07:00
parent c0e884264a
commit a5e5b2970c
2 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,4 @@
-------------------------------------------------------------------
Fri Jun 7 20:50:52 UTC 2019 - sgw@linux.intel.com
- Initial Commit

View File

@ -0,0 +1,55 @@
Name: playbookconfig
Version: 1.0.0
Release: %{tis_patch_ver}%{?_tis_dist}
Summary: Ansible Playbooks for StarlingX Configurations
Group: Development/Tools/Other
License: Apache-2.0
URL: https://opendev.org/starlingx/config
Source0: %{name}-%{version}.tar.gz
Requires: ansible
Requires: python
Requires: python-netaddr
Requires: python2-ptyprocess
Requires: python2-pexpect
Requires: sshpass
Requires: sysinv
BuildArch: noarch
%description
This package contains playbooks used for configuring StarlingX.
%define local_stx_ansible_dir %{_datadir}/ansible/stx-ansible
%define local_etc_ansible %{_sysconfdir}/ansible
%define debug_package %{nil}
%prep
%setup -q -n %{name}-%{version}/src
%build
%install
make install DESTDIR=%{buildroot}%{local_stx_ansible_dir}
chmod 755 %{buildroot}%{local_stx_ansible_dir}/playbooks/roles/bootstrap/persist-config/files/populate_initial_config.py
chmod 755 %{buildroot}%{local_stx_ansible_dir}/playbooks/roles/bootstrap/prepare-env/files/check_root_disk_size.py
chmod 755 %{buildroot}%{local_stx_ansible_dir}/playbooks/roles/backup/backup-system/files/fm_alarm.py
%post
mkdir -p %{local_etc_ansible}
cp %{local_stx_ansible_dir}/playbooks/ansible.cfg %{local_etc_ansible}
cp %{local_stx_ansible_dir}/playbooks/hosts %{local_etc_ansible}
chmod 644 %{local_etc_ansible}/ansible.cfg
chmod 644 %{local_etc_ansible}/hosts
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc LICENSE
%dir %{_datadir}/ansible
%dir %{local_stx_ansible_dir}
%{local_stx_ansible_dir}/*