Hi,
I have been trying to implement the following:
If any file change in git lab repo, then only we need to deploy the file in servers.
How to write Ansible playbook?
Hi,
I have been trying to implement the following:
If any file change in git lab repo, then only we need to deploy the file in servers.
How to write Ansible playbook?
that is very little information…
answers to these would help:
etc etc
Honestly sounds less like an ansible task and more like a git action or git runner job. Ansible natively has no idea what is in the git repo.
I agree. This is a version control system action. That action could run an ansible playbook to push the changed file to an inventory of systems.
Walter
Hi ,
Please find the following:
that is very little information…
answers to these would help:
- what is in that gitlab repository? configuration files, which are required to access our application
- what is “the file”: like EAxI config file, jboss standalone file
- what are “servers”:RHEL servers
- what does your inventory look like?: SIT, UAT envs
Each environment has two servers
etc etc
Please let me know if you need any other information.
Ashok,
As a gitlab and Ansible user, this sounds to me like more of a gitlab problem than an Ansible problem.
You should follow and read the first few links at the top of Gitlab CI Keyword Reference index document. They should give you some ideas about how to make things happen when commits are made to your projects.
Good luck,
Hi Todd,
Thanks for providing your suggestion.
But, There are a few of the templates, which are available in gitlab. If there is any change in the template file, then only to deploy in UAT servers.
This is what i am trying to implement. Is this not possible to implement in Ansible side?
Note: i did R&D and it suggested to implement synchronize module in ansible
Hi Ashok
What you need is some sort of orchestrator or you can use gitlab CI and runner to execute ansible / ansible-navigator / ansible-runner etc etc . Another option that I have implemented in the past for customers is using ansible-pull from the ansible controller and execute plays accordingly. Hopefully some ideas you might be able to explore.
https://www.devopsschool.com/blog/what-is-ansible-pull-and-how-can-we-use-it/
Regards
Thanks Stephen. Let me take a look.