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
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[main]
|
||||
db_user=statsconso
|
||||
db_pass=statsconso
|
||||
db_name=statsconso
|
||||
db_dialect=postgresql
|
||||
|
||||
rrd_path=/library/sugar-stats/rrd/
|
||||
log_path=/var/log/statistics-consolidation
|
||||
log_level=debug
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
0 3 * * * root stats_consolidation_run --config_file /etc/stats-consolidation.conf
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
/var/log/statistics-consolidation/stats-consolidation.log {
|
||||
daily
|
||||
rotate 5
|
||||
weekly
|
||||
missingok
|
||||
create 0600 sugar-stats sugar-stats
|
||||
notifempty
|
||||
compress
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
[stats]
|
||||
# enable stats collecting
|
||||
stats = True
|
||||
# path to SSL certificate to serve stats server via HTTPS
|
||||
stats-certfile =
|
||||
# space separated list of RRAs for RRD databases on client side
|
||||
stats-client-rras = RRA:AVERAGE:0.5:1:4320 RRA:AVERAGE:0.5:5:2016
|
||||
# path to SSL certificate keyfile to serve stats server via HTTPS
|
||||
stats-keyfile =
|
||||
# path to the root directory to place stats
|
||||
stats-root = /library/sugar-stats/rrd
|
||||
# space separated list of RRAs for RRD databases on a server side
|
||||
stats-server-rras = RRA:AVERAGE:0.5:1:10080 RRA:AVERAGE:0.5:5:8928 RRA:AVERAGE:0.5:15:35040
|
||||
# step interval in seconds for RRD databases
|
||||
stats-step = 60
|
||||
|
||||
[active-document]
|
||||
# path to the root directory to place documents' data and indexes
|
||||
data-root = /library/sugar-stats/users
|
||||
# limit the resulting list for search requests
|
||||
find-limit = 32
|
||||
# flush index every specified changes
|
||||
index-flush-threshold = 32
|
||||
# flush index index after specified seconds since the last change
|
||||
index-flush-timeout = 60
|
||||
# for concurent access, run index writer in separate thread; this option
|
||||
# specifies the writer's queue size; 0 means not threading the writer
|
||||
index-write-queue = 256
|
||||
|
||||
[main]
|
||||
# debug logging level; multiple argument
|
||||
debug = 0
|
||||
# hostname to listen incomming connections
|
||||
host = 0.0.0.0
|
||||
# path to the directory to place log files
|
||||
logdir = /var/log/sugar-stats
|
||||
# port number to listen incomming connections
|
||||
port = 8000
|
||||
# path to the directory to place pid files
|
||||
rundir = /library/sugar-stats
|
||||
# switch off user credentials check; disabling this option will require
|
||||
# OpenSSH-5.6 or later.
|
||||
trust-users = False
|
||||
Loading…
Add table
Add a link
Reference in a new issue