I need to do multiple tasks over one list. So, I created tasks list and
include it in the main playbook.
However, it looks like ansible doesn't recognise the tasks list as tasks list, but as playbook:
ERROR! 'set_fact' is not a valid attribute for a Play
main playbook:
---
- name: main playbook
hosts: all
tasks:
- name: subtasks.yaml
include_tasks: subtasks.yaml
loop: "{{ names_list }}"
loop_control:
loop_var: name
tasks list:
---
- name: "create name for the future vm {{ name }}_{{ ansible_date_time.iso8601 }}"
set_fact:
cloned_vm_name: "{{ name }}_{{ ansible_date_time.iso8601 }}"
ansible version : 2.7.5
OS: Ubuntu 16.04.3