aboutsummaryrefslogtreecommitdiffstats
path: root/roles/mediagoblin/tasks
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2016-04-10 02:07:48 -0400
committerbnewbold <bnewbold@robocracy.org>2016-04-10 02:07:48 -0400
commit5b149a4482ad11db8871368f3b616681536f5872 (patch)
treecefdcde4fd012c8fdc3e617219d2fe4f9405e770 /roles/mediagoblin/tasks
parente79a42d63fe270875cab7773ecd7688870dfb829 (diff)
downloadinfra-5b149a4482ad11db8871368f3b616681536f5872.tar.gz
infra-5b149a4482ad11db8871368f3b616681536f5872.zip
mediagoblin: moving closer to HEAD
Diffstat (limited to 'roles/mediagoblin/tasks')
-rw-r--r--roles/mediagoblin/tasks/main.yml82
-rw-r--r--roles/mediagoblin/tasks/ubuntu.yml0
2 files changed, 53 insertions, 29 deletions
diff --git a/roles/mediagoblin/tasks/main.yml b/roles/mediagoblin/tasks/main.yml
index caddf4d..a5ce476 100644
--- a/roles/mediagoblin/tasks/main.yml
+++ b/roles/mediagoblin/tasks/main.yml
@@ -1,63 +1,87 @@
-- name: Install mediagoblin dependencies
+ name: Install mediagoblin dependencies
apt: name={{item}} state=installed
with_items:
- - git-core
- - python
- - python-dev
- - python-lxml
- - python-imaging
- - python-virtualenv
- - nginx-full
+ - python3-dev
+ - python3-lxml
+ - python3-imaging
+ - python3-virtualenv
+ - automake
tags:
- dependencies
-
-- NAME: create mediagoblin user
- user: name={{ mediagoblin_user }} system=yes state=present
+- name: Create mediagoblin user
+ user: name={{ mediagoblin_user }}
+ createhome=yes
+ groups=www-data
+ system=yes
+ home=/var/lib/mediagoblin
+ state=present
- name: Create deploy directory
- file: name={{deploy_directory}} state=directory owner={{user}}
+ file: name={{ mediagoblin_basedir }}
+ state=directory
+ owner={{ mediagoblin_user }}
+
+- name: Create user data directory
+ file: name={{ mediagoblin_basedir }}/data
+ state=directory
+ chmod=0750
+ owner={{ mediagoblin_user }}
- name: Checkout git
- git: repo={{git_uri}} dest={{deploy_directory}} accept_hostkey=yes
+ git: repo={{ mediagoblin_git_uri }}
+ dest={{ mediagoblin_basedir }}/src
+ tag={{ mediagoblin_git_tag }}
+ accept_hostkey=yes
sudo: yes
- sudo_user: "{{ user }}"
+ sudo_user: "{{ mediagoblin_user }}"
- name: git submodules
shell:
git submodule update --init --recursive
- chdir="{{deploy_directory}}"
- creates="{{deploy_directory}}/.gitmodules"
+ chdir="{{mediagoblin_basedir}}/src"
+ creates="{{mediagoblin_basedir}}/src/.gitmodules"
sudo: yes
- sudo_user: "{{ user }}"
+ sudo_user: "{{ mediagoblin_user }}"
- name: Create virtualenv
shell:
- virtualenv --python=python2 --system-site-packages .
- chdir="{{deploy_directory}}"
- creates="{{deploy_directory}}/bin/python"
+ virtualenv --python=python3 --system-site-packages .
+ chdir="{{mediagoblin_basedir}}/src"
+ creates="{{mediagoblin_basedir}}/src/bin/python"
sudo: yes
- sudo_user: "{{ user }}"
+ sudo_user: "{{ mediagoblin_user }}"
- name: Build mediagoblin
shell:
- ./bin/python setup.py develop
- chdir="{{deploy_directory}}"
- creates="{{deploy_directory}}/mediagoblin.egg-info"
+ ./bootstrap.sh && ./configure –with-python3 && make
+ chdir="{{mediagoblin_basedir }}/src"
+ creates="{{mediagoblin_basedir}}/src/mediagoblin.egg-info"
sudo: yes
- sudo_user: "{{ user }}"
+ sudo_user: "{{ mediagoblin_user }}"
- name: Install flup
easy_install:
name=flup
- virtualenv="{{deploy_directory}}"
+ virtualenv="{{ mediagoblin_basedir }}"
sudo: yes
- sudo_user: "{{ user }}"
+ sudo_user: "{{ mediagoblin_user }}"
- name: Update DB
shell:
./bin/gmg dbupdate
- chdir="{{deploy_directory}}"
+ chdir="{{ mediagoblin_basedir }}/src"
sudo: yes
- sudo_user: "{{ user }}"
+ sudo_user: "{{ mediagoblin_user }}"
+
+- name: Copy generic mediagoblin nginx site configuration
+ template: src=etc_nginx_sites-available_mediagoblin.j2
+ dest=/etc/nginx/sites-available/mediagoblin
+
+- name: Create nginx symlink for default
+ file: state=link
+ src=/etc/nginx/sites-available/mediagoblin
+ dest=/etc/nginx/sites-enabled/mediagoblin
+ notify: nginx restart # reload not sufficient?
+
diff --git a/roles/mediagoblin/tasks/ubuntu.yml b/roles/mediagoblin/tasks/ubuntu.yml
deleted file mode 100644
index e69de29..0000000
--- a/roles/mediagoblin/tasks/ubuntu.yml
+++ /dev/null