Instead of having to specify this separately for every
guest due to minor differences in the environment, figure
it out at login time by asking Perl itself for the
information we need.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/group_vars/all/main.yml | 1 -
guests/host_vars/libvirt-centos-6/main.yml | 1 -
guests/host_vars/libvirt-centos-7/main.yml | 1 -
guests/host_vars/libvirt-debian-8/main.yml | 1 -
guests/host_vars/libvirt-debian-9/main.yml | 1 -
guests/host_vars/libvirt-debian-sid/main.yml | 1 -
guests/host_vars/libvirt-fedora-27/main.yml | 1 -
guests/host_vars/libvirt-fedora-28/main.yml | 1 -
guests/host_vars/libvirt-fedora-rawhide/main.yml | 1 -
guests/host_vars/libvirt-freebsd-10/main.yml | 1 -
guests/host_vars/libvirt-freebsd-11/main.yml | 1 -
guests/host_vars/libvirt-freebsd-current/main.yml | 1 -
guests/host_vars/libvirt-ubuntu-14/main.yml | 1 -
guests/host_vars/libvirt-ubuntu-16/main.yml | 1 -
guests/host_vars/libvirt-ubuntu-18/main.yml | 1 -
guests/templates/bashrc.j2 | 6 +++++-
16 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/guests/group_vars/all/main.yml b/guests/group_vars/all/main.yml
index cd8ef25..840c80b 100644
--- a/guests/group_vars/all/main.yml
+++ b/guests/group_vars/all/main.yml
@@ -16,5 +16,4 @@ PKG_CONFIG_PATH: $VIRT_PREFIX/lib/pkgconfig
XDG_DATA_DIRS: $VIRT_PREFIX/share:/usr/share:/usr/local/share
GI_TYPELIB_PATH: $VIRT_PREFIX/lib/girepository-1.0
OSINFO_SYSTEM_DIR: $VIRT_PREFIX/share/osinfo
-PERL5LIB:
PYTHONPATH:
diff --git a/guests/host_vars/libvirt-centos-6/main.yml
b/guests/host_vars/libvirt-centos-6/main.yml
index 8b18c19..c27c1ad 100644
--- a/guests/host_vars/libvirt-centos-6/main.yml
+++ b/guests/host_vars/libvirt-centos-6/main.yml
@@ -1,5 +1,4 @@
---
-PERL5LIB: $VIRT_PREFIX/lib/perl5/x86_64-linux-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib64/python2.6/site-packages
projects:
diff --git a/guests/host_vars/libvirt-centos-7/main.yml
b/guests/host_vars/libvirt-centos-7/main.yml
index 8f88615..6cb8995 100644
--- a/guests/host_vars/libvirt-centos-7/main.yml
+++ b/guests/host_vars/libvirt-centos-7/main.yml
@@ -1,5 +1,4 @@
---
-PERL5LIB: $VIRT_PREFIX/lib/perl5/x86_64-linux-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib64/python2.7/site-packages
projects:
diff --git a/guests/host_vars/libvirt-debian-8/main.yml
b/guests/host_vars/libvirt-debian-8/main.yml
index d0b3601..64f3255 100644
--- a/guests/host_vars/libvirt-debian-8/main.yml
+++ b/guests/host_vars/libvirt-debian-8/main.yml
@@ -1,5 +1,4 @@
---
-PERL5LIB: $VIRT_PREFIX/lib/perl5/x86_64-linux-gnu-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib/python3.4/site-packages
projects:
diff --git a/guests/host_vars/libvirt-debian-9/main.yml
b/guests/host_vars/libvirt-debian-9/main.yml
index caf513e..04d5132 100644
--- a/guests/host_vars/libvirt-debian-9/main.yml
+++ b/guests/host_vars/libvirt-debian-9/main.yml
@@ -1,5 +1,4 @@
---
-PERL5LIB: $VIRT_PREFIX/lib/perl5/x86_64-linux-gnu-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib/python3.5/site-packages
projects:
diff --git a/guests/host_vars/libvirt-debian-sid/main.yml
b/guests/host_vars/libvirt-debian-sid/main.yml
index 88b8b9b..cbf57aa 100644
--- a/guests/host_vars/libvirt-debian-sid/main.yml
+++ b/guests/host_vars/libvirt-debian-sid/main.yml
@@ -1,5 +1,4 @@
---
-PERL5LIB: $VIRT_PREFIX/lib/perl5/x86_64-linux-gnu-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages
projects:
diff --git a/guests/host_vars/libvirt-fedora-27/main.yml
b/guests/host_vars/libvirt-fedora-27/main.yml
index 20d90c5..9ed392b 100644
--- a/guests/host_vars/libvirt-fedora-27/main.yml
+++ b/guests/host_vars/libvirt-fedora-27/main.yml
@@ -1,5 +1,4 @@
---
-PERL5LIB: $VIRT_PREFIX/lib/perl5/x86_64-linux-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib64/python3.6/site-packages
projects:
diff --git a/guests/host_vars/libvirt-fedora-28/main.yml
b/guests/host_vars/libvirt-fedora-28/main.yml
index 20d90c5..9ed392b 100644
--- a/guests/host_vars/libvirt-fedora-28/main.yml
+++ b/guests/host_vars/libvirt-fedora-28/main.yml
@@ -1,5 +1,4 @@
---
-PERL5LIB: $VIRT_PREFIX/lib/perl5/x86_64-linux-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib64/python3.6/site-packages
projects:
diff --git a/guests/host_vars/libvirt-fedora-rawhide/main.yml
b/guests/host_vars/libvirt-fedora-rawhide/main.yml
index 202eccf..91b4158 100644
--- a/guests/host_vars/libvirt-fedora-rawhide/main.yml
+++ b/guests/host_vars/libvirt-fedora-rawhide/main.yml
@@ -1,5 +1,4 @@
---
-PERL5LIB: $VIRT_PREFIX/lib/perl5/x86_64-linux-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib64/python3.6/site-packages
projects:
diff --git a/guests/host_vars/libvirt-freebsd-10/main.yml
b/guests/host_vars/libvirt-freebsd-10/main.yml
index ac5f12b..e37c845 100644
--- a/guests/host_vars/libvirt-freebsd-10/main.yml
+++ b/guests/host_vars/libvirt-freebsd-10/main.yml
@@ -1,7 +1,6 @@
---
ansible_python_interpreter: /usr/local/bin/python2
-PERL5LIB: $VIRT_PREFIX/lib/perl5/amd64-freebsd-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages
projects:
diff --git a/guests/host_vars/libvirt-freebsd-11/main.yml
b/guests/host_vars/libvirt-freebsd-11/main.yml
index ac5f12b..e37c845 100644
--- a/guests/host_vars/libvirt-freebsd-11/main.yml
+++ b/guests/host_vars/libvirt-freebsd-11/main.yml
@@ -1,7 +1,6 @@
---
ansible_python_interpreter: /usr/local/bin/python2
-PERL5LIB: $VIRT_PREFIX/lib/perl5/amd64-freebsd-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages
projects:
diff --git a/guests/host_vars/libvirt-freebsd-current/main.yml
b/guests/host_vars/libvirt-freebsd-current/main.yml
index ac5f12b..e37c845 100644
--- a/guests/host_vars/libvirt-freebsd-current/main.yml
+++ b/guests/host_vars/libvirt-freebsd-current/main.yml
@@ -1,7 +1,6 @@
---
ansible_python_interpreter: /usr/local/bin/python2
-PERL5LIB: $VIRT_PREFIX/lib/perl5/amd64-freebsd-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages
projects:
diff --git a/guests/host_vars/libvirt-ubuntu-14/main.yml
b/guests/host_vars/libvirt-ubuntu-14/main.yml
index fccd0ef..bfbdda6 100644
--- a/guests/host_vars/libvirt-ubuntu-14/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-14/main.yml
@@ -1,5 +1,4 @@
---
-PERL5LIB: $VIRT_PREFIX/lib/perl5/x86_64-linux-gnu-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib/python3.4/site-packages
projects:
diff --git a/guests/host_vars/libvirt-ubuntu-16/main.yml
b/guests/host_vars/libvirt-ubuntu-16/main.yml
index caf513e..04d5132 100644
--- a/guests/host_vars/libvirt-ubuntu-16/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-16/main.yml
@@ -1,5 +1,4 @@
---
-PERL5LIB: $VIRT_PREFIX/lib/perl5/x86_64-linux-gnu-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib/python3.5/site-packages
projects:
diff --git a/guests/host_vars/libvirt-ubuntu-18/main.yml
b/guests/host_vars/libvirt-ubuntu-18/main.yml
index 88b8b9b..cbf57aa 100644
--- a/guests/host_vars/libvirt-ubuntu-18/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-18/main.yml
@@ -1,5 +1,4 @@
---
-PERL5LIB: $VIRT_PREFIX/lib/perl5/x86_64-linux-gnu-thread-multi
PYTHONPATH: $VIRT_PREFIX/lib/python3.6/site-packages
projects:
diff --git a/guests/templates/bashrc.j2 b/guests/templates/bashrc.j2
index 866087e..cf2679e 100644
--- a/guests/templates/bashrc.j2
+++ b/guests/templates/bashrc.j2
@@ -8,12 +8,16 @@ export PKG_CONFIG_PATH="{{ PKG_CONFIG_PATH }}"
export XDG_DATA_DIRS="{{ XDG_DATA_DIRS }}"
export GI_TYPELIB_PATH="{{ GI_TYPELIB_PATH }}"
export OSINFO_SYSTEM_DIR="{{ OSINFO_SYSTEM_DIR }}"
-export PERL5LIB="{{ PERL5LIB }}"
export PYTHONPATH="{{ PYTHONPATH }}"
export MAKE="{{ make }}"
export PYTHON="{{ python }}"
+# We need to ask Perl for this information, since it's used to
+# construct installation paths
+plarch=$(perl -e 'use Config; print $Config{archname}')
+export PERL5LIB="$VIRT_PREFIX/lib/perl5/$plarch"
+
# Enable bash completion. Only needed on FreeBSD, the system-wide
# shell profile will take care of it for us everywhere else
bash_completion=/usr/local/share/bash-completion/bash_completion.sh
--
2.17.0