From 2377479d9bcc305f26040fabcc1d26d7f8b01915 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Tue, 14 Mar 2017 11:18:09 +0000 Subject: [PATCH] Introduce userspace group_vars and host_vars This opens the door to using group_vars and host_vars in userspace, by allowing the user to define a ":" delimited list of folder that will then be used by a vars_plugin, and (maybe later) by the inventory. This can't override group_vars due to ansible precedence. We could technically have this override done by moving the group_vars into a different folder and adding it to these environment variables. Change-Id: Ib2cbb35c0a7bccd896fbe71c22eeb07188db99ee --- scripts/openstack-ansible.rc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/openstack-ansible.rc b/scripts/openstack-ansible.rc index b3bd1b315f..b5f3566b0c 100644 --- a/scripts/openstack-ansible.rc +++ b/scripts/openstack-ansible.rc @@ -28,6 +28,7 @@ export ANSIBLE_ACTION_PLUGINS="${ANSIBLE_ACTION_PLUGINS:-/etc/ansible/roles/plug export ANSIBLE_CALLBACK_PLUGINS="${ANSIBLE_CALLBACK_PLUGINS:-/etc/ansible/roles/plugins/callback}" export ANSIBLE_CALLBACK_WHITELIST="profile_tasks" export ANSIBLE_TEST_PLUGINS="${ANSIBLE_TEST_PLUGINS:-/etc/ansible/roles/plugins/test}" +export ANSIBLE_VARS_PLUGINS="${ANSIBLE_VARS_PLUGINS:-/etc/ansible/roles/plugins/vars_plugins}" export ANSIBLE_GATHERING="${ANSIBLE_GATHERING:-smart}" export ANSIBLE_GATHER_SUBSET="${ANSIBLE_GATHER_SUBSET:-network,hardware,virtual}" @@ -51,3 +52,9 @@ export ANSIBLE_STRATEGY_PLUGINS="${ANSIBLE_STRATEGY_PLUGINS:-/etc/ansible/roles/ export ANSIBLE_CONNECTION_PLUGINS="${ANSIBLE_CONNECTION_PLUGINS:-/etc/ansible/roles/plugins/connection}" export ANSIBLE_FORCE_HANDLERS="${ANSIBLE_FORCE_HANDLERS:-True}" +# Extra non-ansible default variables to use with vars_plugin. +# Allow the usage of userspace group_vars host_vars with user +# defined precedence until this behavior is merged in the +# inventory +export GROUP_VARS_PATH="${GROUP_VARS_PATH:-/etc/openstack_deploy/group_vars/}" +export HOST_VARS_PATH="${HOST_VARS_PATH:-/etc/openstack_deploy/host_vars/}"