How to i collect remote hosts kernel parameters using ansible. I’m looking to below type collect info of remote hosts . setup module doesn’t collect this info .
And sysctl module is to edit , can i use sysctl module just to list the parameters and not to modify anything ?
net.ipv4.ip_forward = 0
Regards
             
            
              
            
           
          
            
            
              Probably best done in one long cmd, for example:
hosts: all 
net.ipv4.ip_forward 
net.ipv4.conf.default.rp_filter 
net.ipv4.conf.default.accept_source_route 
kernel.sysrq 
kernel.core_uses_pid 
net.ipv4.tcp_syncookies 
kernel.msgmnb 
kernel.msgmax 
kernel.shmmax 
kernel.shmall 
fs.file-max 
net.core.optmem_max 
net.core.rmem_default 
net.core.rmem_max 
net.core.wmem_default 
net.core.wmem_max 
net.ipv4.conf.all.rp_filter 
net.ipv4.tcp_max_tw_buckets 
net.ipv4.tcp_mem 
net.ipv4.tcp_rmem 
net.ipv4.tcp_wmem 
net.ipv4.ip_local_port_range 
net.ipv4.ip_forward 
net.ipv4.conf.default.rp_filter 
net.ipv4.tcp_timestamps 
net.ipv4.tcp_fin_timeout 
net.ipv4.tcp_keepalive_time 
net.ipv4.tcp_window_scaling 
net.ipv4.tcp_sack 
net.ipv4.igmp_max_memberships 
kernel.pid_max 
kernel.pid_max 
 
tasks:
             
            
              
            
           
          
            
              
                racke  
              
                  
                    February 17, 2020,  1:47pm
                   
                  3 
               
             
            
              
How to i collect remote hosts kernel parameters using ansible.  I'm looking to below type collect info of remote hosts .
And sysctl module is to edit , can i use  sysctl module just to list the parameters and not to modify anything ?
 
According to its documentation, no.
But you can read the current values with
   command: sysctl -a
Regards
             
            
              
            
           
          
            
              
                vbotka  
              
                  
                    February 17, 2020,  2:31pm
                   
                  4 
               
             
            
              Optionally ask sysctl to print values only and set dictionary of the
    - command: "sysctl -n {{ params | join(' ') }}"
HTH,
  -vlado