ansible-roles/google-openrefine/tasks/main.yml

40 lines
1.6 KiB
YAML

---
- block:
- name: Create the openrefine user
user: name={{ openrefine_user }} home={{ openrefine_user_home }} createhome=no shell=/usr/sbin/nologin system=yes
- name: Create the openrefine home, if it does not already exist.
file: dest={{ openrefine_user_home }} owner=root group=root state=directory recurse=yes
- name: Create the openrefine data and logs directories
file: dest={{ item }} owner={{ openrefine_user }} group={{ openrefine_user }} state=directory recurse=yes
with_items:
- '{{ openrefine_data_dir }}'
- '{{ openrefine_log_dir }}'
- name: Download openrefine
unarchive: remote_src=yes src={{ openrefine_download_url }} dest={{ openrefine_user_home }}
args:
creates: '{{ openrefine_user_home }}/{{ openrefine_distribution_prefix }}-{{ openrefine_version }}'
- name: Install the openrefine configuration
template: src=refine.ini dest={{ openrefine_user_home }}/{{ openrefine_distribution_prefix }}-{{ openrefine_version }}/refine.ini owner=root group=root mode=0644
notify: Restart openrefine
- name: Install the openrefine upstart init script
template: src=openrefine.conf.j2 dest=/etc/init/openrefine.conf owner=root group=root mode=0644
when: ansible_service_mgr != 'systemd'
- name: Ensure that the service is running and enabled
service: name=openrefine state=started enabled=yes
when: openrefine_enabled
tags: [ 'openrefine', 'google_openrefine' ]
- block:
- name: Ensure that the service is running and enabled
service: name=openrefine state=stopped enabled=no
when: not openrefine_enabled
tags: [ 'openrefine', 'google_openrefine' ]