Earlier articles, we installed Ansible and added necessary admin users for managing nodes from Ansible server and implemented SSH key authentication to access nodes without password as SSH tunnel. We tested if our Ansible controller is working with pinging nodes.
In this article, we will see how to transfer a bash shell script we did in another article to our docker swarm nodes which is controlled by docker swarm.
We use Following ansible command module to transfer a bash script to all docker swarms we have in docker container cluster.
ansible grpName -m copy -a "src=/test/1.sh dest=/test/1.sh" -o
Lets see it in a shell example.
In above example, we transferred "1.sh" to all docker swarm nodes controlled by our Ansible server.