Skip to content

forumla's map.jinja not found in jinja-template-files on salt-ssh #31531

@sgeisbacher

Description

@sgeisbacher

Expected Behavior

the forumla's file-generation by jinja-template should load map.jinja also on salt-ssh.
this formula works with salt minion state.highstate like a charm, but not with salt-ssh minion state.highstate

Actual Behavior

when performing a state.highstate via salt-ssh i get the following error-msg: (see bottom)

Steps to Reproduce Issue

  1. create a simple formula with map.jinja
  2. add file generation by jinja (file.managed: - source: salt://.../file.jinja - template: jinja) to this formula
  3. import the map.jinja to this file.jinja-template with {% from ... import ... %}
  4. try to provision this formula to a minion with salt-ssh --> you will get the error from above

Versions Report

Salt Version:
           Salt: 2015.8.7

Dependency Versions:
         Jinja2: 2.7.2
       M2Crypto: Not Installed
           Mako: 0.9.1
         PyYAML: 3.10
          PyZMQ: 14.0.1
         Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
           RAET: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.4
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 1.5
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
        libgit2: Not Installed
        libnacl: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.3.0
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
   python-gnupg: Not Installed
          smmap: 0.8.2
        timelib: Not Installed

System Versions:
           dist: Ubuntu 14.04 trusty
        machine: x86_64
        release: 3.13.0-71-generic
         system: Ubuntu 14.04 trusty

Relevant Logs, Configs, or States

Error-Message: `Unable to manage file: Jinja error: jinjatest/map.jinja
              Traceback (most recent call last):
                File "/tmp/.root_09032a_salt/salt/utils/templates.py", line 366, in render_jinja_tmpl
                  output = template.render(**decoded_context)
                File "/tmp/.root_09032a_salt/jinja2/environment.py", line 969, in render
                  return self.environment.handle_exception(exc_info, True)
                File "/tmp/.root_09032a_salt/jinja2/environment.py", line 742, in handle_exception
                  reraise(exc_type, exc_value, tb)
                File "<template>", line 1, in top-level template code
                File "/tmp/.root_09032a_salt/salt/utils/jinja.py", line 144, in get_source
                  raise TemplateNotFound(template)
              TemplateNotFound: jinjatest/map.jinja

              ; line 1

              ---
              {% from "jinjatest/map.jinja" import jinjatest with context %}    <======================

              hello {{ jinjatest.name }}
              you are {{ jinjatest.age }} old
              Traceback (most recent call last):
                File "/tmp/.root_09032a_salt/salt/utils/templates.py", line 366, in render_jinja_tmpl
              [...]`

here is the simple-test-formula:
salt-jinjatest.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Corerelates to code central or existential to SaltSalt-SSHbugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions