From cf0d75bee8eda352be3cbdc234f794831deb5bbf Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Mon, 9 Feb 2015 15:21:19 -0800 Subject: [PATCH] [meta] Install TiddlyWiki from source --- ansible/ec2.yml | 9 +++++++-- ansible/tiddlywiki/handlers.yml | 3 --- ansible/tiddlywiki/tasks.yml | 22 +++++++++++++++++++--- 3 files changed, 26 insertions(+), 8 deletions(-) delete mode 100644 ansible/tiddlywiki/handlers.yml diff --git a/ansible/ec2.yml b/ansible/ec2.yml index b0ccd1a..19834a1 100644 --- a/ansible/ec2.yml +++ b/ansible/ec2.yml @@ -5,13 +5,18 @@ tasks: - apt: update_cache=yes sudo: true - - apt: name=nginx state=present + - apt: name={{ item }} state=present sudo: true + with_items: + - nginx + - git + - file: path=/etc/nginx/sites-enabled/default state=absent sudo: true notify: reload nginx + - include: tiddlywiki/tasks.yml + handlers: - name: reload nginx service: name=nginx state=reloaded - - include: tiddlywiki/handlers.yml diff --git a/ansible/tiddlywiki/handlers.yml b/ansible/tiddlywiki/handlers.yml deleted file mode 100644 index eebf992..0000000 --- a/ansible/tiddlywiki/handlers.yml +++ /dev/null @@ -1,3 +0,0 @@ -- name: restart tiddlywiki - service: name=tiddlywiki state=restarted - sudo: true diff --git a/ansible/tiddlywiki/tasks.yml b/ansible/tiddlywiki/tasks.yml index 4cc07eb..3dbae40 100644 --- a/ansible/tiddlywiki/tasks.yml +++ b/ansible/tiddlywiki/tasks.yml @@ -1,16 +1,32 @@ - include_vars: tiddlywiki/vars.yml.private + - apt: name={{ item }} state=present sudo: true with_items: - nodejs - nodejs-legacy - npm -- npm: name=tiddlywiki global=yes state=present + +# Use TiddlyWiki from source until this fix is released: +# https://github.com/Jermolene/TiddlyWiki5/issues/1474 +# +# - npm: name=tiddlywiki global=yes state=present +# sudo: true +# +- git: repo=https://github.com/Jermolene/TiddlyWiki5.git dest=~/TiddlyWiki5 + notify: restart tiddlywiki +- command: npm link chdir=~{{ user }}/TiddlyWiki5 sudo: true -- file: path=~/tiddlywiki state=directory + +- command: tiddlywiki ~/tiddlywiki --init server + args: + creates: ~/tiddlywiki - copy: src=tiddlywiki/nginx.conf dest=/etc/nginx/conf.d/tiddlywiki.conf sudo: true notify: reload nginx - template: src=tiddlywiki/upstart.conf.j2 dest=/etc/init/tiddlywiki.conf sudo: true - notify: restart tiddlywiki + +- name: restart tiddlywiki + service: name=tiddlywiki state=restarted + sudo: true