summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lwirzenius@wikimedia.org>2019-07-07 18:45:44 +0300
committerLars Wirzenius <lwirzenius@wikimedia.org>2019-07-07 18:45:44 +0300
commitc6bd729f0565c12af68a20857928a96f854063f5 (patch)
tree1ebe117d0eed4848ac3b578f1f825c05ea8634da
parentbab01a58a170027e7fa7641deb6bec4006f4fcae (diff)
downloadwmf-gitlab-c6bd729f0565c12af68a20857928a96f854063f5.tar.gz
Add: mock for test env
-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