ansible set_fact not accessible
<p>i have this ansible playbook</p>

<pre><code>- name: set var small
  set_fact:
    iops_price = 41538
    ram_price_id = 32438
    second_san_price_id = 32926
    os_price_id = 49061
  when: plan|lower == 'small'

- name: aa
  command: echo "{{iops_price}}"
</code></pre>

<p>it fails because it says iops_price is not defined, this is the output:</p>

<pre><code>TASK [set var small] ***********************************************************
task path: /home/hanna/proj/db2onc-deploy/db.yml:98
ok: [localhost] =&gt; {"ansible_facts": {"_raw_params": "iops_price = 41538  ram_price_id = 32438 second_san_price_id = 32926 os_price_id = 49061"}, "changed": false}

TASK [aa] **********************************************************************
task path: /home/hanna/proj/db2onc-deploy/db.yml:107
fatal: [localhost]: FAILED! =&gt; {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'iops_price' is undefined\n\nThe error appears to have been in '/home/hanna/proj/db2onc-deploy/db.yml': line 107, column 9, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n      - name: aa\n        ^ here\n"}
</code></pre>

<p>it turned out that the fact that i set is accessible via _raw_params, which is equivalent to </p>

<pre><code>_raw_params = "iops_price = 41538 ram_price_id = 32438 second_san
_price_id = 32926 os_price_id = 49061"
</code></pre>

<p>this is not what i wanted, i actually want to set those individual variables, anybody has any idea why this is happening?</p>