I want to replicate a shell script that loops through the contents of a 
text.file
For i in `cat text.file`
 
I tried below and got an error.
 I'm not getting which logic to use. Kindly advise.

- name: Load the variables

    include_vars:

     file: /home/devuser/internproj/inventories/NP/voblist.yml

    register: dits_list

 

  - debug:

     msg: "{{ dits_list.ansible_facts }}"

 

  - name: run the tool commands

   shell: /usr/atria/bin/sertool -load -host aaa {{ items }} {{ items }}

    args:

     chdir: "/home/vobadmin"

     with_items: "{{ vob_list.dits }}" #How to achieve this part?

 

I want to pass the contents of the voblist to the shell module to excute the 
above shell command.

 

Basically I want to replicate the below shell script

 

For i in `cat /home/devuser/internproj/inventories/NP/voblist.yml`

Do

/usr/atria/bin/sertool -load -host aaa $i $i

Done

if

 

===========================================================================================================

cat /home/devuser/internproj/inventories/NP/voblist.yml

---

dits:

 

- /project/vob_solaris_test.vbs

- /project/vob_solaris_test2.vbs

-- 
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/a15f0c6f-06fa-4066-ae5f-f0d92987c16e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to