summaryrefslogtreecommitdiff
path: root/roles/sublab_web/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/sublab_web/tasks')
-rw-r--r--roles/sublab_web/tasks/as_webuser.yaml2
-rw-r--r--roles/sublab_web/tasks/as_wikiuser.yaml29
-rw-r--r--roles/sublab_web/tasks/main.yaml4
3 files changed, 33 insertions, 2 deletions
diff --git a/roles/sublab_web/tasks/as_webuser.yaml b/roles/sublab_web/tasks/as_webuser.yaml
index 859c1bf..c6725aa 100644
--- a/roles/sublab_web/tasks/as_webuser.yaml
+++ b/roles/sublab_web/tasks/as_webuser.yaml
@@ -11,7 +11,7 @@
- name: Clone sublab website
git:
dest="/var/www/{{sublab_web_server_name}}/htdocs"
- repo=git://git.sublab.org/website
+ repo="git://{{ groups['gitservers'][0] }}/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
index adfa473..bd30e9d 100644
--- a/roles/sublab_web/tasks/as_wikiuser.yaml
+++ b/roles/sublab_web/tasks/as_wikiuser.yaml
@@ -22,12 +22,39 @@
src=ikiwiki-editpage.tmpl
dest="/home/wiki-{{sublab_web_server_name}}/templates/editpage.tmpl"
+- name: Create .ssh dir
+ file:
+ path="/home/wiki-{{sublab_web_server_name}}/.ssh"
+ state=directory
+ mode=0700
+
+# This ssh keypair is authorized to push to the git-server wiki repo
+- name: Put ssh pubkey
+ copy:
+ dest="/home/wiki-{{sublab_web_server_name}}/.ssh/id_rsa.pub"
+ content="{{wiki_user_pubkey}}"
+ mode=0644
+
+- name: Put ssh privkey
+ copy:
+ dest="/home/wiki-{{sublab_web_server_name}}/.ssh/id_rsa"
+ content="{{wiki_user_privkey}}"
+ mode=0600
+
+# Configure git
+- name: Configure git push for wikiuser
+ command: git config --global push.default simple
+- name: Configure git name
+ command: git config --global user.name "Wiki User {{ansible_hostname}}"
+- name:
+ command: git config --global user.email "nobody@nowhere.ws"
+
# 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
+ repo=git+ssh://git@{{groups['gitservers'][0]}}/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 7416cba..145c549 100644
--- a/roles/sublab_web/tasks/main.yaml
+++ b/roles/sublab_web/tasks/main.yaml
@@ -31,6 +31,10 @@
- wiki.conf
notify: Reload apache
+- name: Place wiki htpasswd
+ copy: dest=/etc/apache2/sites/{{ sublab_web_server_name }}/htpasswd
+ src=htpasswd
+
- include: ../../apache/tasks/ssl.yaml
vars:
ssl_server_name: "{{sublab_web_server_name}}"