1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/sugarizer/tasks/main.yml
georgejhunt f319afa432 Test (#20)
* change apache_data to apache_user in all

* no libapach2 in centos. just php. no php-magick in centos

* remove redundant vars entries

* do not create apache user

* missed one pound sign

* soft code all references to apache_user

* centos requires older setuptools

* revert ansible_lsb.id in xsce.yml

* try getting recent pip

* move pip download to 2prep so that kalite success is not dependent on iiab coming first

* still need to replace setuptools in kalite

* add curl -- needed in debian

* massivly substitue iiab for xsce, and rename files

* completed runansible

* centos fixes,install  pip

* appliance means no iptables rules

* change to earlier version of setuptools for centos

* delete file duplicate, hopefully unnecessary. generate the offline docs

* wiki docs errors

* create the admin group -- deleted earlier

* use the --yes option with pip uninstall

* base of repo moved from schoolserver to iiab, unleashkids.org->iiab.io

* network detection broken due to tupo
2017-06-09 16:25:56 -07:00

80 lines
2.6 KiB
YAML

- name: Download the latest stable version of sugarizer from location under our control
get_url: url={{ iiab_download_url }}/{{ sugarizer_version }}.tar.gz
dest={{ downloads_dir }}/{{ sugarizer_version }}.tar.gz
- name: Untar it to target location
command: tar xzf {{ downloads_dir }}/{{ sugarizer_version }}.tar.gz -C {{ sugarizer_location }}
- name: Create a symbolic link from generic url to version specific location
file: dest={{ sugarizer_location }}/sugarizer
src={{ sugarizer_location }}/{{ sugarizer_version }}
state=link
- name: Install sugarizer required packages
package: name={{ item }}
state=present
with_items:
- nodejs
- npm
when: not {{ use_cache }} and not {{ no_network }}
tags:
- download
- name: Create systemd files and copy our ini file
template: src={{ item.src }}
dest={{ item.dest }}
owner=root
group=root
mode=0644
with_items:
- { src: 'sugarizer.service.j2' , dest: '/etc/systemd/system/sugarizer.service'}
- { src: 'sugarizer.ini' , dest: '{{ sugarizer_location }}/sugarizer/server' }
# - { src: 'sugarizer.conf' , dest: '/etc/apache2/sites-available' }
#- name: Create the symlink enabling the rewrite
# file: src=/etc/apache2/sites-available/sugarizer.conf
# dest=/etc/apache2/sites-enabled/sugarizer.conf
# state=link
- name: Create the express framework for node.js
shell: npm install
args:
chdir: "{{ sugarizer_location }}/sugarizer/server"
creates: "{{ sugarizer_location }}/sugarizer/server/node_modules"
when: not is_F18
- name: Create the express framework for node.js
shell: npm install
args:
chdir: "{{ sugarizer_location }}/sugarizer/server"
when: is_F18
- name: enable services
service: name={{ item.name }}
enabled=yes
state=restarted
with_items:
- { name: sugarizer }
when: sugarizer_enabled
- name: disable services
service: name={{ item.name }}
enabled=no
state=stopped
with_items:
- { name: sugarizer }
when: not sugarizer_enabled
- name: add sugarizer to service list
ini_file: dest='{{ service_filelist }}'
section=sugarizer
option='{{ item.option }}'
value='"{{ item.value }}"'
with_items:
- option: name
value: Sugarizer
- option: description
value: '"The Sugar Learning Platform is a leading learning platform that began in the famous One Laptop Per Child project. Sugarizer is a web implementation of that platform"'
- option: enabled
value: "{{ sugarizer_enabled }}"