- hosts: 127.0.0.1 remote_user: root gather_facts: yes tasks: - name: message debug: msg: "{{ package_path }} {{ playbook_dir | dirname }}" - name: change hostname debug: msg: win_hostname: name: "{{ item }}" loop: "{{ groups.flink|list }}" - name: mee debug: msg: "{{groups['flink'].index}}" - name: Print index of each host shell: echo "yes" delegate_to: "{{ item }}" loop: "{{ groups['flink'] }}" loop_control: index_var: index_no #debug: # msg: "{{groups['flink'].index}}" when: index_no >= 0 vars_files: - ../configurations/config.yml - ../configurations/components.yml - roles/components/arangodb/vars/main.yml