2

ansible 2.3.0.0 with python version 2.7.5

host_vars:

manager: Tom
asst_managers:
    - Gail
    - Susan
    - Larry

hotels:
   hotel1:
      address: 1113 Mockingbird ln
      rooms: 40
   hotel2:
      address: 2222 BlueJay Ln
      rooms: 20


task

- name: hot hotels
  template:
     src: hothotels.j2
     dest: /abc
  with_items: "{{ asst_manager }}"
  with_dict: "{{ hotels }}"

**ERROR! duplicate loop in task: items**   

template: hothotels.j2

"{{ manager }}"

assistant managers:
{% for asst in asst_managers %}
"{{ asst }}"

{% endfor %}

{% for (key,value) in hotels.iteritems(() %)
{{ item.key }}
address: {{ item.value.address }}
rooms: {{ item.value.address }}

{% endfor % }

if I run the task without "with_items" and the template with out the manager and asst manager info, it runs but hotel2 is in the file twice and hotel1 is it at all.

thanks

Bill Nolf
  • 21
  • 3

0 Answers0