I am using Ansible 2.5. I need to do deploy code from local(controller) git repository to remote server.
I was trying with a Ansible-playbook with git module that can only deploy code from local repository to another local path or remote repository to another remote path. Its based on hosts configuration.
- git:
repo: /home/pi/Desktop/kk/Vue-Example/
dest: /home/pi/Desktop/bb
Here repo
will be local(controller-machine) git repository path
and dest
will be remote machine location.
hosts: localhost
that works because localhost I have exist git repository and destination too. it can deploy local->local. But when addinghosts: remote-host
that not working. it says remote server have no git repository in that location. I need to deploy local->remote. What will be the configuration? – Anjan Biswas