summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason DeTiberus <detiber@gmail.com>2016-05-18 12:29:39 -0400
committerJason DeTiberus <detiber@gmail.com>2016-05-18 12:29:39 -0400
commitb570313522ac1d47b56190c2f1fe4c2a9f54aad5 (patch)
treebd7106fe9648ef63b20d68152f138bd54804d176
parentcdf802ec89c46400896d94a7a1f426655b5a21db (diff)
parent30aee039e00ba3ea8393416263ee6922f3c09f35 (diff)
downloadopenshift-b570313522ac1d47b56190c2f1fe4c2a9f54aad5.tar.gz
openshift-b570313522ac1d47b56190c2f1fe4c2a9f54aad5.tar.bz2
openshift-b570313522ac1d47b56190c2f1fe4c2a9f54aad5.tar.xz
openshift-b570313522ac1d47b56190c2f1fe4c2a9f54aad5.zip
Merge pull request #1909 from sdodson/BZ1336647
Fix playbooks/openshift-master/library move to symlink
-rw-r--r--openshift-ansible.spec24
1 files changed, 23 insertions, 1 deletions
diff --git a/openshift-ansible.spec b/openshift-ansible.spec
index 68c57ab9c..8cf0a2059 100644
--- a/openshift-ansible.spec
+++ b/openshift-ansible.spec
@@ -38,6 +38,7 @@ popd
mkdir -p %{buildroot}%{_datadir}/%{name}
mkdir -p %{buildroot}%{_datadir}/ansible/%{name}
mkdir -p %{buildroot}%{_datadir}/ansible_plugins
+cp -rp library %{buildroot}%{_datadir}/ansible/%{name}/
# openshift-ansible-bin install
mkdir -p %{buildroot}%{_bindir}
@@ -78,6 +79,8 @@ popd
%files
%doc LICENSE.md README*
%dir %{_datadir}/ansible/%{name}
+%{_datadir}/ansible/%{name}/library
+%ghost %{_datadir}/ansible/%{name}/playbooks/common/openshift-master/library.rpmmoved
# ----------------------------------------------------------------------------------
# openshift-ansible-docs subpackage
@@ -110,11 +113,30 @@ BuildArch: noarch
%files playbooks
%{_datadir}/ansible/%{name}/playbooks
+# We moved playbooks/common/openshift-master/library up to the top and replaced
+# it with a symlink. RPM doesn't handle this so we have to do some pre-transaction
+# magic. See https://fedoraproject.org/wiki/Packaging:Directory_Replacement
+%pretrans playbooks -p <lua>
+-- Define the path to directory being replaced below.
+-- DO NOT add a trailing slash at the end.
+path = "/usr/share/ansible/openshift-ansible/playbooks/common/openshift-master/library"
+st = posix.stat(path)
+if st and st.type == "directory" then
+ status = os.rename(path, path .. ".rpmmoved")
+ if not status then
+ suffix = 0
+ while not status do
+ suffix = suffix + 1
+ status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
+ end
+ os.rename(path, path .. ".rpmmoved")
+ end
+end
+%package roles
# ----------------------------------------------------------------------------------
# openshift-ansible-roles subpackage
# ----------------------------------------------------------------------------------
-%package roles
Summary: Openshift and Atomic Enterprise Ansible roles
Requires: %{name} = %{version}
Requires: %{name}-lookup-plugins = %{version}