From 8168119817fb5952095f8757ad0d6f74a556b75d Mon Sep 17 00:00:00 2001 From: binary Date: Mon, 7 Dec 2020 12:29:07 +0100 Subject: Dynamic httpd configuration via include --- roles/httpd/tasks/main.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 roles/httpd/tasks/main.yml (limited to 'roles/httpd/tasks') 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 + -- cgit v1.2.3