title: Using ansible facts as lists
body: <p>I'm debugging a set of nested plays that puts hosts in a Rackspace load balancer.</p>
  
  <pre><code>- include create_servers.yml
  ...
  - include add_to_load_balancers.yml
  </code></pre>
  
  <p>in the first play, I am using the <code>rax_clb</code> module to create the servers. We register the variable <code>rax</code> and use the <code>rax.success</code> list within it to add those hosts to a group in create_servers.yml:</p>
  
  <pre><code>- name: create instances on Rackspace
    local_action:
      module: rax
      image: "{{ IMAGE }}"
      flavor: "{{ FLAVOR }}"
      wait: yes 
      count: "{{ COUNT }}"
      ...
      register: rax
  
  
  - name: some other play
    local_action:
    ...
    with_items: rax.success
  
  
  - name: register rax.success as rax_servers for later use
    set_fact:
      rax_servers: rax.success
  </code></pre>
  
  <p>When using rax.success within the other play using <code>with_items</code>, it works. But later on when I try to use <code>rax_servers</code> in add_to_load_balancers.yml:</p>
  
  <pre><code>- name: place new hosts in the load balancer
    rax_clb_nodes:
      address={{ item.rax_accessipv4 }}
      state=present
      ...
    with_items: rax_servers
  </code></pre>
  
  <p>I get an error that there is no <code>rax_accessipv4</code> in item. I should, though, since this is how I use it in the previous play (and it works). So I print out <code>rax_servers</code>:</p>
  
  <pre><code>TASK: [debug var=rax_servers] ************************************************* 
  ok: [127.0.0.1] =&gt; {
      "var": {
          "rax_servers": "rax.success"
      }
  }
  </code></pre>
  
  <p>I'm obviously doing something wrong, but I can't seem to figure out from the documentation what I am doing wrong when either storing or referencing this variable. Both plays are run from and on localhost, so it should be giving me the same list, no?</p>
  
  <p>Thanks for bearing with this newbie, any help is appreciated :)</p>