mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Make ansible.utils a package
This commit is contained in:
parent
4c156e4df8
commit
000d3832cc
3 changed files with 2 additions and 17 deletions
|
@ -23,7 +23,7 @@ import optparse
|
||||||
import operator
|
import operator
|
||||||
from ansible import errors
|
from ansible import errors
|
||||||
from ansible import __version__
|
from ansible import __version__
|
||||||
from ansible import template as ans_template
|
from ansible.utils.template import *
|
||||||
import ansible.constants as C
|
import ansible.constants as C
|
||||||
import time
|
import time
|
||||||
import StringIO
|
import StringIO
|
||||||
|
@ -216,22 +216,6 @@ def parse_json(raw_data):
|
||||||
return { "failed" : True, "parsed" : False, "msg" : orig_data }
|
return { "failed" : True, "parsed" : False, "msg" : orig_data }
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def varReplace(raw, vars, depth=0, expand_lists=False):
|
|
||||||
''' Perform variable replacement of $variables in string raw using vars dictionary '''
|
|
||||||
return ans_template.varReplace(raw, vars, depth=depth, expand_lists=expand_lists)
|
|
||||||
|
|
||||||
def varReplaceWithItems(basedir, varname, vars):
|
|
||||||
''' helper function used by with_items '''
|
|
||||||
return ans_template.varReplaceWithItems(basedir, varname, vars)
|
|
||||||
|
|
||||||
def template(basedir, text, vars, expand_lists=False):
|
|
||||||
''' run a text buffer through the templating engine until it no longer changes '''
|
|
||||||
return ans_template.template(basedir, text, vars, expand_lists=expand_lists)
|
|
||||||
|
|
||||||
def template_from_file(basedir, path, vars):
|
|
||||||
''' run a file through the templating engine '''
|
|
||||||
return ans_template.template_from_file(basedir, path, vars)
|
|
||||||
|
|
||||||
def parse_yaml(data):
|
def parse_yaml(data):
|
||||||
''' convert a yaml string to a data structure '''
|
''' convert a yaml string to a data structure '''
|
||||||
return yaml.load(data)
|
return yaml.load(data)
|
1
setup.py
1
setup.py
|
@ -25,6 +25,7 @@ setup(name='ansible',
|
||||||
package_dir={ 'ansible': 'lib/ansible' },
|
package_dir={ 'ansible': 'lib/ansible' },
|
||||||
packages=[
|
packages=[
|
||||||
'ansible',
|
'ansible',
|
||||||
|
'ansible.utils',
|
||||||
'ansible.inventory',
|
'ansible.inventory',
|
||||||
'ansible.inventory.vars_plugins',
|
'ansible.inventory.vars_plugins',
|
||||||
'ansible.playbook',
|
'ansible.playbook',
|
||||||
|
|
Loading…
Reference in a new issue