From 4fd760467b479045e5d0cb08a724e3831b46d3c8 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 29 Jan 2015 13:28:33 -0500 Subject: [PATCH 1/2] made inventory consistent in config file, deprecated old config hostfile --- examples/ansible.cfg | 2 +- lib/ansible/constants.py | 2 +- v2/ansible/constants.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/ansible.cfg b/examples/ansible.cfg index 150c7262351..cfcc9464b59 100644 --- a/examples/ansible.cfg +++ b/examples/ansible.cfg @@ -11,7 +11,7 @@ # some basic default values... -hostfile = /etc/ansible/hosts +inventory = /etc/ansible/hosts #library = /usr/share/my_modules/ remote_tmp = $HOME/.ansible/tmp pattern = * diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index 861dd5325c1..d397221fe57 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -98,7 +98,7 @@ YAML_FILENAME_EXTENSIONS = [ "", ".yml", ".yaml", ".json" ] DEFAULTS='defaults' # configurable things -DEFAULT_HOST_LIST = shell_expand_path(get_config(p, DEFAULTS, 'hostfile', 'ANSIBLE_HOSTS', '/etc/ansible/hosts')) +DEFAULT_HOST_LIST = shell_expand_path(get_config(p, DEFAULTS, 'inventory', 'ANSIBLE_HOSTS', get_config(p, DEFAULTS,'hostfile',None, '/etc/ansible/hosts'))) DEFAULT_MODULE_PATH = get_config(p, DEFAULTS, 'library', 'ANSIBLE_LIBRARY', None) DEFAULT_ROLES_PATH = shell_expand_path(get_config(p, DEFAULTS, 'roles_path', 'ANSIBLE_ROLES_PATH', '/etc/ansible/roles')) DEFAULT_REMOTE_TMP = get_config(p, DEFAULTS, 'remote_tmp', 'ANSIBLE_REMOTE_TEMP', '$HOME/.ansible/tmp') diff --git a/v2/ansible/constants.py b/v2/ansible/constants.py index 6adcdd0a9f7..d199cdf1091 100644 --- a/v2/ansible/constants.py +++ b/v2/ansible/constants.py @@ -105,7 +105,7 @@ DEFAULTS='defaults' # configurable things DEFAULT_DEBUG = get_config(p, DEFAULTS, 'debug', 'ANSIBLE_DEBUG', False, boolean=True) -DEFAULT_HOST_LIST = shell_expand_path(get_config(p, DEFAULTS, 'hostfile', 'ANSIBLE_HOSTS', '/etc/ansible/hosts')) +DEFAULT_HOST_LIST = shell_expand_path(get_config(p, DEFAULTS, 'inventory', 'ANSIBLE_HOSTS', get_config(p, DEFAULTS,'hostfile',None, '/etc/ansible/hosts'))) DEFAULT_MODULE_PATH = get_config(p, DEFAULTS, 'library', 'ANSIBLE_LIBRARY', None) DEFAULT_ROLES_PATH = shell_expand_path(get_config(p, DEFAULTS, 'roles_path', 'ANSIBLE_ROLES_PATH', '/etc/ansible/roles')) DEFAULT_REMOTE_TMP = get_config(p, DEFAULTS, 'remote_tmp', 'ANSIBLE_REMOTE_TEMP', '$HOME/.ansible/tmp') From c73254543a9fc66bf2a22f978c6e979ae361221c Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 29 Jan 2015 13:32:00 -0500 Subject: [PATCH 2/2] made env var also consistent --- lib/ansible/constants.py | 2 +- v2/ansible/constants.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index d397221fe57..01b33ea94c2 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -98,7 +98,7 @@ YAML_FILENAME_EXTENSIONS = [ "", ".yml", ".yaml", ".json" ] DEFAULTS='defaults' # configurable things -DEFAULT_HOST_LIST = shell_expand_path(get_config(p, DEFAULTS, 'inventory', 'ANSIBLE_HOSTS', get_config(p, DEFAULTS,'hostfile',None, '/etc/ansible/hosts'))) +DEFAULT_HOST_LIST = shell_expand_path(get_config(p, DEFAULTS, 'inventory', 'ANSIBLE_INVENTORY', get_config(p, DEFAULTS,'hostfile','ANSIBLE_HOSTS', '/etc/ansible/hosts'))) DEFAULT_MODULE_PATH = get_config(p, DEFAULTS, 'library', 'ANSIBLE_LIBRARY', None) DEFAULT_ROLES_PATH = shell_expand_path(get_config(p, DEFAULTS, 'roles_path', 'ANSIBLE_ROLES_PATH', '/etc/ansible/roles')) DEFAULT_REMOTE_TMP = get_config(p, DEFAULTS, 'remote_tmp', 'ANSIBLE_REMOTE_TEMP', '$HOME/.ansible/tmp') diff --git a/v2/ansible/constants.py b/v2/ansible/constants.py index d199cdf1091..1c2bc092b23 100644 --- a/v2/ansible/constants.py +++ b/v2/ansible/constants.py @@ -105,7 +105,7 @@ DEFAULTS='defaults' # configurable things DEFAULT_DEBUG = get_config(p, DEFAULTS, 'debug', 'ANSIBLE_DEBUG', False, boolean=True) -DEFAULT_HOST_LIST = shell_expand_path(get_config(p, DEFAULTS, 'inventory', 'ANSIBLE_HOSTS', get_config(p, DEFAULTS,'hostfile',None, '/etc/ansible/hosts'))) +DEFAULT_HOST_LIST = shell_expand_path(get_config(p, DEFAULTS, 'inventory', 'ANSIBLE_INVENTORY', get_config(p, DEFAULTS,'hostfile','ANSIBLE_HOSTS', '/etc/ansible/hosts'))) DEFAULT_MODULE_PATH = get_config(p, DEFAULTS, 'library', 'ANSIBLE_LIBRARY', None) DEFAULT_ROLES_PATH = shell_expand_path(get_config(p, DEFAULTS, 'roles_path', 'ANSIBLE_ROLES_PATH', '/etc/ansible/roles')) DEFAULT_REMOTE_TMP = get_config(p, DEFAULTS, 'remote_tmp', 'ANSIBLE_REMOTE_TEMP', '$HOME/.ansible/tmp')