{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/41568","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/41568/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/41568/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/41568/events","html_url":"https://github.com/saltstack/salt/issues/41568","id":233298605,"number":41568,"title":"No way to securely identify minion for targeting in pillar template context","user":{"login":"mikemol","id":13550,"avatar_url":"https://avatars1.githubusercontent.com/u/13550?v=3","gravatar_id":"","url":"https://api.github.com/users/mikemol","html_url":"https://github.com/mikemol","followers_url":"https://api.github.com/users/mikemol/followers","following_url":"https://api.github.com/users/mikemol/following{/other_user}","gists_url":"https://api.github.com/users/mikemol/gists{/gist_id}","starred_url":"https://api.github.com/users/mikemol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikemol/subscriptions","organizations_url":"https://api.github.com/users/mikemol/orgs","repos_url":"https://api.github.com/users/mikemol/repos","events_url":"https://api.github.com/users/mikemol/events{/privacy}","received_events_url":"https://api.github.com/users/mikemol/received_events","type":"User","site_admin":false},"labels":[{"id":48088732,"url":"https://api.github.com/repos/saltstack/salt/labels/Question","name":"Question","color":"942192","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/37","html_url":"https://github.com/saltstack/salt/milestone/37","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/37/labels","id":343741,"number":37,"title":"Blocked","description":"Issues which are blocked in some way, whether they need further discussion, clarification, justification, or are blocked for some other reason.","creator":{"login":"basepi","id":702318,"avatar_url":"https://avatars1.githubusercontent.com/u/702318?v=3","gravatar_id":"","url":"https://api.github.com/users/basepi","html_url":"https://github.com/basepi","followers_url":"https://api.github.com/users/basepi/followers","following_url":"https://api.github.com/users/basepi/following{/other_user}","gists_url":"https://api.github.com/users/basepi/gists{/gist_id}","starred_url":"https://api.github.com/users/basepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basepi/subscriptions","organizations_url":"https://api.github.com/users/basepi/orgs","repos_url":"https://api.github.com/users/basepi/repos","events_url":"https://api.github.com/users/basepi/events{/privacy}","received_events_url":"https://api.github.com/users/basepi/received_events","type":"User","site_admin":false},"open_issues":866,"closed_issues":1436,"state":"open","created_at":"2013-05-28T22:24:12Z","updated_at":"2017-06-02T23:46:58Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2017-06-02T20:58:54Z","updated_at":"2017-06-02T23:57:49Z","closed_at":null,"body":"### Description of Issue/Question\r\n\r\nI found this SLS file in a pillar `top.sls` targeting example:\r\n\r\n`top.sls`:\r\n\r\n    base:\r\n      '*':\r\n        - hostspecificsls\r\n\r\n`hostspecificsls`:\r\n\r\n    # See https://groups.google.com/forum/#!topic/salt-users/UWfP6bMe6F8\r\n    {% include 'hosts/' + salt['grains.get']('fqdn') + '.sls' ignore missing %}\r\n\r\nThe goal, obviously, is to provide optional host-specific pillar data if the host-specific pillar data exists. If a minion's FQDN is a.example.com, then `hosts/a.example.com` will be included in the minion's pillar data, but only if `hosts/a.example.com` exists.\r\n\r\nTrouble is, this runs counter to one of the Best Practices: Don't target sensitive pillar data using grains.\r\n\r\nNow, for _my_ use case, I could get away with grabbing the minion ID and checking that, except there doesn't appear to be any way (outside of grains, again) to grab the minion ID.\r\n\r\n### Versions Report\r\n\r\n    $ salt --versions-report\r\n    Salt Version:\r\n               Salt: 2016.11.5\r\n     \r\n    Dependency Versions:\r\n               cffi: Not Installed\r\n           cherrypy: Not Installed\r\n           dateutil: Not Installed\r\n          docker-py: Not Installed\r\n              gitdb: Not Installed\r\n          gitpython: Not Installed\r\n              ioflo: Not Installed\r\n             Jinja2: 2.7.2\r\n            libgit2: Not Installed\r\n            libnacl: Not Installed\r\n           M2Crypto: 0.21.1\r\n               Mako: Not Installed\r\n       msgpack-pure: Not Installed\r\n     msgpack-python: 0.4.8\r\n       mysql-python: Not Installed\r\n          pycparser: Not Installed\r\n           pycrypto: 2.6.1\r\n       pycryptodome: 3.4.3\r\n             pygit2: Not Installed\r\n             Python: 2.7.5 (default, Nov  6 2016, 00:28:07)\r\n       python-gnupg: Not Installed\r\n             PyYAML: 3.11\r\n              PyZMQ: 15.3.0\r\n               RAET: Not Installed\r\n              smmap: Not Installed\r\n            timelib: Not Installed\r\n            Tornado: 4.2.1\r\n                ZMQ: 4.1.4\r\n     \r\n    System Versions:\r\n               dist: centos 7.3.1611 Core\r\n            machine: x86_64\r\n            release: 3.10.0-514.10.2.el7.x86_64\r\n             system: Linux\r\n            version: CentOS Linux 7.3.1611 Core\r\n     \r\n    \r\n"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/305934247","html_url":"https://github.com/saltstack/salt/issues/41568#issuecomment-305934247","issue_url":"https://api.github.com/repos/saltstack/salt/issues/41568","id":305934247,"user":{"login":"mikemol","id":13550,"avatar_url":"https://avatars1.githubusercontent.com/u/13550?v=3","gravatar_id":"","url":"https://api.github.com/users/mikemol","html_url":"https://github.com/mikemol","followers_url":"https://api.github.com/users/mikemol/followers","following_url":"https://api.github.com/users/mikemol/following{/other_user}","gists_url":"https://api.github.com/users/mikemol/gists{/gist_id}","starred_url":"https://api.github.com/users/mikemol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikemol/subscriptions","organizations_url":"https://api.github.com/users/mikemol/orgs","repos_url":"https://api.github.com/users/mikemol/repos","events_url":"https://api.github.com/users/mikemol/events{/privacy}","received_events_url":"https://api.github.com/users/mikemol/received_events","type":"User","site_admin":false},"created_at":"2017-06-02T23:57:49Z","updated_at":"2017-06-02T23:57:49Z","body":"Is this documented anywhere but this ticket? Where is it in the source? I\ncouldn't find it there, either.\n\nOn Fri, Jun 2, 2017, 7:46 PM Daniel Wallace <notifications@github.com>\nwrote:\n\n> you should have {{minion_id}} available in the pillar file. Which will be\n> the minion id that that pillar information will be sent to.\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/saltstack/salt/issues/41568#issuecomment-305933133>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AAA07obmeIqMGY-AlgY9nLCFuovBglr2ks5sAJ7ngaJpZM4Nuxu->\n> .\n>\n"}}
{"actor":{"display_login":"mikemol"}}