aboutsummaryrefslogtreecommitdiffstats
path: root/roles/httpd
diff options
context:
space:
mode:
Diffstat (limited to 'roles/httpd')
-rw-r--r--roles/httpd/tasks/main.yml34
-rw-r--r--roles/httpd/templates/httpd.conf.j216
2 files changed, 50 insertions, 0 deletions
diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml
new file mode 100644
index 0000000..4abf95a
--- /dev/null
+++ b/roles/httpd/tasks/main.yml
@@ -0,0 +1,34 @@
+
+# dns ~~ roles/dns/tasks/main.yml
+# ensure host is using unified dns
+
+---
+
+- name: ensure httpd.d directory exists
+ file:
+ path: /etc/httpd.d
+ state: directory
+ owner: "{{ user_root }}"
+ group: "{{ group_root }}"
+ mode: 0644
+
+- name: retrieve all configuration files
+ find:
+ path: /etc/httpd.d
+ patterns: "*.conf"
+ register: configurations
+
+- name: generate httpd configuration
+ template:
+ src: httpd.conf.j2
+ dest: /etc/httpd.conf
+ owner: "{{ user_root }}"
+ group: "{{ group_root }}"
+ mode: 0644
+
+- name: enable and restart httpd
+ service:
+ name: httpd
+ state: restarted
+ enabled: true
+
diff --git a/roles/httpd/templates/httpd.conf.j2 b/roles/httpd/templates/httpd.conf.j2
new file mode 100644
index 0000000..f437f41
--- /dev/null
+++ b/roles/httpd/templates/httpd.conf.j2
@@ -0,0 +1,16 @@
+
+# httpd.conf ~~ /etc/httpd.conf
+# managed by Ansible
+
+types {
+ text/css css
+ text/html html htm
+ text/plain txt pgp pub
+ image/gif gif
+ image/jpeg jpeg jpg
+ image/png png
+}
+
+{% for file in configurations.files %}
+include "{{ file.path }}"
+{% endfor %}
remember that computers suck.