300-910 · Question #52
A precheck validation is being designed for the network state in a CI/CD pipeline This design requires: instances must be used to validate changes. changes must be validated prior to a continuous depl
The correct answer is D. Use different inventory files for each environment. To target different environments for precheck validation and deployment within a CI/CD pipeline, using different inventory files for each environment is the most appropriate method.
Question
- instances must be used to validate changes.
- changes must be validated prior to a continuous deployment workflow, and
- then push the changes to production How should the pipeline target the required environment?
Options
- AUse separate CI servers for each environment
- BUse different pipelines for each environment
- CUse separate Git repositories for each environment
- DUse different inventory files for each environment
How the community answered
(26 responses)- A15% (4)
- B8% (2)
- C4% (1)
- D73% (19)
Why each option
To target different environments for precheck validation and deployment within a CI/CD pipeline, using different inventory files for each environment is the most appropriate method.
Using separate CI servers for each environment is inefficient and creates unnecessary operational overhead; a single CI system can manage multiple environments.
While possible, using entirely different pipelines for each environment can lead to duplication and makes it harder to maintain consistency; a single parameterized pipeline using environment-specific configurations is generally preferred.
Using separate Git repositories for each environment's code is overly complex; typically, the same application and infrastructure code reside in one repository, with environment-specific configurations managed separately within it.
Inventory files (common in configuration management tools like Ansible) define target hosts and environment-specific variables. By using distinct inventory files for each environment (e.g., dev, staging, production), a single pipeline can dynamically target the correct set of instances and apply environment-specific configurations during validation or deployment steps.
Concept tested: CI/CD multi-environment deployment strategies
Source: https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html
Topics
Community Discussion
No community discussion yet for this question.