Karther  
                
                  
                    January 13, 2020,  4:10pm
                   
                  1 
               
             
            
              Hey all !! 
I have csv file with this content :
filename,state,note,temps
file3,0,my thirst note,71
i have this task :
set_fact: 
 
but not works, my goal is that create all file sucessively (file1, file2, file3, …) in some repertory
Someone have any idea please ?
Thanks very much community ansible !! 
Regards,
Karther
             
            
              
            
           
          
            
              
                vbotka  
              
                  
                    January 13, 2020,  4:34pm
                   
                  2 
               
             
            
              You might be better off with the 'read_csv' modulehttps://docs.ansible.com/ansible/latest/modules/read_csv_module.html#read-csv-read-a-csv-file 
For example
    - hosts: localhost
gives
    "my_files.list": [
The loop the list and create files. For example
    - copy:
HTH,
  -vlado
             
            
              
            
           
          
            
              
                Karther  
              
                  
                    January 14, 2020,  1:00pm
                   
                  3 
               
             
            
              Hey Vladimir !! 
Thanks for your answer,
My problem is that there is problem of syntax with module read_csv:
My task is :
- name: “Read users from CSV file and return a list” read_csv: path: /home/ansible/mssql_query/roles/files/csv_file.csv delimiter: ‘,’ register: file_csv delegate_to: localhost 
Best Regards,
Karther
             
            
              
            
           
          
            
              
                vbotka  
              
                  
                    January 14, 2020,  1:12pm
                   
                  4 
               
             
            
              The syntax seems to be OK. Could you disclose the details of the error
             
            
              
            
           
          
            
              
                Karther  
              
                  
                    January 14, 2020,  2:07pm
                   
                  5 
               
             
            
              Hey Vladimir,
The error is :
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path. 
The error appears to have been in ‘/home/ansible/mssql_query/roles/tasks/main.yml’: line 36, column 3, but may be elsewhere in the file depending on the exact syntax problem. 
The offending line appears to be: 
- name: “Read users from CSV file and return a list” ^ here 
Thanks for your help !! 
Best regards,
Karther
             
            
              
            
           
          
            
              
                Karther  
              
                  
                    January 14, 2020,  2:30pm
                   
                  6 
               
             
            
              And,
I have this problem only with module read_csv it’s very strange …
Can you help me please …
Best regards,
Karther
             
            
              
            
           
          
            
            
              Ansible too old?
             
            
              
            
           
          
            
              
                Karther  
              
                  
                    January 14, 2020,  2:57pm
                   
                  8 
               
             
            
              Hello Visser,
My version is :
ansible 2.8.0.dev0 config file = /etc/ansible/ansible.cfg configured module search path = [u’/usr/share/ansible’] ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible executable location = /var/ansible/bin/ansible python version = 2.7.9 (default, Sep 14 2019, 20:00:08) [GCC 4.9.2] 
Maybe 2.8.0.dev0 is not good version ? It’s not same that version 2.8.0 ?
Thanks for your answers !! 
Best regards,
Karther
             
            
              
            
           
          
            
              
                vbotka  
              
                  
                    January 14, 2020,  4:14pm
                   
                  9 
               
             
            
              This looks suspicious. Upgrade to the latest stable version in your distro.https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html