mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Move 19 roles into roles/0-DEPRECATED-ROLES
This commit is contained in:
parent
0e39c42bbd
commit
2218d2334b
124 changed files with 5 additions and 1 deletions
56
roles/0-DEPRECATED-ROLES/sugar-stats/tasks/main.yml
Normal file
56
roles/0-DEPRECATED-ROLES/sugar-stats/tasks/main.yml
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
- name: Install sugar-stats required packages
|
||||
package: name={{ item }}
|
||||
state=present
|
||||
with_items:
|
||||
- sugar-stats-server
|
||||
- active-document
|
||||
- restful-document
|
||||
- python-xappy
|
||||
#tags: download
|
||||
|
||||
- name: Create sugar-stats directory tree
|
||||
file: path={{ item }}
|
||||
owner=sugar-stats
|
||||
group=sugar-stats
|
||||
mode=0755
|
||||
state=directory
|
||||
with_items:
|
||||
- /library/sugar-stats/
|
||||
- /library/sugar-stats/rrd
|
||||
- /library/sugar-stats/users
|
||||
|
||||
- name: Copy sugar-stats config file
|
||||
template: backup=yes
|
||||
src=sugar-stats.conf.j2
|
||||
dest=/etc/sugar-stats.conf
|
||||
owner=sugar-stats
|
||||
group=sugar-stats
|
||||
mode=0644
|
||||
|
||||
- name: Enable sugar-stats service
|
||||
service: name=sugar-stats-server
|
||||
enabled=yes
|
||||
when: sugar_stats_enabled | bool
|
||||
|
||||
- name: Disable sugar-stats service
|
||||
service: name=sugar-stats-server
|
||||
enabled=no
|
||||
when: not sugar_stats_enabled
|
||||
|
||||
- include_tasks: statistics-consolidation.yml
|
||||
|
||||
- name: Add 'sugar-stats' variable values to {{ iiab_ini_file }}
|
||||
ini_file:
|
||||
path: "{{ iiab_ini_file }}"
|
||||
section: sugar_stats
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value | string }}"
|
||||
with_items:
|
||||
- option: name
|
||||
value: sugar_stats
|
||||
- option: description
|
||||
value: '"Collect Sugar statistics, originally written by Alexy Lim, see: http://wiki.sugarlabs.org/go/Platform_Team/Usage_Statistics"'
|
||||
- option: installed
|
||||
value: "{{ sugar_stats_install }}"
|
||||
- option: enabled
|
||||
value: "{{ sugar_stats_enabled }}"
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
- name: Install python-pip package
|
||||
package: name=python-pip
|
||||
state=present
|
||||
|
||||
- name: Install statistics-consolidation with pip
|
||||
pip: name=stats-consolidation version=2.1.2
|
||||
when: internet_available | bool
|
||||
|
||||
- name: Install required libraries
|
||||
package: name={{ item }}
|
||||
state=present
|
||||
with_items:
|
||||
- rrdtool-python
|
||||
- python-sqlalchemy
|
||||
- python-psycopg2
|
||||
|
||||
- name: Enable postgresl access by md5 method
|
||||
lineinfile: backup=yes
|
||||
dest=/library/pgsql-iiab/pg_hba.conf
|
||||
regexp="^host\s+statsconso"
|
||||
line="host statsconso statsconso samehost md5"
|
||||
state=present
|
||||
insertafter="^# IPv4 local connections"
|
||||
owner=postgres
|
||||
group=postgres
|
||||
|
||||
- name: Restart postgresql service
|
||||
service: name=postgresql-iiab
|
||||
state=restarted
|
||||
|
||||
- name: Create postgres user
|
||||
postgresql_user: user=statsconso password=statsconso
|
||||
become: yes
|
||||
become_user: postgres
|
||||
|
||||
- name: Create postgres database
|
||||
postgresql_db: db=statsconso owner=statsconso
|
||||
sudo: yes
|
||||
sudo_user: postgres
|
||||
|
||||
- name: Install conf file
|
||||
template: backup=yes
|
||||
src=statistics-consolidation/stats-consolidation.conf
|
||||
dest=/etc/stats-consolidation.conf
|
||||
owner=root
|
||||
group=root
|
||||
mode=0644
|
||||
|
||||
- name: Create log directory
|
||||
file: path=/var/log/statistics-consolidation
|
||||
state=directory
|
||||
group=sugar-stats
|
||||
owner=sugar-stats
|
||||
mode=0755
|
||||
|
||||
- name: Enable logrotate
|
||||
template: backup=yes
|
||||
src=statistics-consolidation/stats-consolidation.logrotate
|
||||
dest=/etc/logrotate.d/stats-consolidation
|
||||
group=root
|
||||
owner=root
|
||||
mode=0644
|
||||
|
||||
- name: Install cron file
|
||||
template: backup=yes
|
||||
src=statistics-consolidation/stats-consolidation.cron
|
||||
dest=/etc/cron.d/stats-consolidation
|
||||
owner=root
|
||||
group=root
|
||||
mode=0644
|
||||
Loading…
Add table
Add a link
Reference in a new issue