diff options
author | Scott Dodson <sdodson@redhat.com> | 2016-05-17 17:49:54 -0400 |
---|---|---|
committer | Scott Dodson <sdodson@redhat.com> | 2016-05-18 12:05:06 -0400 |
commit | 30aee039e00ba3ea8393416263ee6922f3c09f35 (patch) | |
tree | 47eedf511ba025548fa9ed4a4d7567ac385d827c /openshift-ansible.spec | |
parent | 1826e93bcf2ba21f0c1c7368dffd091a8bfbf142 (diff) | |
download | openshift-30aee039e00ba3ea8393416263ee6922f3c09f35.tar.gz openshift-30aee039e00ba3ea8393416263ee6922f3c09f35.tar.bz2 openshift-30aee039e00ba3ea8393416263ee6922f3c09f35.tar.xz openshift-30aee039e00ba3ea8393416263ee6922f3c09f35.zip |
Fix playbooks/openshift-master/library move to symlink
Diffstat (limited to 'openshift-ansible.spec')
-rw-r--r-- | openshift-ansible.spec | 24 |
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} |