Hello Deborah, Please find screenshot attached with some explanations, hope it will help.
Sincerely, Evgen <https://lh3.googleusercontent.com/-7_RHTH7hMSk/Vg9G4OnFnKI/AAAAAAAADA4/E00FIFSvVtk/s1600/Screenshot%2B2015-10-02%2B21.19.50.png> On Friday, October 2, 2015 at 5:53:07 AM UTC-4, DEBORAH AKUOKO wrote: > > Thanks Evgen, > > This works fine. But i keep gettign this error "One or more undefined > variables: 'unicode object' has no attribute 'item'" > Please see it clearly in the snapshot attached. > > Thanks so much for the help. > > Regards, > Deborah. > > > On Thu, Oct 1, 2015 at 7:39 PM, Evgen Morokin <[email protected] > <javascript:>> wrote: > >> Hi, you can do something like: >> >> - name: create dirs >> file: dest=/tmp/tomcat-instance{{ item }} state=directory >> with_sequence: start=1 end=3 >> register: dies >> >> - debug: var=dirs.results >> >> - name: do something with tomcat >> shell: echo "sudo tomcat-instance1-create -p {{ 8080 + (item.item | >> int) }} -c {{ 8005 + (item.item | int) }} name{{ item.item }}" >> with_items: >> - "{{ dirs.results }}" >> register: something >> >> - debug: var=something.results >> >> Register with debug can produce a lot of interesting information about >> tasks ) >> >> http://docs.ansible.com/ansible/playbooks_variables.html#registered-variables >> http://docs.ansible.com/ansible/playbooks_filters.html >> http://docs.ansible.com/ansible/playbooks_loops.html >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Ansible Project" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/ansible-project/cp5p6rbYkEo/unsubscribe >> . >> To unsubscribe from this group and all its topics, send an email to >> [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/109ab9f8-49e0-4390-86e3-dcf927f98a04%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/109ab9f8-49e0-4390-86e3-dcf927f98a04%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f393f66d-06b2-46d3-afb4-6a38e737b96a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
