Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions roles/fstat/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
---
- user: name={{user}}
sudo: yes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sudo is not needed, the playbook is executed as root.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I would prefer to use full yaml form (ie, name: rather than name=)


- name: Install required packages
package:
yum:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep package, so the role is portable (like, on Fedora that use dnf)

state: present
name: "{{ item }}"
with_items:
- python-virtualenv
- gcc
- git
- python-virtualenv
- gcc
- git

# TODO create the directory /fstat, do the git checkout
# automate update
# set configuration file, and database creation
# TODO set configuration file, and database creation
# and selinux boolean

- name: create fstat directory
file: path=/fstat/code state=directory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use full yaml style here too.


- name: create virtualenv if it does not exists
command: virtualenv /fstat/venv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command will be run each time, I think that's suboptimal, shouldn't it verify that ?


- name: clone or update fstat repo
git:
repo: https://github.com/gluster/fstat
dest: /fstat/code

- name: install dependencies
pip:
requirements=/fstat/code/requirements.txt
virtualenv=/fstat/venv

- name: Add tmpfiles snippet
template:
dest: /etc/tmpfiles.d/fstat.conf
Expand All @@ -37,7 +55,7 @@
name: fstat {{item.name}}
minute: "0"
hour: "1"
job: "/fstat/env/bin/python /fstat/code/manage.py process_jobs -n 3 -j {{item.job}}"
job: "/fstat/venv/bin/python /fstat/code/manage.py process_jobs -n 3 -j {{item.job}}"
with_items:
- { name: 'centos', job: 'centos6-regression' }
- { name: 'netbsd', job: 'netbsd7-regression' }
Expand Down