diff options
author | Christian Franke <nobody@nowhere.ws> | 2015-08-25 19:23:43 +0200 |
---|---|---|
committer | Christian Franke <nobody@nowhere.ws> | 2015-08-25 19:23:43 +0200 |
commit | af66612e6014bea48458125cda72d73c51bc3c20 (patch) | |
tree | 49cee76d579149a9fd800225303ee31be79cf3eb /roles/sublab_web/tasks |
Initial commit
Diffstat (limited to 'roles/sublab_web/tasks')
-rw-r--r-- | roles/sublab_web/tasks/as_webuser.yaml | 7 | ||||
-rw-r--r-- | roles/sublab_web/tasks/main.yaml | 40 |
2 files changed, 47 insertions, 0 deletions
diff --git a/roles/sublab_web/tasks/as_webuser.yaml b/roles/sublab_web/tasks/as_webuser.yaml new file mode 100644 index 0000000..44c209a --- /dev/null +++ b/roles/sublab_web/tasks/as_webuser.yaml @@ -0,0 +1,7 @@ +--- +- name: Clone sublab website + git: + dest="/var/www/{{sublab_web_server_name}}/htdocs" + repo=git://git.sublab.org/website + accept_hostkey=yes + notify: Rebuild subweb website diff --git a/roles/sublab_web/tasks/main.yaml b/roles/sublab_web/tasks/main.yaml new file mode 100644 index 0000000..5e52a65 --- /dev/null +++ b/roles/sublab_web/tasks/main.yaml @@ -0,0 +1,40 @@ +--- +# Deploy sublab web config +- name: Place vhost config + template: + dest=/etc/apache2/sites-enabled/000-default_subweb.conf + src=vhost.conf.j2 + notify: Reload apache + +- name: Create config snippet dir + file: + name=/etc/apache2/sites/{{ sublab_web_server_name }} + recurse=yes + state=directory + +- name: Place config snippets + template: + dest=/etc/apache2/sites/{{ sublab_web_server_name }}/{{ item }} + src={{ item }}.j2 + with_items: + - dump.conf + - server.conf + - ssl.conf + - subdap-plain.conf + - subdap-ssl.conf + - wiki.conf + notify: Reload apache + +- name: Create Website group + group: name=sublab_web + +- name: Create Website user + user: + name=sublab_web + group=sublab_web + home="/var/www/{{sublab_web_server_name}}" + +- include: as_webuser.yaml + become: yes + become_method: su + become_user: sublab_web |