Salt - Need state to check pillar and perform a if/else check
It looks like you are on the right approach here, the issue seems to be one of debugging. I have found this jinja2 live templating engine to be helpful with debugging in the past.
In python (on which jinja is based) &quot;True&quot; is a keyword which is probably getting interpreted as a boolean data type. This would be in contrast to the string, integer, or floating point (decimal) data types which are a C/C++ concept that python inherits since it's interpreter is written in C. Python tries to be agnostic to data type and variables are not strongly typed. This appears to be a situation in which the lack of strong typing may be getting you into some hot water.
In your boolean logic in the &quot;if&quot; block says to only render the section if allow_httpd is a string - but it isn't! It's a boolean! This is likely the error. Instead, you may wish to try simply:
{% if allow_httpd %}
Make sure httpd service is running:
  service.enabled:
    - name: httpd

{% else %}

stop and disable httpd:
  service.dead:
    - name: httpd
    - enable: False

{% endif %}

I'd also recommend you remove your quotes in the pillar data if you use this approach.