Ansible playbook
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
1.Create a playbook and setup a webserver(httpd) and use httpd as a variable decalared in role var file
—
-name: webserver
host:web
vars_files:
– role-var-file.yml
tasks:
-name: var include
include_vars: role-var-file.yml
-name: setup httpd server
yum:
name: “{{packname}}”
state: latest
– name: Start service httpd, if not started
ansible.builtin.service:
name: “{{packname}}”
state: started