PageRenderTime 22ms CodeModel.GetById 12ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/lib/ansible/inventory/vars_plugins/noop.py

https://github.com/ajanthanm/ansible
Python | 48 lines | 10 code | 12 blank | 26 comment | 0 complexity | 44e2eb7fef6c1fef4edf92133b3cfbd4 MD5 | raw file
 1# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
 2# (c) 2014, Serge van Ginderachter <serge@vanginderachter.be>
 3#
 4# This file is part of Ansible
 5#
 6# Ansible is free software: you can redistribute it and/or modify
 7# it under the terms of the GNU General Public License as published by
 8# the Free Software Foundation, either version 3 of the License, or
 9# (at your option) any later version.
10#
11# Ansible is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
18
19class VarsModule(object):
20
21    """
22    Loads variables for groups and/or hosts
23    """
24
25    def __init__(self, inventory):
26
27        """ constructor """
28
29        self.inventory = inventory
30        self.inventory_basedir = inventory.basedir()
31
32
33    def run(self, host, vault_password=None):
34        """ For backwards compatibility, when only vars per host were retrieved
35            This method should return both host specific vars as well as vars
36            calculated from groups it is a member of """
37        return {}
38
39
40    def get_host_vars(self, host, vault_password=None):
41        """ Get host specific variables. """
42        return {}
43
44
45    def get_group_vars(self, group, vault_password=None):
46        """ Get group specific variables. """
47        return {}
48