Files
fedora-infra_ansible/roles/web-data-analysis/tasks/main.yml
Kevin Fenzi 1cd00567f2 web-data-analysis: pip is pip3
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-10-28 08:33:02 -07:00

153 lines
4.0 KiB
YAML

---
- name: install python3-pandas package
package: state=present name=python3-pandas
tags:
- packages
- web-data
- name: make sure the /usr/local/share/web-data-analysis exists
file: path=/usr/local/share/web-data-analysis state=directory
tags:
- web-data
- name: make the data directory
file: path=/mnt/fedora_stats/data state=directory mode=0755
tags:
- web-data
- name: make the data subdirs
file: path=/mnt/fedora_stats/data/{{item}} state=directory mode=0755
with_items: [getfedora, hotspot, mirrors, start]
tags:
- web-data
- name: copy over website index.
copy: src=html/main-index.html dest=/var/www/html/index.html mode=0644
tags:
- web-data
- name: make a css tree
file: path=/var/www/html/css/ state=directory mode=0755
tags:
- web-data
- name: css files
copy: src={{item}} dest=/var/www/html/css/ mode=0644
with_items: [ html/css/data-reports.css, html/css/normalize.css ]
tags:
- web-data
- name: make the web directory exists
file: path=/var/www/html/csv-reports/ state=directory mode=0755
tags:
- web-data
- name: make the web subdirs
file: path=/var/www/html/csv-reports/{{item}} state=directory mode=0755
with_items: [images, getfedora, hotspot, mirrors, start]
tags:
- web-data
- name: make the web directory summary.
copy: src=html/summary.html dest=/var/www/html/csv-reports/images/ mode=0644
tags:
- web-data
- name: scripts to condense data down for further processing
copy: src={{item}} dest=/usr/local/bin/ mode=0755
with_items: [condense-mirrorlogs.sh, condense-hotspot.sh ]
tags:
- web-data
- name: python scripts to calculate various data
copy: src={{item}} dest=/usr/local/bin/ mode=0755
with_items: [mirrorlist.py, mirrors-moving_avg.py, hotspot-moving_avg.py]
tags:
- web-data
- name: awk files for csv creation
copy: src={{item}} dest=/usr/local/share/web-data-analysis mode=0644
with_items: [mirrors-data.awk, getfedora-data.awk, getfedora.awk, hotspot-data.awk, hotspot.awk ]
tags:
- web-data
- name: gnuplot file for image creation
copy: src={{item}} dest=/usr/local/share/web-data-analysis mode=0644
with_items: [ mirrors-data.gp, getfedora-data.gp, mirrors-moving.gp, hotspot.gp ]
tags:
- web-data
- name: daily cron file to run the log files
copy: src={{item}} dest=/etc/cron.d/ mode=0644
with_items: [condense-mirrorlogs.cron, condense-hotspot.cron]
tags:
- web-data
- cron
- name: install package deps for mirrors-countme
package:
# tqdm is optional but it gives nice progress meters for interactive use
name: ['python3-pip', 'python3-setuptools', 'python3-tqdm']
state: present
tags:
- packages
- web-data
- name: make countme group
group:
name: countme
tags:
- web-data
- name: make countme user
user:
name: countme
group: countme
shell: /sbin/nologin
home: /srv/countme
comment: "DNF countme counter"
tags:
- web-data
- name: install countme user gitconfig
copy: src=countme.gitconfig dest=/srv/countme/.gitconfig mode=0664 owner=countme group=countme
tags:
- web-data
- name: checkout mirrors-countme from git
git:
repo: https://pagure.io/mirrors-countme
dest: /srv/countme/mirrors-countme
version: prod
register: gitcountme
tags:
- web-data
- name: install mirrors-countme from git checkout
command: "pip3 install --no-index --no-deps /srv/countme/mirrors-countme"
when: "gitcountme is changed"
tags:
- web-data
- name: make countme web subdir
file: path=/var/www/html/csv-reports/countme state=directory mode=0775 owner=countme group=countme
tags:
- web-data
- name: make countme local data dir
file: path=/var/lib/countme state=directory mode=0775 owner=countme group=countme
tags:
- web-data
- name: install countme script to parse new logs & update totals
copy: src=countme-update.sh dest=/usr/local/bin/ mode=0755
tags:
- web-data
- name: install cron file to run countme-update.sh daily
copy: src=countme-update.cron dest=/etc/cron.d/ mode=0644
tags:
- web-data
- cron