set up apache server using ansible playbook on centos code example
Example: ansible playbook webserver
- hosts: "webserver"
tasks:
- name: "installing webserver"
package:
name: "httpd"
state: "present"
- name: "copying index.html"
copy:
src: "~/index.html"
dest: "/var/www/html/"
- name: "starting httpd service"
service:
name: "httpd"
state: "started"
- name: "stopping firewalld service"
service:
name: "firewalld"
state: "stopped"