2014-10-15 22:56:23 +00:00
|
|
|
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
|
|
|
|
#
|
|
|
|
# This file is part of Ansible
|
|
|
|
#
|
|
|
|
# Ansible is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# Ansible is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
#############################################
|
|
|
|
|
2014-10-15 23:22:54 +00:00
|
|
|
# Make coding more python3-ish
|
|
|
|
from __future__ import (absolute_import, division, print_function)
|
|
|
|
__metaclass__ = type
|
|
|
|
|
2014-11-03 22:30:14 +00:00
|
|
|
### List of things to change in Inventory
|
2014-11-07 22:01:29 +00:00
|
|
|
|
2014-11-03 22:30:14 +00:00
|
|
|
### Replace some lists with sets/frozensets.
|
|
|
|
### Check where this makes sense to reveal externally
|
2014-11-07 22:01:29 +00:00
|
|
|
|
2014-11-03 22:30:14 +00:00
|
|
|
### Rename all caches to *_cache
|
2014-11-07 22:01:29 +00:00
|
|
|
|
2014-11-03 22:30:14 +00:00
|
|
|
### Standardize how caches are flushed for all caches if possible
|
2014-11-07 22:01:29 +00:00
|
|
|
|
2014-11-03 22:30:14 +00:00
|
|
|
### Think about whether retrieving variables should be methods of the
|
|
|
|
### Groups/Hosts being queried with caches at that level
|
2014-11-07 22:01:29 +00:00
|
|
|
|
2014-11-03 22:30:14 +00:00
|
|
|
### Store things into a VarManager instead of inventory
|
2014-11-07 22:01:29 +00:00
|
|
|
|
2014-11-03 22:30:14 +00:00
|
|
|
### Merge list_hosts() and get_hosts()
|
|
|
|
### Merge list_groups() and groups_list()
|
|
|
|
### Merge get_variables() and get_host_variables()
|
2014-11-07 22:01:29 +00:00
|
|
|
|
2014-11-03 22:30:14 +00:00
|
|
|
### Restrictions:
|
|
|
|
### Remove get_restriction()
|
|
|
|
### Prefix restrict_to and lift_restriction with _ and note in docstring that
|
|
|
|
### only playbook is to use these for implementing failed hosts. This is
|
|
|
|
### the closest that python has to a "friend function"
|
|
|
|
### Can we get rid of restrictions altogether?
|
|
|
|
### If we must keep restrictions, reimplement as a stack of sets. Then
|
|
|
|
### calling code will push and pop restrictions onto the inventory
|
2014-11-07 22:01:29 +00:00
|
|
|
### (mpdehaan +1'd stack idea)
|
|
|
|
|
2014-11-03 22:30:14 +00:00
|
|
|
### is_file() and basedir() => Change to properties
|
2014-11-07 22:01:29 +00:00
|
|
|
|
2014-11-03 22:30:14 +00:00
|
|
|
### Can we move the playbook variable resolving to someplace else? Seems that:
|
|
|
|
### 1) It can change within a single session
|
|
|
|
### 2) Inventory shouldn't know about playbook.
|
|
|
|
### Possibilities:
|
|
|
|
### Host and groups read the host_vars and group_vars. Both inventory and
|
|
|
|
### playbook register paths that the hsot_vars and group_vars can read from.
|
|
|
|
### The VariableManager reads the host_vars and group_vars and keeps them
|
|
|
|
### layered depending on the context from which it's being asked what
|
|
|
|
### the value of a variable is
|
|
|
|
### Either of these results in getting rid of/moving to another class
|
|
|
|
### Inventory.playbook_basedir() and Inventory.set_playbook_basedir()
|
2014-11-07 22:01:29 +00:00
|
|
|
### mpdehaan: evaluate caching and make sure we're just caching once. (Toshio: tie
|
|
|
|
### this in with storing and retrieving variables via Host and Group objects
|
|
|
|
### mpdehaan: If it's possible, move templating entirely out of inventory
|
|
|
|
### (Toshio: If it's possible, implement this by storing inside of
|
|
|
|
### VariableManager which will handle resolving templated variables)
|
2014-11-03 22:30:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
### Questiony things:
|
|
|
|
### Do we want patterns to apply to both groups and hosts or only to hosts?
|
2014-11-07 22:01:29 +00:00
|
|
|
### jimi-c: Current code should do both as we're parsing things you can
|
|
|
|
### give to the -i commandline switch which can mix hosts and groups.
|
|
|
|
### like: `hosts: group1:group2&host3`
|
|
|
|
### toshio: should we move parsing the commandline out and then have that
|
|
|
|
### cli parser pass in a distinct list of hosts to add?
|
2014-11-03 22:30:14 +00:00
|
|
|
### Think about whether we could and want to go through the pattern_cache for
|
|
|
|
### standard lookups
|
|
|
|
### Is this the current architecture:
|
|
|
|
### We have a single Inventory per runner.
|
|
|
|
### The Inventory may be initialized via:
|
|
|
|
### an ini file
|
|
|
|
### a directory of ini files
|
|
|
|
### a script
|
|
|
|
### a , separated string of hosts
|
|
|
|
### a list of hosts
|
|
|
|
### host_vars/*
|
|
|
|
### group_vars/*
|
|
|
|
### Do we want to change this so that multiple sources are allowed?
|
|
|
|
### ansible -i /etc/ansible,./inventory,/opt/ansible/inventory_plugins/ec2.py,localhost
|
2014-11-07 22:01:29 +00:00
|
|
|
### jimi-c: We don't currently have multiple inventory sources explicitly
|
|
|
|
### allowed but you can specify an inventory directory and then have multiple
|
|
|
|
### sources inside of that.
|
|
|
|
### toshio: So do we want to make that available to people since we have to do it anyway?
|
|
|
|
### jimi-c: Also, what calls Inventory? TaskExecutor probably makes sense in v2
|
2014-11-03 22:30:14 +00:00
|
|
|
### What are vars_loaders? What's their scope? Why aren't the parsing of
|
|
|
|
### inventory files and scripts implemented as a vars_loader?
|
2014-11-07 22:01:29 +00:00
|
|
|
### jimi-c: vars_loaders are plugins to do additional variable loading.
|
|
|
|
### svg has some inhouse.
|
|
|
|
### Could theoretically rewrite the current loading to be handled by a plugin
|
2014-11-03 22:30:14 +00:00
|
|
|
### If we have add_group(), why no merge_group()?
|
|
|
|
### group = inven.get_group(name)
|
|
|
|
### if not group:
|
|
|
|
### group = Group(name)
|
|
|
|
### inven.add_group(group)
|
|
|
|
###
|
|
|
|
### vs
|
|
|
|
### group = Group(name)
|
|
|
|
### try:
|
|
|
|
### inven.add_group(group)
|
|
|
|
### except:
|
|
|
|
### inven.merge_group(group)
|
|
|
|
###
|
|
|
|
### vs:
|
|
|
|
### group = Group(name)
|
|
|
|
### inven.add_or_merge(group)
|
|
|
|
|
2014-11-18 03:36:35 +00:00
|
|
|
from .. plugins.inventory.aggregate import InventoryAggregateParser
|
|
|
|
from . group import Group
|
|
|
|
from . host import Host
|
|
|
|
|
2014-10-15 23:37:29 +00:00
|
|
|
class Inventory:
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
2014-11-18 03:36:35 +00:00
|
|
|
Create hosts and groups from inventory
|
|
|
|
|
|
|
|
Retrieve the hosts and groups that ansible knows about from this
|
|
|
|
class.
|
|
|
|
|
|
|
|
Retrieve raw variables (non-expanded) from the Group and Host classes
|
|
|
|
returned from here.
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
2014-11-18 03:36:35 +00:00
|
|
|
def __init__(self, inventory_list=C.DEFAULT_HOST_LIST, vault_password=None):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
2014-11-18 03:36:35 +00:00
|
|
|
:kwarg inventory_list: A list of inventory sources. This may be file
|
|
|
|
names which will be parsed as ini-like files, executable scripts
|
|
|
|
which return inventory data as json, directories of both of the above,
|
|
|
|
or hostnames. Files and directories are
|
2014-11-03 22:30:14 +00:00
|
|
|
:kwarg vault_password: Password to use if any of the inventory sources
|
|
|
|
are in an ansible vault
|
|
|
|
'''
|
2014-11-18 03:36:35 +00:00
|
|
|
self.vault_password = vault_password
|
|
|
|
|
|
|
|
self.parser = InventoryAggregateParser(inventory_list)
|
|
|
|
self.parser.parse()
|
|
|
|
self.hosts = self.parser.hosts
|
|
|
|
self.groups = self.parser.groups
|
|
|
|
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def get_hosts(self, pattern="all"):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Find all hosts matching a pattern string
|
|
|
|
|
|
|
|
This also takes into account any inventory restrictions or applied
|
|
|
|
subsets.
|
|
|
|
|
|
|
|
:kwarg pattern: An fnmatch pattern that hosts must match on. Multiple
|
|
|
|
patterns may be separated by ";" and ":". Defaults to the special
|
|
|
|
pattern "all" which means to return all hosts.
|
|
|
|
:returns: list of hosts
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def clear_pattern_cache(self):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Invalidate the pattern cache
|
|
|
|
'''
|
|
|
|
#### Possibly not needed?
|
|
|
|
# Former docstring:
|
|
|
|
# Called exclusively by the add_host plugin to allow patterns to be
|
|
|
|
# recalculated
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def groups_for_host(self, host):
|
2014-11-18 03:36:35 +00:00
|
|
|
### Remove in favour of
|
|
|
|
### inventory.hosts[host].groups.keys()
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Return the groupnames to which a host belongs
|
|
|
|
|
|
|
|
:arg host: Name of host to lookup
|
|
|
|
:returns: list of groupnames
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def groups_list(self):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Return a mapping of group name to hostnames which belong to the group
|
|
|
|
|
|
|
|
:returns: dict of groupnames mapped to a list of hostnames within that group
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def get_groups(self):
|
2014-11-18 03:36:35 +00:00
|
|
|
### Remove in favour of inventory.groups.values()
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Retrieve the Group objects known to the Inventory
|
|
|
|
|
|
|
|
:returns: list of :class:`Group`s belonging to the Inventory
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def get_host(self, hostname):
|
2014-11-18 03:36:35 +00:00
|
|
|
### Remove in favour of inventory.hosts.values()
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Retrieve the Host object for a hostname
|
|
|
|
|
|
|
|
:arg hostname: hostname associated with the :class:`Host`
|
|
|
|
:returns: :class:`Host` object whose hostname was requested
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def get_group(self, groupname):
|
2014-11-18 03:36:35 +00:00
|
|
|
### Revmoe in favour of inventory.groups.groupname
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Retrieve the Group object for a groupname
|
|
|
|
|
|
|
|
:arg groupname: groupname associated with the :class:`Group`
|
|
|
|
:returns: :class:`Group` object whose groupname was requested
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def get_group_variables(self, groupname, update_cached=False, vault_password=None):
|
2014-11-18 03:36:35 +00:00
|
|
|
### Remove in favour of inventory.groups[groupname].get_vars()
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Retrieve the variables set on a group
|
|
|
|
|
|
|
|
:arg groupname: groupname to retrieve variables for
|
|
|
|
:kwarg update_cached: if True, retrieve the variables from the source
|
|
|
|
and refresh the cache for this variable
|
|
|
|
:kwarg vault_password: Password to use if any of the inventory sources
|
|
|
|
are in an ansible vault
|
|
|
|
:returns: dict mapping group variable names to values
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def get_variables(self, hostname, update_cached=False, vault_password=None):
|
2014-11-18 03:36:35 +00:00
|
|
|
### Remove in favour of inventory.hosts[hostname].get_vars()
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Retrieve the variables set on a host
|
|
|
|
|
|
|
|
:arg hostname: hostname to retrieve variables for
|
|
|
|
:kwarg update_cached: if True, retrieve the variables from the source
|
|
|
|
and refresh the cache for this variable
|
|
|
|
:kwarg vault_password: Password to use if any of the inventory sources
|
|
|
|
are in an ansible vault
|
|
|
|
:returns: dict mapping host variable names to values
|
|
|
|
'''
|
|
|
|
### WARNING: v1 implementation ignores update_cached and vault_password
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def get_host_variables(self, hostname, update_cached=False, vault_password=None):
|
2014-11-18 03:36:35 +00:00
|
|
|
### Remove in favour of inventory.hosts[hostname].get_vars()
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Retrieve the variables set on a host
|
|
|
|
|
|
|
|
:arg hostname: hostname to retrieve variables for
|
|
|
|
:kwarg update_cached: if True, retrieve the variables from the source
|
|
|
|
and refresh the cache for this variable
|
|
|
|
:kwarg vault_password: Password to use if any of the inventory sources
|
|
|
|
are in an ansible vault
|
|
|
|
:returns: dict mapping host variable names to values
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def add_group(self, group):
|
2014-11-18 03:36:35 +00:00
|
|
|
### Possibly remove in favour of inventory.groups[groupname] = group
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Add a new group to the inventory
|
|
|
|
|
|
|
|
:arg group: Group object to add to the inventory
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def list_hosts(self, pattern="all"):
|
2014-11-18 03:36:35 +00:00
|
|
|
### Remove in favour of: inventory.hosts.keys()? Maybe not as pattern is here
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Retrieve a list of hostnames for a pattern
|
|
|
|
|
|
|
|
:kwarg pattern: Retrieve hosts which match this pattern. The special
|
|
|
|
pattern "all" matches every host the inventory knows about.
|
|
|
|
:returns: list of hostnames
|
|
|
|
'''
|
|
|
|
### Notes: Differences with get_hosts:
|
|
|
|
### get_hosts returns hosts, this returns host names
|
|
|
|
### This adds the implicit localhost/127.0.0.1 as a name but not as
|
|
|
|
### a host
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def list_groups(self):
|
2014-11-18 03:36:35 +00:00
|
|
|
### Remove in favour of: inventory.groups.keys()
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Retrieve list of groupnames
|
|
|
|
:returns: list of groupnames
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def get_restriction(self):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Accessor for the private _restriction attribute.
|
|
|
|
'''
|
|
|
|
### Note: In v1, says to be removed.
|
|
|
|
### Not used by anything at all.
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def restrict_to(self, restriction):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Restrict get and list operations to hosts given in the restriction
|
|
|
|
|
|
|
|
:arg restriction:
|
|
|
|
'''
|
|
|
|
### The v1 docstring says:
|
|
|
|
### Used by the main playbook code to exclude failed hosts, don't use
|
|
|
|
### this for other reasons
|
|
|
|
pass
|
|
|
|
|
|
|
|
def lift_restriction(self):
|
|
|
|
'''
|
|
|
|
Remove a restriction
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def also_restrict_to(self, restriction):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Restrict get and list operations to hosts in the additional restriction
|
|
|
|
'''
|
|
|
|
### Need to explore use case here -- maybe we want to restrict for
|
|
|
|
### several different reasons. Within a certain scope we restrict
|
|
|
|
### again for a separate reason?
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
|
|
|
def lift_also_restriction(self):
|
|
|
|
'''
|
|
|
|
Remove an also_restriction
|
|
|
|
'''
|
|
|
|
# HACK -- dead host skipping
|
|
|
|
pass
|
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def subset(self, subset_pattern):
|
2014-10-20 15:43:06 +00:00
|
|
|
"""
|
|
|
|
Limits inventory results to a subset of inventory that matches a given
|
2014-11-03 22:30:14 +00:00
|
|
|
pattern, such as to select a subset of a hosts selection that also
|
|
|
|
belongs to a certain geographic group or numeric slice.
|
2014-10-20 15:43:06 +00:00
|
|
|
Corresponds to --limit parameter to ansible-playbook
|
2014-11-03 22:30:14 +00:00
|
|
|
|
|
|
|
:arg subset_pattern: The pattern to limit with. If this is None it
|
|
|
|
clears the subset. Multiple patterns may be specified as a comma,
|
|
|
|
semicolon, or colon separated string.
|
2014-10-20 15:43:06 +00:00
|
|
|
"""
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def is_file(self):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Did inventory come from a file?
|
|
|
|
|
|
|
|
:returns: True if the inventory is file based, False otherwise
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def basedir(self):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
What directory was inventory read from
|
|
|
|
|
|
|
|
:returns: the path to the directory holding the inventory. None if
|
|
|
|
the inventory is not file based
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def src(self):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
What's the complete path to the inventory file?
|
|
|
|
|
|
|
|
:returns: Complete path to the inventory file. None if inventory is
|
|
|
|
not file-based
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def playbook_basedir(self):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Retrieve the directory of the current playbook
|
|
|
|
'''
|
|
|
|
### I want to move this out of inventory
|
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def set_playbook_basedir(self, dir):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Tell Inventory the basedir of the current playbook so Inventory can
|
|
|
|
look for host_vars and group_vars there.
|
|
|
|
'''
|
|
|
|
### I want to move this out of inventory
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def get_host_vars(self, host, new_pb_basedir=False):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Loads variables from host_vars/<hostname>
|
|
|
|
|
|
|
|
The variables are loaded from subdirectories located either in the
|
|
|
|
inventory base directory or the playbook base directory. Variables in
|
|
|
|
the playbook dir will win over the inventory dir if files are in both.
|
|
|
|
'''
|
2014-10-15 22:56:23 +00:00
|
|
|
pass
|
2014-11-03 22:30:14 +00:00
|
|
|
|
2014-10-15 22:56:23 +00:00
|
|
|
def get_group_vars(self, group, new_pb_basedir=False):
|
2014-11-03 22:30:14 +00:00
|
|
|
'''
|
|
|
|
Loads variables from group_vars/<hostname>
|
2014-10-15 22:56:23 +00:00
|
|
|
|
2014-11-03 22:30:14 +00:00
|
|
|
The variables are loaded from subdirectories located either in the
|
|
|
|
inventory base directory or the playbook base directory. Variables in
|
|
|
|
the playbook dir will win over the inventory dir if files are in both.
|
|
|
|
'''
|
|
|
|
pass
|