aboutsummaryrefslogtreecommitdiffstats
path: root/roles/mediagoblin/tasks
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2016-04-10 03:16:36 -0400
committerbnewbold <bnewbold@robocracy.org>2016-04-10 03:16:36 -0400
commit8b0c0361d8807d9ae1ef29747480b07232f94411 (patch)
treedbe7b8029e2f3e1ed0e1d71fb56793fa091471ab /roles/mediagoblin/tasks
parent43e55852f43cb733eac46965561b0995592ea3e7 (diff)
downloadinfra-8b0c0361d8807d9ae1ef29747480b07232f94411.tar.gz
infra-8b0c0361d8807d9ae1ef29747480b07232f94411.zip
mediagoblin: lots of little fixes; bugs prevent final deployment
Diffstat (limited to 'roles/mediagoblin/tasks')
-rw-r--r--roles/mediagoblin/tasks/main.yml88
-rw-r--r--roles/mediagoblin/tasks/mediagoblin.yml98
2 files changed, 99 insertions, 87 deletions
diff --git a/roles/mediagoblin/tasks/main.yml b/roles/mediagoblin/tasks/main.yml
index a5ce476..69ae650 100644
--- a/roles/mediagoblin/tasks/main.yml
+++ b/roles/mediagoblin/tasks/main.yml
@@ -1,87 +1 @@
- name: Install mediagoblin dependencies
- apt: name={{item}} state=installed
- with_items:
- - python3-dev
- - python3-lxml
- - python3-imaging
- - python3-virtualenv
- - automake
- tags:
- - dependencies
-
-- 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={{ 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={{ mediagoblin_git_uri }}
- dest={{ mediagoblin_basedir }}/src
- tag={{ mediagoblin_git_tag }}
- accept_hostkey=yes
- sudo: yes
- sudo_user: "{{ mediagoblin_user }}"
-
-- name: git submodules
- shell:
- git submodule update --init --recursive
- chdir="{{mediagoblin_basedir}}/src"
- creates="{{mediagoblin_basedir}}/src/.gitmodules"
- sudo: yes
- sudo_user: "{{ mediagoblin_user }}"
-
-
-- name: Create virtualenv
- shell:
- virtualenv --python=python3 --system-site-packages .
- chdir="{{mediagoblin_basedir}}/src"
- creates="{{mediagoblin_basedir}}/src/bin/python"
- sudo: yes
- sudo_user: "{{ mediagoblin_user }}"
-
-- name: Build mediagoblin
- shell:
- ./bootstrap.sh && ./configure –with-python3 && make
- chdir="{{mediagoblin_basedir }}/src"
- creates="{{mediagoblin_basedir}}/src/mediagoblin.egg-info"
- sudo: yes
- sudo_user: "{{ mediagoblin_user }}"
-
-- name: Install flup
- easy_install:
- name=flup
- virtualenv="{{ mediagoblin_basedir }}"
- sudo: yes
- sudo_user: "{{ mediagoblin_user }}"
-
-- name: Update DB
- shell:
- ./bin/gmg dbupdate
- chdir="{{ mediagoblin_basedir }}/src"
- sudo: yes
- 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?
-
+- include: mediagoblin.yml tags=mediagoblin
diff --git a/roles/mediagoblin/tasks/mediagoblin.yml b/roles/mediagoblin/tasks/mediagoblin.yml
new file mode 100644
index 0000000..b7df031
--- /dev/null
+++ b/roles/mediagoblin/tasks/mediagoblin.yml
@@ -0,0 +1,98 @@
+- name: Install mediagoblin dependencies
+ apt: name={{item}} state=installed
+ with_items:
+ - python3-dev
+ - python3-lxml
+ - python3-pil
+ - python3-virtualenv
+ - python3-babel
+ - virtualenv
+ - automake
+ - npm # XXX: really? UGH
+ - nodejs-legacy
+ tags:
+ - dependencies
+
+- name: Create mediagoblin user
+ user: name={{ mediagoblin_user }}
+ createhome=yes
+ groups=www-data
+ system=yes
+ home=/var/lib/mediagoblin
+ state=present
+
+- name: Create mediagoblin base directory
+ file: name={{ mediagoblin_basedir }}
+ state=directory
+ owner={{ mediagoblin_user }}
+
+- name: Create user data directory
+ file: name={{ mediagoblin_basedir }}/data
+ state=directory
+ mode=0750
+ owner={{ mediagoblin_user }}
+
+- name: Checkout git
+ git: repo={{ mediagoblin_git_uri }}
+ dest={{ mediagoblin_basedir }}/src
+ version={{ mediagoblin_git_ref }}
+ recursive=yes
+ accept_hostkey=yes
+ sudo: yes
+ sudo_user: "{{ mediagoblin_user }}"
+
+- name: Create mediagoblin user_dev directory
+ file: name={{ mediagoblin_basedir }}/src/user_dev
+ state=directory
+ owner={{ mediagoblin_user }}
+
+- name: Create virtualenv
+ shell:
+ virtualenv --python=python3 --system-site-packages .
+ chdir="{{mediagoblin_basedir}}/src"
+ creates="{{mediagoblin_basedir}}/src/bin/python"
+ sudo: yes
+ sudo_user: "{{ mediagoblin_user }}"
+
+- name: Build mediagoblin
+ shell:
+ ./bootstrap.sh && ./configure -with-python3 && make
+ chdir="{{mediagoblin_basedir }}/src"
+ creates="{{mediagoblin_basedir}}/src/mediagoblin.egg-info"
+ sudo: yes
+ sudo_user: "{{ mediagoblin_user }}"
+
+- name: Install flup in virtualenv
+ easy_install:
+ name=flup
+ virtualenv="{{ mediagoblin_basedir }}"/src
+ sudo: yes
+ sudo_user: "{{ mediagoblin_user }}"
+
+- name: Update DB
+ shell:
+ ./bin/gmg dbupdate
+ chdir="{{ mediagoblin_basedir }}/src"
+ sudo: yes
+ sudo_user: "{{ mediagoblin_user }}"
+
+- name: Copy mediagoblin config
+ template: src=mediagoblin_local.ini.j2
+ dest=/srv/mediagoblin/src/mediagoblin_local.ini
+
+- name: Copy mediagoblin paste config
+ template: src=paste_local.ini.j2
+ dest=/srv/mediagoblin/src/paste_local.ini
+
+- name: Copy generic mediagoblin nginx site configuration
+ template: src=etc_nginx_sites-available_mediagoblin.j2
+ dest=/etc/nginx/sites-available/mediagoblin
+
+# XXX: TODO: how to create a systemd unit?
+
+- 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?
+