aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/apache
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-11-05 23:18:54 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2018-11-05 23:18:54 +0100
commitc25c490677bcba2c2e9fee90db10594bd43f6982 (patch)
tree23bde01f60bf0e4421f680bcd9912b5a12f5b42d /ansible/roles/apache
parentb5b7e21c8ba3c68eab9cd244602f27c21aa5f36b (diff)
downloadinfra-c25c490677bcba2c2e9fee90db10594bd43f6982.tar.gz
infra-c25c490677bcba2c2e9fee90db10594bd43f6982.tar.bz2
infra-c25c490677bcba2c2e9fee90db10594bd43f6982.tar.xz
infra-c25c490677bcba2c2e9fee90db10594bd43f6982.zip
Importing Bitraf's mediawiki
o Some improvements, reusing old backup scripts.
Diffstat (limited to 'ansible/roles/apache')
-rw-r--r--ansible/roles/apache/defaults/main.yml2
-rw-r--r--ansible/roles/apache/handlers/main.yml11
-rw-r--r--ansible/roles/apache/tasks/main.yml32
3 files changed, 45 insertions, 0 deletions
diff --git a/ansible/roles/apache/defaults/main.yml b/ansible/roles/apache/defaults/main.yml
new file mode 100644
index 0000000..e28958f
--- /dev/null
+++ b/ansible/roles/apache/defaults/main.yml
@@ -0,0 +1,2 @@
+apache__template:
+apache__copy:
diff --git a/ansible/roles/apache/handlers/main.yml b/ansible/roles/apache/handlers/main.yml
new file mode 100644
index 0000000..9a5a629
--- /dev/null
+++ b/ansible/roles/apache/handlers/main.yml
@@ -0,0 +1,11 @@
+- name: systemctl reload apache
+ become: yes
+ systemd:
+ name: apache2
+ state: reloaded
+
+- name: systemctl restart apache
+ become: yes
+ systemd:
+ name: apache2
+ state: restarted
diff --git a/ansible/roles/apache/tasks/main.yml b/ansible/roles/apache/tasks/main.yml
new file mode 100644
index 0000000..2bb953d
--- /dev/null
+++ b/ansible/roles/apache/tasks/main.yml
@@ -0,0 +1,32 @@
+- become: yes
+ tags:
+ - apache
+ block:
+ - name: packages
+ vars:
+ items:
+ - apache2
+ apt:
+ name: "{{ items }}"
+ install_recommends: no
+
+- become: yes
+ tags:
+ - apache
+ - apache-config
+ block:
+ - name: "fill /etc/apache2"
+ with_items: "{{ apache__copy }}"
+ when: item is defined and item
+ notify: systemctl reload apache
+ copy:
+ dest: "/etc/apache2/{{ item }}"
+ src: "{{ item }}"
+
+ - name: "fill /etc/apache2"
+ with_items: "{{ apache__template }}"
+ when: item is defined and item
+ notify: systemctl reload apache
+ template:
+ dest: "/etc/apache2/{{ item|replace(apache__template_prefix, '') }}"
+ src: "{{ item }}"