How would you perform a rolling update of an application across multiple servers to ensure zero downtime?
Use the serial keyword to update servers in batches.
- hosts: app_servers
serial: 2 # Update 2 servers at a time
tasks:
- name: Deploy the new application
copy:
src: /path/to/app
dest: /var/www/app
notify: restart app service
DevOps Engineer | Expertise in Maven, Git, Terraform, Kubernetes, Ansible, Prometheus, Python, Azure, AWS, GCP, SonarQube, Grafana & ELK Stack
2 个月Love this