ansible-role-orientdb/tasks/main.yml

53 lines
1.7 KiB
YAML

---
- name: Manage the OrientDB installation
ansible.builtin.import_tasks: orientdb_install.yml
- name: Clean up the OrientDB backups
ansible.builtin.import_tasks: orientdb_backups.yml
- name: OrientDB monitoring
ansible.builtin.import_tasks: orientdb_monitoring.yml
when: orientdb_enabled
- name: OrientDB certificates via Letsencrypt
ansible.builtin.import_tasks: orientdb_letsencrypt.yml
when: orientdb_install
- name: OrientDB removal
ansible.builtin.import_tasks: orientdb_removal.yml
when: not orientdb_install
- name: Manage the OrientDB service
tags: ['orientdb']
when: orientdb_install
block:
- name: Install the orientdb SYSV startup script
ansible.builtin.template:
src: orientdb.init.j2
dest: /etc/init.d/orientdb
owner: root
group: root
mode: "0755"
tags: ['orientdb', 'orientdb_init']
when: ansible_service_mgr != 'systemd'
- name: Install the orientdb systemd unit
ansible.builtin.template:
src: orientdb.service.j2
dest: /etc/systemd/system/orientdb.service
owner: root
group: root
mode: "0644"
tags: ['orientdb', 'orientdb_init']
when: ansible_service_mgr == 'systemd'
notify: Reload systemd
- name: Reload the systemd service
ansible.builtin.meta: flush_handlers
- name: Ensure that the service is enabled and running
ansible.builtin.service:
name: orientdb
state: started
enabled: true
when: orientdb_enabled
- name: Ensure that the service is stopped and disabled
ansible.builtin.service:
name: orientdb
state: stopped
enabled: false
when: not orientdb_enabled