title: How to get minion id from jinja script inside a salt state
body: <p>I need to apply a if-else logic based on a static minion id inside a state file. The target glob qualifies a whole bunch of servers, but I need to run a small piece of logic on a single server and run a bunch of common things on all of them. How can I do this?</p>
  
  <p>When I put this in a Jinja file, its errors:</p>
  
  <pre><code>{% import salt.config %}
  {% minion_opts = salt.config.minion_config('/etc/salt/minion') %}
  {% print(minion_opts['id']) %}
  {% if minion_opts['id'] == 'xyz.server': %}
  -- run the logic here
  ..
  ..
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>- Rendering SLS 'base:bin.test' failed: Jinja syntax error: expected token 'as', got 'end of statement block'; line 1  
  -  
  - ---  
  - {% import salt.config %}    &lt;======================  
  - {% minion_opts = salt.config.minion_config('/etc/salt/minion') %}  
  - {% print(minion_opts['id']) %}  
  </code></pre>
  
  <p>It probably goes without saying I am not a Saltstack expert by any means.</p>