summaryrefslogtreecommitdiff
path: root/roles/sublab_web/tasks
diff options
context:
space:
mode:
authorChristian Franke <nobody@nowhere.ws>2015-08-25 22:06:38 +0200
committerChristian Franke <nobody@nowhere.ws>2015-08-25 22:06:38 +0200
commit037b2539fdd6de92cdf9f0846476393af3590dd8 (patch)
treebf939083f55885de8073562f2e1a21b162bd6bb1 /roles/sublab_web/tasks
parentaf66612e6014bea48458125cda72d73c51bc3c20 (diff)
Make the wiki work
Diffstat (limited to 'roles/sublab_web/tasks')
-rw-r--r--roles/sublab_web/tasks/as_webuser.yaml10
-rw-r--r--roles/sublab_web/tasks/as_wikiuser.yaml33
-rw-r--r--roles/sublab_web/tasks/main.yaml24
3 files changed, 65 insertions, 2 deletions
diff --git a/roles/sublab_web/tasks/as_webuser.yaml b/roles/sublab_web/tasks/as_webuser.yaml
index 44c209a..859c1bf 100644
--- a/roles/sublab_web/tasks/as_webuser.yaml
+++ b/roles/sublab_web/tasks/as_webuser.yaml
@@ -1,7 +1,17 @@
---
+- name: Put rebuild script
+ template:
+ dest="/var/www/{{sublab_web_server_name}}/website-rebuild.sh"
+ src=website-rebuild.sh.j2
+ mode=0755
+ notify: Rebuild subweb website
+
+# Updates to git are pushed automatically and should not
+# go through ansible - this is for initial deployment only
- name: Clone sublab website
git:
dest="/var/www/{{sublab_web_server_name}}/htdocs"
repo=git://git.sublab.org/website
accept_hostkey=yes
+ update=no
notify: Rebuild subweb website
diff --git a/roles/sublab_web/tasks/as_wikiuser.yaml b/roles/sublab_web/tasks/as_wikiuser.yaml
new file mode 100644
index 0000000..adfa473
--- /dev/null
+++ b/roles/sublab_web/tasks/as_wikiuser.yaml
@@ -0,0 +1,33 @@
+---
+- name: Put wiki configuration
+ template:
+ src=ikiwiki.setup.j2
+ dest="/home/wiki-{{sublab_web_server_name}}/wiki.setup"
+ notify: Rebuild ikiwiki
+
+- name: Put wiki rebuild script
+ template:
+ src=ikiwiki-rebuild.sh.j2
+ dest="/home/wiki-{{sublab_web_server_name}}/ikiwiki-rebuild.sh"
+ mode=0755
+ notify: Rebuild ikiwiki
+
+- name: Create Template dir
+ file:
+ path="/home/wiki-{{sublab_web_server_name}}/templates"
+ state=directory
+
+- name: Put editpage template
+ copy:
+ src=ikiwiki-editpage.tmpl
+ dest="/home/wiki-{{sublab_web_server_name}}/templates/editpage.tmpl"
+
+# Updates to git are pushed automatically and should not
+# go through ansible - this is for initial deployment only
+- name: Clone wiki git
+ git:
+ dest="/home/wiki-{{sublab_web_server_name}}/wiki"
+ repo=git://git.sublab.org/ikiwiki
+ accept_hostkey=yes
+ update=no
+ notify: Rebuild ikiwiki
diff --git a/roles/sublab_web/tasks/main.yaml b/roles/sublab_web/tasks/main.yaml
index 5e52a65..fcfc7cb 100644
--- a/roles/sublab_web/tasks/main.yaml
+++ b/roles/sublab_web/tasks/main.yaml
@@ -1,5 +1,12 @@
---
-# Deploy sublab web config
+- name: Install ikiwiki package and dependencies
+ apt: name={{ item }} state=present
+ with_items:
+ - ikiwiki
+ - perlmagick
+ - libmagickcore-extra
+ notify: Rebuild ikiwiki
+
- name: Place vhost config
template:
dest=/etc/apache2/sites-enabled/000-default_subweb.conf
@@ -17,7 +24,6 @@
dest=/etc/apache2/sites/{{ sublab_web_server_name }}/{{ item }}
src={{ item }}.j2
with_items:
- - dump.conf
- server.conf
- ssl.conf
- subdap-plain.conf
@@ -34,7 +40,21 @@
group=sublab_web
home="/var/www/{{sublab_web_server_name}}"
+- name: Create Wiki group
+ group: name=sublab_wiki
+
+- name: Create Wiki user
+ user:
+ name=sublab_wiki
+ group=sublab_wiki
+ home="/home/wiki-{{sublab_web_server_name}}"
+
- include: as_webuser.yaml
become: yes
become_method: su
become_user: sublab_web
+
+- include: as_wikiuser.yaml
+ become: yes
+ become_method: su
+ become_user: sublab_wiki