Good day.

I need to make changes in the know_hosts files of users on various hosts. 
I'll use a script to do the actual changes in known_hosts. I have the 
following simple playbook, so far. It identifies users with known_host 
files:














*---- hosts: all  gather_facts: false  become: yes  tasks:    - name: find 
known hosts      shell: find /root /home -type f -name known_hosts      
register: known    - debug: msg="{{ known.stdout }}"*
It produces the following output:























*ok: [host1] =>  msg: |-    /root/.ssh/known_hosts    
/home/user1/.ssh/known_hosts    /home/user2/.ssh/known_hosts    
/home/user3/.ssh/known_hostsok: [host2] =>  msg: |-    
/root/.ssh/known_hosts    /home/user1/.ssh/known_hosts    
/home/user2/.ssh/known_hosts    /home/user3/.ssh/known_hosts    
/home/user4/.ssh/known_hosts    /home/user5/.ssh/known_hostsok: [host3] =>  
msg: /root/.ssh/known_hostsok: [host4] =>  msg: |-    
/root/.ssh/known_hosts    /home/user1/.ssh/known_hosts    
/home/user2/.ssh/known_hosts    /home/user3/.ssh/known_hosts~*

I want to apply the script against the known_hosts file for each of the 
identified users. How do I do that?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/623b5aa3-d20b-4648-b169-d2cce2b00cadn%40googlegroups.com.

Reply via email to