Here is a CI/CD pipeline for network automation:
stages:
- validate
- test
- deploy
validate:
script:
- yamllint inventory/
- ansible-lint playbooks/
test:
script:
- ansible-playbook playbooks/site.yml --check
deploy:
script:
- ansible-playbook -i inventory/prod playbooks/site.yml
when: manual
The when: manual gate requires approval before production deployment. Tests run automatically on each commit.