From 9be05cd7a0983fd123c908884e10792acc6dad5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Mon, 29 Feb 2016 10:33:35 +0900 Subject: [PATCH] Fix puppet modules in mixed src/pkg environments In mixed environments with puppet modules installed from source or from packages, we end up in a situation where puppet can't find part of the modules. Symlink modules to their expected location for both source and package installs. Change-Id: I3e99feab5a2fff33cc4285197bdd5d00245d0999 --- .../puppet-modules-package-install/75-puppet-modules-package | 5 +++++ .../puppet-modules-source-install/75-puppet-modules-source | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/elements/puppet-modules/install.d/puppet-modules-package-install/75-puppet-modules-package b/elements/puppet-modules/install.d/puppet-modules-package-install/75-puppet-modules-package index c99e30f1..9d02441b 100755 --- a/elements/puppet-modules/install.d/puppet-modules-package-install/75-puppet-modules-package +++ b/elements/puppet-modules/install.d/puppet-modules-package-install/75-puppet-modules-package @@ -2,4 +2,9 @@ set -eux +# Symlink modules to the expected location. +# Modules installed from package take precedence. +if (find /opt/stack/puppet-modules/ -mindepth 1 2>/dev/null) | read; then + ln -f -s /opt/stack/puppet-modules/* /etc/puppet/modules/ +fi ln -f -s /usr/share/openstack-puppet/modules/* /etc/puppet/modules/ diff --git a/elements/puppet-modules/install.d/puppet-modules-source-install/75-puppet-modules-source b/elements/puppet-modules/install.d/puppet-modules-source-install/75-puppet-modules-source index 0e255bc6..f6ed02f7 100755 --- a/elements/puppet-modules/install.d/puppet-modules-source-install/75-puppet-modules-source +++ b/elements/puppet-modules/install.d/puppet-modules-source-install/75-puppet-modules-source @@ -1,4 +1,9 @@ #!/bin/bash set -eux +# Symlink modules to the expected location. +# Modules installed from source take precedence. +if (find /usr/share/openstack-puppet/modules/ -mindepth 1 2>/dev/null) | read; then + ln -f -s /usr/share/openstack-puppet/modules/* /etc/puppet/modules/ +fi ln -f -s /opt/stack/puppet-modules/* /etc/puppet/modules/