Debian Codegraph @

lib/ansible/plugins/vars/__init__.py

raw
1 # (c) 2012-2014, Michael DeHaan <[email protected]>
2 # (c) 2014, Serge van Ginderachter <[email protected]>
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 from __future__ import annotations
19
20 from ansible.plugins import AnsiblePlugin
21 from ansible.utils.path import basedir
22 from ansible.utils.display import Display
23
24 display = Display()
25
26
27 class BaseVarsPlugin(AnsiblePlugin):
28
29 """
30 Loads variables for groups and/or hosts
31 """
32 is_stateless = False
33
34 def __init__(self):
35 """ constructor """
36 super(BaseVarsPlugin, self).__init__()
37 self._display = display
38
39 def get_vars(self, loader, path, entities):
40 """ Gets variables. """
41 self._basedir = basedir(path)