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?
A.
Restart the network on the ethO interlace and start the httpd service if it is not already started.
B.
Restart the httpd service and start the network service for the ethO interface.
C.
Start the network service on the ethO interface even if it was brought down manually.
D.
Restart the httpd service and the network service regardless of the state.
The Ansible playbook in the exhibit consists of two stages:
Stage 1: Restarts the network service on the eth0 interface.
Stage 2: Starts the httpd service.
Stage 1:
- name: stage1
ansible.builtin.service:
name: network
state: restarted
args: eth0
This stage ensures that the network service on the eth0 interface is restarted.
Stage 2:
- name: stage2
ansible.builtin.service:
name: httpd
state: started
This stage ensures that the httpd service is started if it is not already running.
References:
Ansible Playbook Documentation: Ansible Service Module
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit