exam questions

Exam 350-901 All Questions

View all questions & answers for the 350-901 exam

Exam 350-901 topic 1 question 175 discussion

Actual exam question from Cisco's 350-901
Question #: 175
Topic #: 1
[All 350-901 Questions]


Refer to the exhibit. A developer wants to automatically deploy infrastructure for a containerized application. A .gitlab-ci.yml file must describe a pipeline that builds a container based on a supplied Dockerfile and executes an Ansible playbook on the configured container. What must be added where the code is missing to complete the script?
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: C

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
doble_h
1 year, 1 month ago
asked chatgpt In a GitLab CI/CD pipeline, the after_script is used to specify commands that should be run after the script has executed, regardless of the result of the script. It's commonly used for cleanup, notifying other services, or any other finishing steps. Based on the previous exhibit which is about deploying infrastructure for a containerized application, after building the container and running an Ansible playbook, you might want to include commands in the after_script section that: Push the built Docker image to a Docker registry if the build and Ansible steps were successful. Remove the Docker container to clean up the CI/CD environment. Collect logs or artifacts from the container for further analysis or debugging.
upvoted 1 times
...
ThePokemonNuzlockingMaster
1 year, 6 months ago
The main reason I prefer D instead of C is because of the second line of C where it specified the $DOCKER USERNAME and $DOCKER REPOSITORY. This is incorrect syntax, but also wouldn't be needed anyway since these are specified earlier on in the docker login command. If it wasn't for that, I would think C is more appropriate. However, in my opinion, this can't be right as the syntax is incorrect.
upvoted 1 times
...
AZRA06887
1 year, 6 months ago
After a conversation with chatgpt: Given the requirement to automatically deploy infrastructure for a containerized application and the presence of the docker login command in the script, it is indeed more appropriate to prioritize option C (docker push) over option D (docker logout) in the after_script section. The docker push command ensures that the built container image is pushed to the Docker registry, making it available for deployment. On the other hand, docker logout simply performs a logout action, which may not be directly related to the deployment process. Therefore, in this specific scenario, it is recommended to include option C (docker push) in the after_script section rather than option D (docker logout).
upvoted 1 times
...
cj_kuo
1 year, 9 months ago
I will take the answer as D, because neither answer A,B,C got incorrect command format.
upvoted 1 times
...
Teringzooi
2 years, 3 months ago
Correct answer seems to be D - docker logout https://github.com/willhallonline/docker-ansible/blob/master/.gitlab-ci.yml https://docs.docker.com/engine/reference/commandline/logout/
upvoted 1 times
...
QuiShong
2 years, 6 months ago
I think C is correct. First the image needs to be pushed to the repo.
upvoted 2 times
Teringzooi
2 years, 3 months ago
I already pushed, one rule before.
upvoted 1 times
...
...
bboycoi
2 years, 7 months ago
D https://docs.docker.com/engine/reference/commandline/logout/
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...