postinstall: Copy ceph ansible modules if present 30/2030/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 21 Nov 2019 08:48:48 +0000 (09:48 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 21 Nov 2019 08:52:47 +0000 (09:52 +0100)
ceph-ansible 3.1 (and newer) refactored the handling of ceph keys
by leveraging a new `ceph-key` ansible module.

To support the new ceph-ansible 3.1, we copy any ceph ansible modules
similar to the way we currently handle ceph roles.
This change is backwards compatible with the current ceph-ansible 3.0.

Signed-off-by: Alexandru Antone <Alexandru.Antone@enea.com>
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Change-Id: I41364261dd8f445ddedf9d07eaa2cadc9da90b5e

infra-ansible.spec

index 8cedac6..a3d8730 100644 (file)
@@ -15,7 +15,7 @@
 
 Name:           infra-ansible
 Version:        %{_version}
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Contains ansible playbook and roles for Akraino rec blueprint
 License:        %{_platform_licence}
 Source0:        %{name}-%{version}.tar.gz
@@ -153,6 +153,10 @@ cp systemd/sriov.sh %{buildroot}/opt/sriov
 for role in /usr/share/ceph-ansible/roles/*; do
   ln -sf $role /etc/ansible/roles/
 done
+mkdir -p /etc/ansible/roles/plugins/library
+for module in /usr/share/ceph-ansible/library/*.py*; do
+  ln -sf $module /etc/ansible/roles/plugins/library
+done
 systemctl enable sriov
 
 %preun