On 18. april 2017 18:25, nishant bawane wrote:
for i in `cat /tmp/list`
        do
        echo $i
        scp HLC_auth $i:.ssh/authorized_keys
        scp known_hosts.LLC $i:.ssh/known_hosts
        ssh $i "rm -rf .ssh/id_dsa*"
        ssh $i "ssh-keygen -d"
        done
Above the the task i need to run through playbook, please suggest how the
playbook should look alike.


below is the code which run succesfully when i exclude scp and ssh commands
-

 shell: for i in `cat /home/dp794d/temp/list`;
                do echo $i;
                done

Need to include the scp and ssh command also under the same shell.. how to
perform that task.


There is many ways to do this, but you should probably start with the script module until you get some experience with Ansible
https://docs.ansible.com/ansible/script_module.html

--
Kai Stian Olstad

--
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/f3e75486-366a-32b6-ebb9-d1257cb1c842%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to