Skip to content

Instantly share code, notes, and snippets.

@kovid-rathee
Created February 15, 2017 19:19
Show Gist options
  • Save kovid-rathee/ee2441a2f58b777ee04ec673f63bcbb0 to your computer and use it in GitHub Desktop.
Save kovid-rathee/ee2441a2f58b777ee04ec673f63bcbb0 to your computer and use it in GitHub Desktop.
Basic Ansible Role to install and configure Apache HTTP Server
---
- name: install apache
yum: name=httpd state=present
- name: insert firewalld rule for httpd
firewalld: port={{httpd_port}}/tcp permanent=true state=enabled immediate=yes
- name: start and enable apache
service: name=httpd state=started enabled=yes
- name: configure SELinux to allow httpd to connect to remote database
seboolean: name=httpd_can_work_connect_db state=true persistent=yes
@kovid-rathee
Copy link
Author

This needs a group var file that contains httpd_port and other variables used in this Role

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment