exam 11
- Task
- Solution
- 01
- 02
- 03
We have two nodes that are managed by Ansible. There is an inventory file ~/playbooks/inventory on Ansible controller which has all these two nodes added. Create a playbook ~/playbooks/blocks.yml on Ansible controller to install httpd web server and start its service.
Create the playbook using blocks to logically group the tasks (installation and service start).
Create blocks.yml playbook and add below given code
---
- hosts: all
tasks:
- name: Install and configure httpd web server
block:
- yum:
name: httpd
state: latest
- service:
name: httpd
state: started
Comments
Post a Comment