Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible-cmdb solaris fails #203

Open
kalsto opened this issue Aug 7, 2019 · 1 comment
Open

ansible-cmdb solaris fails #203

kalsto opened this issue Aug 7, 2019 · 1 comment
Labels
bug needs feedback Requires more feedback from the reporter

Comments

@kalsto
Copy link

kalsto commented Aug 7, 2019

tried ansible -i inventory test -m setup --tree out/ Which created the facts file on my one host that I'm trying it on, then ran the command below

ansible-cmdb --debug out/
data_dir = /usr/lib/python2.7/site-packages/ansiblecmdb/data
tpl_dir = /usr/lib/python2.7/site-packages/ansiblecmdb/data/tpl
static_dir = /usr/lib/python2.7/site-packages/ansiblecmdb/data/static
inventory files = ['hosts']
template params = {'exclude_columns': None, 'data_dir': '/usr/lib/python2.7/site-packages/ansiblecmdb/data', 'log': <logging.RootLogger object at 0xf9015c90>, 'lib_dir': '/usr/lib/python2.7/site-packages/ansiblecmdb/data', 'cust_cols': [], 'version': '1.30', 'columns': None}
Parsing fact dir: out/
Reading host facts from out/vns80
Determining type of inventory_path hosts
hosts is a file. Handle as static inventory file
Inventory path hosts is a file. Reading as inventory.
Parsing host vars (dir): host_vars
Parsing group vars (dir): group_vars
Reading group vars from group_vars/all.yml
Reading group vars from group_vars/oss-user.yml
Reading group vars from group_vars/solaris-oracle.yml
Reading group vars from group_vars/sol-hosts.yml
Reading group vars from group_vars/solaris-oss.yml
Whoops, it looks like something went wrong while rendering the template.

The reported error was: SyntaxException: (SyntaxError) unexpected EOF while parsing (, line 1) (u"r_dict(jsonxs(host, 'ansible_facts.ansible_local',") in file '/usr/lib/python2.7/site-packages/ansiblecmdb/data/tpl/html_fancy_defs.html' at line: 756 char: 5

The full error was:

Traceback (most recent call last):
  File "/usr/bin/../lib/ansiblecmdb/ansible-cmdb.py", line 216, in <module>
    output = renderer.render(ansible.get_hosts(), params)
  File "/usr/lib/python2.7/site-packages/ansiblecmdb/render.py", line 42, in render
    return self._render_mako(hosts, vars)
  File "/usr/lib/python2.7/site-packages/ansiblecmdb/render.py", line 59, in _render_mako
    return template.render(hosts=hosts, **vars)
  File "/usr/lib/python2.7/vendor-packages/mako/template.py", line 296, in render
    return runtime._render(self, self.callable_, args, data)
  File "/usr/lib/python2.7/vendor-packages/mako/runtime.py", line 660, in _render
    **_kwargs_for_callable(callable_, data))
  File "/usr/lib/python2.7/vendor-packages/mako/runtime.py", line 692, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/usr/lib/python2.7/vendor-packages/mako/runtime.py", line 718, in _exec_template
    callable_(context, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/ansiblecmdb/data/tpl/html_fancy.tpl", line 4, in render_body
    <%namespace name="defs" file="/html_fancy_defs.html" import="*" />
  File "/usr/lib/python2.7/site-packages/ansiblecmdb/data/tpl/html_fancy.tpl", line 2, in _mako_get_namespace
    <%! from ansiblecmdb.util import to_bool %>
  File "/usr/lib/python2.7/site-packages/ansiblecmdb/data/tpl/html_fancy.tpl", line 4, in _mako_generate_namespaces
    <%namespace name="defs" file="/html_fancy_defs.html" import="*" />
  File "/usr/lib/python2.7/vendor-packages/mako/runtime.py", line 403, in __init__
    calling_uri)
  File "/usr/lib/python2.7/vendor-packages/mako/runtime.py", line 626, in _lookup_template
    return lookup.get_template(uri)
  File "/usr/lib/python2.7/vendor-packages/mako/lookup.py", line 218, in get_template
    return self._load(srcfile, uri)
  File "/usr/lib/python2.7/vendor-packages/mako/lookup.py", line 283, in _load
    **self.template_args)
  File "/usr/lib/python2.7/vendor-packages/mako/template.py", line 218, in __init__
    module = self._compile_from_file(path, filename)
  File "/usr/lib/python2.7/vendor-packages/mako/template.py", line 262, in _compile_from_file
    filename)
  File "/usr/lib/python2.7/vendor-packages/mako/template.py", line 478, in _compile_text
    node = lexer.parse()
  File "/usr/lib/python2.7/vendor-packages/mako/lexer.py", line 209, in parse
    if self.match_expression():
  File "/usr/lib/python2.7/vendor-packages/mako/lexer.py", line 369, in match_expression
    lineno=line, pos=pos)
  File "/usr/lib/python2.7/vendor-packages/mako/lexer.py", line 125, in append_node
    node = nodecls(*args, **kwargs)
  File "/usr/lib/python2.7/vendor-packages/mako/parsetree.py", line 172, in __init__
    self.code = ast.PythonCode(text, **self.exception_kwargs)
  File "/usr/lib/python2.7/vendor-packages/mako/ast.py", line 34, in __init__
    expr = pyparser.parse(code.lstrip(), "exec", **exception_kwargs)
  File "/usr/lib/python2.7/vendor-packages/mako/pyparser.py", line 60, in parse
    ), **exception_kwargs)
SyntaxException: (SyntaxError) unexpected EOF while parsing (<unknown>, line 1) (u"r_dict(jsonxs(host, 'ansible_facts.ansible_local',") in file '/usr/lib/python2.7/site-packages/ansiblecmdb/data/tpl/html_fancy_defs.html' at line: 756 char: 5

The output is probably not correct.

You can report a bug on the issue tracker:

https://github.com/fboender/ansible-cmdb/issues

Please include the debugging output (-d switch) in the report!

If you can, also include the hosts file and the facts file for the last host
that rendered properly ('Rendering host...' in the output. If these files must
remain confidential, you can send them to [email protected] instead.

I can't add the facts file at this time

@fboender
Copy link
Owner

fboender commented Sep 5, 2021

Huh, weird. Just be be clear, you're not running ansible-cmdb itself on a Solaris host, right? It's just the facts come from an Solaris host?

Did you make any modifications to html_fancy_defs.html?

@fboender fboender added bug needs feedback Requires more feedback from the reporter labels Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs feedback Requires more feedback from the reporter
Projects
None yet
Development

No branches or pull requests

2 participants