How do I know what desktop environment is being used with ansible?
<p>I have printed out the facts for the host with:</p>

<pre><code> - name: Display all variables/facts known for a host
   debug: var=hostvars[inventory_hostname]
</code></pre>

<p>How do I know what the desktop environment is?</p>

<p>The closest I found was:</p>

<pre><code>"COLORTERM": "gnome-terminal", 
</code></pre>

<p>I was using this condition</p>

<pre><code>ansible_env["SESSIONTYPE"] == "gnome-session"
</code></pre>

<p>But when running as <code>sudo</code> with <code>become</code> that fact is not present</p>