mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge branch 'calibre3' into calibre312
This commit is contained in:
commit
7435fa9b00
2 changed files with 59 additions and 43 deletions
|
@ -3,6 +3,8 @@
|
||||||
path: "{{ calibre_dbpath }}/metadata.db"
|
path: "{{ calibre_dbpath }}/metadata.db"
|
||||||
register: calibre_db
|
register: calibre_db
|
||||||
|
|
||||||
|
# INSTALL THE LATEST CALIBRE (calibre-server etc) ON ALL OS'S - RUNS IF /usr/bin/calibre-uninstall DOES NOT ALEADY EXIST
|
||||||
|
|
||||||
- name: Install Calibre via calibre-installer.py
|
- name: Install Calibre via calibre-installer.py
|
||||||
include_tasks: installer.yml
|
include_tasks: installer.yml
|
||||||
when: not calibre_db.stat.exists and (is_redhat or is_ubuntu)
|
when: not calibre_db.stat.exists and (is_redhat or is_ubuntu)
|
||||||
|
@ -11,10 +13,14 @@
|
||||||
include_tasks: debs.yml
|
include_tasks: debs.yml
|
||||||
when: not calibre_db.stat.exists and is_debian
|
when: not calibre_db.stat.exists and is_debian
|
||||||
|
|
||||||
|
# CREATE CALIBRE DATABASE WITH A SAMPLE BOOK
|
||||||
|
|
||||||
- name: Install Calibre - All
|
- name: Install Calibre - All
|
||||||
include_tasks: config-db.yml
|
include_tasks: config-db.yml
|
||||||
when: not calibre_db.stat.exists
|
when: not calibre_db.stat.exists
|
||||||
|
|
||||||
|
# WRAP UP CALIBRE INSTALLATION
|
||||||
|
|
||||||
- name: Create calibre-serve.service and calibre.conf
|
- name: Create calibre-serve.service and calibre.conf
|
||||||
template:
|
template:
|
||||||
backup: no
|
backup: no
|
||||||
|
@ -26,7 +32,6 @@
|
||||||
with_items:
|
with_items:
|
||||||
- { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'}
|
- { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'}
|
||||||
- { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'}
|
- { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'}
|
||||||
when: calibre_enabled
|
|
||||||
|
|
||||||
# http://box:8080 & http://box:8080/mobile WORK BUT OTHER URL'S LIKE http://box/books ARE A MESS (BOOKS RARELY DISPLAY)
|
# http://box:8080 & http://box:8080/mobile WORK BUT OTHER URL'S LIKE http://box/books ARE A MESS (BOOKS RARELY DISPLAY)
|
||||||
- name: Create calibre.conf link for UNTESTED http://box/books etc (debuntu)
|
- name: Create calibre.conf link for UNTESTED http://box/books etc (debuntu)
|
||||||
|
@ -34,7 +39,7 @@
|
||||||
src: /etc/apache2/sites-available/calibre.conf
|
src: /etc/apache2/sites-available/calibre.conf
|
||||||
dest: /etc/apache2/sites-enabled/calibre.conf
|
dest: /etc/apache2/sites-enabled/calibre.conf
|
||||||
state: link
|
state: link
|
||||||
when: calibre_enabled and is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- name: Enable Calibre service -- runs calibre-server by Kovid Goyal
|
- name: Enable Calibre service -- runs calibre-server by Kovid Goyal
|
||||||
service:
|
service:
|
||||||
|
@ -73,4 +78,4 @@
|
||||||
- option: port
|
- option: port
|
||||||
value: "{{ calibre_port }}"
|
value: "{{ calibre_port }}"
|
||||||
- option: enabled
|
- option: enabled
|
||||||
value: "{{ calibre_enabled }}"
|
value: "{{ calibre_enabled }}"
|
|
@ -1,31 +1,38 @@
|
||||||
- name: Download the latest stable version of Sugarizer from location under our control
|
- name: Download latest stable Sugarizer from location we control
|
||||||
get_url: url={{ iiab_download_url }}/{{ sugarizer_version }}.tar.gz
|
get_url:
|
||||||
dest={{ downloads_dir }}/{{ sugarizer_version }}.tar.gz
|
url: "{{ iiab_download_url }}/{{ sugarizer_version }}.tar.gz"
|
||||||
|
dest: "{{ downloads_dir }}/{{ sugarizer_version }}.tar.gz"
|
||||||
|
|
||||||
#fixme
|
- name: Untar to /library/www/html/{{ sugarizer_version }}
|
||||||
- name: Untar it to target location
|
unarchive:
|
||||||
command: tar xzf {{ downloads_dir }}/{{ sugarizer_version }}.tar.gz -C {{ sugarizer_location }}
|
src: "{{ downloads_dir }}/{{ sugarizer_version }}.tar.gz"
|
||||||
creates="{{ sugarizer_location }}/{{ sugarizer_version }}/index.html"
|
dest: "{{ sugarizer_location }}"
|
||||||
|
creates: "{{ sugarizer_location }}/{{ sugarizer_version }}/index.html"
|
||||||
|
# command: tar xzf {{ downloads_dir }}/{{ sugarizer_version }}.tar.gz -C {{ sugarizer_location }}
|
||||||
|
# creates="{{ sugarizer_location }}/{{ sugarizer_version }}/index.html"
|
||||||
|
|
||||||
- name: Create a symbolic link from generic url to version specific location
|
- name: Create symbolic link /library/www/html/sugarizer
|
||||||
file: dest={{ sugarizer_location }}/sugarizer
|
file:
|
||||||
src={{ sugarizer_location }}/{{ sugarizer_version }}
|
src: "{{ sugarizer_location }}/{{ sugarizer_version }}"
|
||||||
state=link
|
dest: "{{ sugarizer_location }}/sugarizer"
|
||||||
|
state: link
|
||||||
|
|
||||||
- name: Set up Node.js 6.x apt sources (debuntu)
|
- name: Set up Node.js 6.x apt sources (debuntu)
|
||||||
shell: curl -sL https://deb.nodesource.com/setup_6.x | bash -
|
shell: curl -sL https://deb.nodesource.com/setup_6.x | bash -
|
||||||
when: internet_available and is_debuntu
|
when: internet_available and is_debuntu
|
||||||
|
|
||||||
- name: Install latest Node.js which includes /usr/bin/npm (debuntu)
|
- name: Install latest Node.js which includes /usr/bin/npm (debuntu)
|
||||||
package: name=nodejs
|
package:
|
||||||
state=latest
|
name: nodejs
|
||||||
|
state: latest
|
||||||
# package: name=nodejs=6.*
|
# package: name=nodejs=6.*
|
||||||
# state=present
|
# state=present
|
||||||
when: internet_available and is_debuntu
|
when: internet_available and is_debuntu
|
||||||
|
|
||||||
- name: Install npm (OS's other than debuntu)
|
- name: Install npm (OS's other than debuntu)
|
||||||
package: name={{ item }}
|
package:
|
||||||
state=present
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
when: internet_available and not is_debuntu
|
when: internet_available and not is_debuntu
|
||||||
with_items:
|
with_items:
|
||||||
- nodejs
|
- nodejs
|
||||||
|
@ -42,11 +49,12 @@
|
||||||
when: npm.stat.exists is defined and npm.stat.exists
|
when: npm.stat.exists is defined and npm.stat.exists
|
||||||
|
|
||||||
- name: Create systemd files and copy our ini file
|
- name: Create systemd files and copy our ini file
|
||||||
template: src={{ item.src }}
|
template:
|
||||||
dest={{ item.dest }}
|
src: "{{ item.src }}"
|
||||||
owner=root
|
dest: "{{ item.dest }}"
|
||||||
group=root
|
owner: root
|
||||||
mode=0644
|
group: root
|
||||||
|
mode: 0644
|
||||||
with_items:
|
with_items:
|
||||||
- { src: 'sugarizer.service.j2' , dest: '/etc/systemd/system/sugarizer.service'}
|
- { src: 'sugarizer.service.j2' , dest: '/etc/systemd/system/sugarizer.service'}
|
||||||
- { src: 'sugarizer.ini' , dest: '{{ sugarizer_location }}/sugarizer/server' }
|
- { src: 'sugarizer.ini' , dest: '{{ sugarizer_location }}/sugarizer/server' }
|
||||||
|
@ -58,43 +66,46 @@
|
||||||
# state=link
|
# state=link
|
||||||
|
|
||||||
- name: Create the express framework for Node.js (OS's other than Fedora 18)
|
- name: Create the express framework for Node.js (OS's other than Fedora 18)
|
||||||
shell: npm install
|
shell: npm install
|
||||||
args:
|
args:
|
||||||
chdir: "{{ sugarizer_location }}/sugarizer/server"
|
chdir: "{{ sugarizer_location }}/sugarizer/server"
|
||||||
creates: "{{ sugarizer_location }}/sugarizer/server/node_modules"
|
creates: "{{ sugarizer_location }}/sugarizer/server/node_modules"
|
||||||
when: not is_F18 and not npm_exists
|
when: not is_F18 and not npm_exists
|
||||||
|
|
||||||
- name: Create the express framework for Node.js (Fedora 18)
|
- name: Create the express framework for Node.js (Fedora 18)
|
||||||
shell: npm install
|
shell: npm install
|
||||||
args:
|
args:
|
||||||
chdir: "{{ sugarizer_location }}/sugarizer/server"
|
chdir: "{{ sugarizer_location }}/sugarizer/server"
|
||||||
when: is_F18 and not npm_exists
|
when: is_F18 and not npm_exists
|
||||||
|
|
||||||
- name: Enable services (all OS's)
|
- name: Enable services (all OS's)
|
||||||
service: name={{ item.name }}
|
service:
|
||||||
enabled=yes
|
name: "{{ item.name }}"
|
||||||
state=restarted
|
enabled: yes
|
||||||
|
state: restarted
|
||||||
with_items:
|
with_items:
|
||||||
- { name: sugarizer }
|
- { name: sugarizer }
|
||||||
when: sugarizer_enabled
|
when: sugarizer_enabled
|
||||||
|
|
||||||
- name: Disable services (all OS's)
|
- name: Disable services (all OS's)
|
||||||
service: name={{ item.name }}
|
service:
|
||||||
enabled=no
|
name: "{{ item.name }}"
|
||||||
state=stopped
|
enabled: no
|
||||||
|
state: stopped
|
||||||
with_items:
|
with_items:
|
||||||
- { name: sugarizer }
|
- { name: sugarizer }
|
||||||
when: not sugarizer_enabled
|
when: not sugarizer_enabled
|
||||||
|
|
||||||
- name: Add 'sugarizer' to service list
|
- name: Add 'sugarizer' to service list in /etc/iiab/iiab.ini
|
||||||
ini_file: dest="{{ service_filelist }}"
|
ini_file:
|
||||||
section=sugarizer
|
dest: "{{ service_filelist }}"
|
||||||
option="{{ item.option }}"
|
section: sugarizer
|
||||||
value="{{ item.value }}"
|
option: "{{ item.option }}"
|
||||||
|
value: "{{ item.value }}"
|
||||||
with_items:
|
with_items:
|
||||||
- option: name
|
- option: name
|
||||||
value: Sugarizer
|
value: Sugarizer
|
||||||
- option: description
|
- option: description
|
||||||
value: '"The Sugar Learning Platform began with the famous One Laptop Per Child project, written in Python. Sugarizer is the new HTML/JavaScript implementation of Sugar, usable in most all browsers."'
|
value: '"The Sugar Learning Platform began with the famous One Laptop Per Child project, written in Python. Sugarizer is the new HTML/JavaScript implementation of Sugar, usable in most all browsers."'
|
||||||
- option: enabled
|
- option: enabled
|
||||||
value: "{{ sugarizer_enabled }}"
|
value: "{{ sugarizer_enabled }}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue