summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--components.yml8
-rw-r--r--roles/apache2/files/testenv.conf11
-rw-r--r--roles/apache2/tasks/main.yml22
3 files changed, 41 insertions, 0 deletions
diff --git a/components.yml b/components.yml
index 011828d..44947e2 100644
--- a/components.yml
+++ b/components.yml
@@ -1,3 +1,11 @@
+- hosts: testenv
+ remote_user: root
+ become: no
+ roles:
+ - apache2
+ vars:
+ hostname: testenv
+
- hosts: artifacts
remote_user: root
become: no
diff --git a/roles/apache2/files/testenv.conf b/roles/apache2/files/testenv.conf
new file mode 100644
index 0000000..a286ecb
--- /dev/null
+++ b/roles/apache2/files/testenv.conf
@@ -0,0 +1,11 @@
+<VirtualHost *:80>
+ ServerName wmf2-testenv.vm.liw.fi
+ ServerAdmin liw@liw.fi
+ DocumentRoot /srv/http
+ ErrorLog /var/log/apache2/testenv.error.log
+ CustomLog /var/log/apache2/testenv.access.log combined
+ <Directory /srv/http>
+ Options +Indexes
+ Require all granted
+ </Directory>
+</VirtualHost>
diff --git a/roles/apache2/tasks/main.yml b/roles/apache2/tasks/main.yml
new file mode 100644
index 0000000..2757ee4
--- /dev/null
+++ b/roles/apache2/tasks/main.yml
@@ -0,0 +1,22 @@
+- name: "create /srv/http"
+ file:
+ state: directory
+ path: /srv/http
+
+- name: "install apache2"
+ apt:
+ name: apache2
+
+- name: "add virtual host for /srv/http"
+ copy:
+ src: testenv.conf
+ dest: /etc/apache2/sites-available/testenv.conf
+
+- name: "enable virtual host"
+ shell: |
+ a2ensite testenv
+
+- name: "restart apache2"
+ systemd:
+ name: apache2
+ state: restarted