Skip to content

Instantly share code, notes, and snippets.

@PKOfficial
Created October 21, 2017 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PKOfficial/8981afc022a6c1f9988658b1ee8b52c8 to your computer and use it in GitHub Desktop.
Save PKOfficial/8981afc022a6c1f9988658b1ee8b52c8 to your computer and use it in GitHub Desktop.
---
- hosts: webservers
vars:
http_port: 80
max_clients: 200
remote_user: root
tasks:
- name: ensure apache is at the latest version
yum: name=httpd state=latest
- name: write the apache config file
template: src=/srv/httpd.j2 dest=/etc/httpd.conf
notify:
- restart apache
- name: ensure apache is running (and enable it at boot)
service: name=httpd state=started enabled=yes
handlers:
- name: restart apache
service: name=httpd state=restarted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment