From a5e5b2970c1a41ba8181516c5191265f74f30aed Mon Sep 17 00:00:00 2001 From: Saul Wold Date: Tue, 24 Sep 2019 10:13:55 -0700 Subject: [PATCH] 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 --- .../opensuse/playbookconfig.changes | 4 ++ playbookconfig/opensuse/playbookconfig.spec | 55 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 playbookconfig/opensuse/playbookconfig.changes create mode 100644 playbookconfig/opensuse/playbookconfig.spec diff --git a/playbookconfig/opensuse/playbookconfig.changes b/playbookconfig/opensuse/playbookconfig.changes new file mode 100644 index 000000000..9a411432b --- /dev/null +++ b/playbookconfig/opensuse/playbookconfig.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Fri Jun 7 20:50:52 UTC 2019 - sgw@linux.intel.com + +- Initial Commit diff --git a/playbookconfig/opensuse/playbookconfig.spec b/playbookconfig/opensuse/playbookconfig.spec new file mode 100644 index 000000000..75efa969b --- /dev/null +++ b/playbookconfig/opensuse/playbookconfig.spec @@ -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}/*