nerdexam
Cisco

200-901 · Question #603

Refer to the exhibit. The IT team deployed a new Linux virtual machine for a software engineer to use, but the engineer is not comfortable configuring services using Bash. Which workflow is…

The correct answer is A. Restart the network on the eth0 interface and start the httpd service if it is not already started. The key distinction is in how Ansible's 'state' parameter works. A task with 'state: restarted' applied to the network/eth0 interface will always restart it unconditionally. A task with 'state: started' applied to the httpd service is idempotent - Ansible will only start httpd…

Infrastructure and Automation

Question

Refer to the exhibit. The IT team deployed a new Linux virtual machine for a software engineer to use, but the engineer is not comfortable configuring services using Bash. Which workflow is automated by the Ansible playbook?

Exhibit

200-901 question #603 exhibit

Options

  • ARestart the network on the eth0 interface and start the httpd service if it is not already started.
  • BRestart the httpd service and start the network service for the eth0 interface.
  • CStart the network service on the eth0 interface even if it was brought down manually.
  • DRestart the httpd service and the network service regardless of the state.

How the community answered

(37 responses)
  • A
    86% (32)
  • B
    3% (1)
  • C
    5% (2)
  • D
    5% (2)

Explanation

The key distinction is in how Ansible's 'state' parameter works. A task with 'state: restarted' applied to the network/eth0 interface will always restart it unconditionally. A task with 'state: started' applied to the httpd service is idempotent - Ansible will only start httpd if it is not already running; it will not restart a running service. This matches option A exactly. Option B reverses the services incorrectly. Option C is wrong because 'state: started' does not bring up an interface that was manually brought down (that would require 'state: up' with a network module). Option D is wrong because 'state: started' is not the same as 'state: restarted' and will not restart a service that is already running.

Topics

#Ansible#Service Management#Infrastructure Automation#Linux Services

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice