From ed293e95690399feef92a5539da7d2440ab4c572 Mon Sep 17 00:00:00 2001
From: Marc Gariepy <gariepy.marc@gmail.com>
Date: Tue, 11 Oct 2016 11:07:16 -0400
Subject: [PATCH] Add prefix vars to add options for lxc_build

Ansible doesn't have role scoped include_vars. Adding
lxc_hosts_pip_install_options for the pip install build on centos and
allow override with pip_install_options for other roles.

Change-Id: I78fb85d44b5b0e1643bd07af3e15462c02041c89
---
 tasks/lxc_install.yml | 2 +-
 vars/redhat-7.yml     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tasks/lxc_install.yml b/tasks/lxc_install.yml
index 0f441fec..d24b2cd7 100644
--- a/tasks/lxc_install.yml
+++ b/tasks/lxc_install.yml
@@ -31,7 +31,7 @@
   pip:
     name: "{{ lxc_pip_packages | join(' ') }}"
     state: latest
-    extra_args: "{{ pip_install_options|default('') }}"
+    extra_args: "{{ pip_install_options|default('') }} {{ lxc_hosts_pip_install_options|default('') }}"
   register: install_packages
   until: install_packages|success
   retries: 5
diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml
index ea650d77..ff5a13fd 100644
--- a/vars/redhat-7.yml
+++ b/vars/redhat-7.yml
@@ -83,7 +83,7 @@ lxc_cache_distro_packages:
   - wget
   - tar
 
-pip_install_options: >
+lxc_hosts_pip_install_options: >
   --global-option=build_ext
   --global-option="-L/opt/lxc_embedded/x86_64-linux-gnu/"
   --global-option="-I/opt/lxc_embedded/include/"