{"action":"opened","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/31849","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/31849/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/31849/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/31849/events","html_url":"https://github.com/saltstack/salt/issues/31849","id":140422223,"number":31849,"title":"Custom extension module not loaded by orchestrate runner","user":{"login":"rhansen","id":1612291,"avatar_url":"https://avatars.githubusercontent.com/u/1612291?v=3","gravatar_id":"","url":"https://api.github.com/users/rhansen","html_url":"https://github.com/rhansen","followers_url":"https://api.github.com/users/rhansen/followers","following_url":"https://api.github.com/users/rhansen/following{/other_user}","gists_url":"https://api.github.com/users/rhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/rhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhansen/subscriptions","organizations_url":"https://api.github.com/users/rhansen/orgs","repos_url":"https://api.github.com/users/rhansen/repos","events_url":"https://api.github.com/users/rhansen/events{/privacy}","received_events_url":"https://api.github.com/users/rhansen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-12T22:22:27Z","updated_at":"2016-03-12T22:22:27Z","closed_at":null,"body":"### Description of Issue\r\n\r\nI have a custom execution module in my master's `module_dirs` directory, but that execution module does not appear to be loaded by the orchestrate runner.  This causes `salt-run` to print an error:\r\n\r\n    [ERROR   ] Rendering exception occurred: Jinja variable 'salt.utils.templates.AliasedLoader object' has no attribute 'roles'\r\n    [ERROR   ] Pillar rendering failed for minion saltmaster_master:\r\n    Traceback (most recent call last):\r\n      File \"/usr/lib/python2.7/dist-packages/salt/pillar/__init__.py\", line 313, in get_tops\r\n        _pillar_rend=True\r\n      File \"/usr/lib/python2.7/dist-packages/salt/template.py\", line 95, in compile_template\r\n        ret = render(input_data, saltenv, sls, **render_kwargs)\r\n      File \"/usr/lib/python2.7/dist-packages/salt/renderers/jinja.py\", line 333, in render\r\n        **kws)\r\n      File \"/usr/lib/python2.7/dist-packages/salt/utils/templates.py\", line 178, in render_tmpl\r\n        output = render_str(tmplstr, context, tmplpath)\r\n      File \"/usr/lib/python2.7/dist-packages/salt/utils/templates.py\", line 384, in render_jinja_tmpl\r\n        buf=tmplstr)\r\n    SaltRenderError: Jinja variable 'salt.utils.templates.AliasedLoader object' has no attribute 'roles'\r\n    [CRITICAL] Pillar render error: Rendering Primary Top file failed, render error:\r\n    Jinja variable 'salt.utils.templates.AliasedLoader object' has no attribute 'roles'\r\n\r\nThis issue seems similar to #30296 but I'm not sure.\r\n\r\n### Setup\r\n\r\nThe master is configured as follows:\r\n\r\n  * `/etc/salt/master`:\r\n\r\n    ```yaml\r\n    file_roots:\r\n      base:\r\n        - /salt/base/states\r\n    pillar_roots:\r\n      base:\r\n        - /salt/base/pillar\r\n    module_dirs:\r\n      - salt/modules\r\n    ```\r\n\r\n  * `/salt/modules/modules/roles.py` is a symlink to `/salt/base/states/_modules/roles.py`\r\n\r\n  * `/salt/base/states/_modules/roles.py`:\r\n\r\n    ```python\r\n    def get(id):\r\n        if id == 'foo':\r\n            return ('webserver',)\r\n        return ()\r\n    ```\r\n\r\n  * `/salt/base/pillar/top.sls`:\r\n\r\n    ```yaml\r\n    base:\r\n      '*':\r\n        - stuff\r\n    {% if 'webserver' in salt.roles.get(grains.id) %}\r\n        - webserver\r\n    {% endif %}\r\n    ```\r\n\r\n  * `/salt/base/states/orchestrate/init.sls`:\r\n\r\n    ```yaml\r\n    highstate_everything:\r\n      salt.state:\r\n        - tgt: '*'\r\n        - highstate: True\r\n    ```\r\n\r\n### Steps to Reproduce Issue\r\n\r\nConfigure as described above and run:\r\n\r\n    sudo salt-run state.orchestrate orchestrate\r\n\r\n### Versions Report\r\n\r\n```\r\nSalt Version:\r\n           Salt: 2015.8.7\r\n \r\nDependency Versions:\r\n         Jinja2: 2.7.2\r\n       M2Crypto: Not Installed\r\n           Mako: 0.9.1\r\n         PyYAML: 3.10\r\n          PyZMQ: 14.4.0\r\n         Python: 2.7.6 (default, Jun 22 2015, 17:58:13)\r\n           RAET: Not Installed\r\n        Tornado: 4.2.1\r\n            ZMQ: 4.0.4\r\n           cffi: Not Installed\r\n       cherrypy: Not Installed\r\n       dateutil: 1.5\r\n          gitdb: 0.5.4\r\n      gitpython: 0.3.2 RC1\r\n          ioflo: Not Installed\r\n        libgit2: Not Installed\r\n        libnacl: Not Installed\r\n   msgpack-pure: Not Installed\r\n msgpack-python: 0.3.0\r\n   mysql-python: 1.2.3\r\n      pycparser: Not Installed\r\n       pycrypto: 2.6.1\r\n         pygit2: Not Installed\r\n   python-gnupg: Not Installed\r\n          smmap: 0.8.2\r\n        timelib: Not Installed\r\n \r\nSystem Versions:\r\n           dist: Ubuntu 14.04 trusty\r\n        machine: x86_64\r\n        release: 4.2.0-30-generic\r\n         system: Ubuntu 14.04 trusty\r\n```\r\n"}}