Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.4 KiB

---
- name: Install dependencies
yum:
name:
- java-11-openjdk
tags: metabase
- name: Stop the service during upgrades
service: name=metabase state=stopped
when: metabase_install_mode == 'upgrade'
tags: metabase
- when: metabase_install_mode != 'none'
block:
- name: Download metabase JAR file
get_url:
url: "{{ metabase_jar_url }}"
dest: "{{ metabase_root_dir }}/tmp/"
checksum: sha1:{{ metabase_jar_sha1 }}
- name: Move the JAR to the app dir
copy: src={{ metabase_root_dir }}/tmp/metabase.jar dest={{ metabase_root_dir }}/app/ mode=644 remote_src=True
notify: restart metabase
tags: metabase
- name: Deploy systemd unit
template: src=metabase.service.j2 dest=/etc/systemd/system/metabase.service
register: metabase_unit
notify: restart metabase
tags: metabase
- name: Reload systemd
systemd: daemon_reload=True
when: metabase_unit.changed
tags: metabase
# Create the database
- import_tasks: ../includes/webapps_create_mysql_db.yml
vars:
- db_name: "{{ metabase_db_name }}"
- db_user: "{{ metabase_db_user }}"
- db_server: "{{ metabase_db_server }}"
- db_pass: "{{ metabase_db_pass }}"
tags: metabase
- name: Install pre and post backup hooks
template: src={{ item }}-backup.j2 dest=/etc/backup/{{ item }}.d/metabase mode=700
loop:
- pre
- post
tags: metabase