Hello, i new with Ansible, very very very newbie, I am reading a book of approximately 400 pages, haven’t finished reading yet, but I need to automate a process as soon as possible, so I request your help.
I’m trying to automate deploys. I have two repositories. First I am cloning the repository (repo1) to my PC, then pull from my PC to the repo2.
Here my first yaml, this way I am cloning the external repository (repo1) on my local PC
---
- hosts: localhost
gather_facts: false
tasks:
- name: clone repo test
git:
repo:
https://github.com/zpqrtbnk/test-repo.git dest: /home/emanuel/git-test/
clone: yes
update: yes
Now I must clone the local repository to an external repository (repo2), must I use the ansible-pull command or the copy module? Is there a way to generate a rollback in case the task fails?
- hosts: git-server
gather_facts: false
tasks:
- name: pull changes
command: ansible-pull --url -C brunch
Any examples??
Regards,