Clean up some files. Enforce the jdk version.
This commit is contained in:
parent
c7f933ea9e
commit
2a3375764e
|
@ -6,16 +6,18 @@ orientdb_archive_commpression: tar.gz
|
||||||
orientdb_dir: 'orientdb-community'
|
orientdb_dir: 'orientdb-community'
|
||||||
orientdb_tar_filename: '{{ orientdb_dir }}-{{ orientdb_version }}'
|
orientdb_tar_filename: '{{ orientdb_dir }}-{{ orientdb_version }}'
|
||||||
orientdb_tar_file: '{{ orientdb_tar_filename }}.{{ orientdb_archive_commpression }}'
|
orientdb_tar_file: '{{ orientdb_tar_filename }}.{{ orientdb_archive_commpression }}'
|
||||||
|
orientdb_jdk_version: 8
|
||||||
# Pre 3.2.5
|
# Pre 3.2.5
|
||||||
# orientdb_binary_distribution_url: 'https://s3.us-east-2.amazonaws.com/orientdb3/releases/{{ orientdb_version }}/{{ orientdb_tar_file }}'
|
# orientdb_binary_distribution_url: 'https://s3.us-east-2.amazonaws.com/orientdb3/releases/{{ orientdb_version }}/{{ orientdb_tar_file }}'
|
||||||
orientdb_binary_distribution_url: 'https://repo1.maven.org/maven2/com/orientechnologies/{{ orientdb_dir }}/{{ orientdb_version }}/{{ orientdb_tar_file }}'
|
orientdb_binary_distribution_url: 'https://repo1.maven.org/maven2/com/orientechnologies/{{ orientdb_dir }}/{{ orientdb_version }}/{{ orientdb_tar_file }}'
|
||||||
orientdb_user: orientdb
|
orientdb_user: orientdb
|
||||||
orientdb_log_dir: /var/log/orientdb
|
orientdb_log_dir: /var/log/orientdb
|
||||||
orientdb_log_level: INFO
|
orientdb_log_level: INFO
|
||||||
orientdb_home_prefix: /home
|
orientdb_home_prefix: /srv
|
||||||
|
orientdb_data_dir: /srv/orientdb_databases
|
||||||
orientdb_base_dir: '{{ orientdb_home_prefix }}/{{ orientdb_user }}'
|
orientdb_base_dir: '{{ orientdb_home_prefix }}/{{ orientdb_user }}'
|
||||||
orientdb_install_dir: '{{ orientdb_base_dir }}/{{ orientdb_dir }}'
|
orientdb_install_dir: '{{ orientdb_base_dir }}/{{ orientdb_dir }}'
|
||||||
orientdb_data_dir: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/databases'
|
orientdb_link_to_data_dir: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/databases'
|
||||||
orientdb_pid_dir: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/pid'
|
orientdb_pid_dir: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/pid'
|
||||||
orientdb_configuration_files:
|
orientdb_configuration_files:
|
||||||
- orientdb-server-log.properties
|
- orientdb-server-log.properties
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: Andrea Dell'Amico
|
author: Andrea Dell'Amico
|
||||||
description: Systems Architect
|
description: Role that installs OrientDB
|
||||||
company: ISTI-CNR
|
company: ISTI-CNR
|
||||||
|
namespace: adellam
|
||||||
issue_tracker_url: https://redmine-s2i2s.isti.cnr.it/projects/provisioning
|
role_name: orientdb
|
||||||
|
|
||||||
license: EUPL 1.2+
|
license: EUPL 1.2+
|
||||||
|
|
||||||
min_ansible_version: 2.8
|
min_ansible_version: "2.15"
|
||||||
|
|
||||||
# To view available platforms and versions (or releases), visit:
|
# To view available platforms and versions (or releases), visit:
|
||||||
# https://galaxy.ansible.com/api/v1/platforms/
|
# https://galaxy.ansible.com/api/v1/platforms/
|
||||||
|
@ -15,11 +14,9 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
- Trusty
|
|
||||||
- bionic
|
- bionic
|
||||||
- name: EL
|
- focal
|
||||||
versions:
|
- jammy
|
||||||
- 7
|
|
||||||
|
|
||||||
galaxy_tags:
|
galaxy_tags:
|
||||||
- orientdb
|
- orientdb
|
||||||
|
|
299
tasks/main.yml
299
tasks/main.yml
|
@ -1,94 +1,125 @@
|
||||||
---
|
---
|
||||||
- block:
|
- name: OrientDB installation
|
||||||
|
tags: ['orientdb']
|
||||||
|
when: orientdb_install
|
||||||
|
block:
|
||||||
- name: Create the orientdb user
|
- name: Create the orientdb user
|
||||||
user: name={{ orientdb_user }} home={{ orientdb_base_dir }} createhome=yes shell=/bin/bash
|
ansible.builtin.user:
|
||||||
|
name: "{{ orientdb_user }}"
|
||||||
|
home: "{{ orientdb_base_dir }}"
|
||||||
|
createhome: false
|
||||||
|
shell: /bin/bash
|
||||||
|
- name: Create the orientdb directories
|
||||||
|
ansible.builtin.file:
|
||||||
|
dest: "{{ item }}"
|
||||||
|
owner: "{{ orientdb_user }}"
|
||||||
|
group: "{{ orientdb_user }}"
|
||||||
|
mode: "0750"
|
||||||
|
loop:
|
||||||
|
- "{{ orientdb_base_dir }}"
|
||||||
|
- "{{ orientdb_data_dir }}"
|
||||||
- name: Get the orientdb distribution
|
- name: Get the orientdb distribution
|
||||||
get_url: url={{ orientdb_binary_distribution_url }} dest={{ orientdb_base_dir }}/{{ orientdb_tar_file }} validate_certs=no
|
ansible.builtin.get_url:
|
||||||
|
url: "{{ orientdb_binary_distribution_url }}"
|
||||||
|
dest: "{{ orientdb_base_dir }}/{{ orientdb_tar_file }}"
|
||||||
|
validate_certs: false
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0444"
|
||||||
- name: Unpack the orientdb distribution
|
- name: Unpack the orientdb distribution
|
||||||
unarchive:
|
ansible.builtin.unarchive:
|
||||||
src: '{{ orientdb_base_dir }}/{{ orientdb_tar_file }}'
|
src: '{{ orientdb_base_dir }}/{{ orientdb_tar_file }}'
|
||||||
dest: '{{ orientdb_base_dir }}'
|
dest: '{{ orientdb_base_dir }}'
|
||||||
copy: no
|
copy: false
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
args:
|
args:
|
||||||
creates: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/{{ orientdb_dir }}-{{ orientdb_version }}'
|
creates: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/{{ orientdb_dir }}-{{ orientdb_version }}'
|
||||||
|
- name: Create some directories inside the orientdb user home
|
||||||
- name: Create the needed directory inside the orientdb user home
|
become: true
|
||||||
become: True
|
|
||||||
become_user: '{{ orientdb_user }}'
|
become_user: '{{ orientdb_user }}'
|
||||||
file: dest={{ item }} state=directory mode=0750
|
ansible.builtin.file:
|
||||||
|
dest: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
mode: "0750"
|
||||||
loop:
|
loop:
|
||||||
- '{{ orientdb_data_dir }}'
|
|
||||||
- '{{ orientdb_pid_dir }}'
|
- '{{ orientdb_pid_dir }}'
|
||||||
- '{{ orientdb_automatic_backup_directory }}'
|
- '{{ orientdb_automatic_backup_directory }}'
|
||||||
|
- name: Link to the databases directory
|
||||||
|
become: true
|
||||||
|
become_user: '{{ orientdb_user }}'
|
||||||
|
ansible.builtin.file:
|
||||||
|
src: "{{ orientdb_data_dir }}"
|
||||||
|
dest: "{{ orientdb_link_to_data_dir }}"
|
||||||
|
state: link
|
||||||
- name: Remove the demodb database
|
- name: Remove the demodb database
|
||||||
file:
|
ansible.builtin.file:
|
||||||
dest: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/{{ orientdb_dir }}-{{ orientdb_version }}/databases/demodb'
|
dest: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/{{ orientdb_dir }}-{{ orientdb_version }}/databases/demodb'
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Link to the latest version
|
- name: Link to the latest version
|
||||||
become: True
|
become: true
|
||||||
become_user: '{{ orientdb_user }}'
|
become_user: '{{ orientdb_user }}'
|
||||||
file:
|
ansible.builtin.file:
|
||||||
src: '{{ orientdb_tar_filename }}'
|
src: '{{ orientdb_tar_filename }}'
|
||||||
dest: '{{ orientdb_install_dir }}'
|
dest: '{{ orientdb_install_dir }}'
|
||||||
state: link
|
state: link
|
||||||
|
|
||||||
- name: Create a link to the data directory
|
- name: Create a link to the data directory
|
||||||
file:
|
ansible.builtin.file:
|
||||||
src: '{{ orientdb_data_dir }}'
|
src: '{{ orientdb_data_dir }}'
|
||||||
dest: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/{{ orientdb_dir }}-{{ orientdb_version }}/databases'
|
dest: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/{{ orientdb_dir }}-{{ orientdb_version }}/databases'
|
||||||
state: link
|
state: link
|
||||||
owner: '{{ orientdb_user }}'
|
owner: '{{ orientdb_user }}'
|
||||||
group: '{{ orientdb_user }}'
|
group: '{{ orientdb_user }}'
|
||||||
force: True
|
force: true
|
||||||
|
|
||||||
- name: Create a orientdb log directory out of the distribution directory
|
- name: Create a orientdb log directory out of the distribution directory
|
||||||
file:
|
ansible.builtin.file:
|
||||||
dest: '{{ orientdb_log_dir }}'
|
dest: '{{ orientdb_log_dir }}'
|
||||||
state: directory
|
state: directory
|
||||||
owner: '{{ orientdb_user }}'
|
owner: '{{ orientdb_user }}'
|
||||||
group: '{{ orientdb_user }}'
|
group: '{{ orientdb_user }}'
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Link the log directory inside the orientdb user home
|
- name: Link the log directory inside the orientdb user home
|
||||||
become: True
|
become: true
|
||||||
become_user: '{{ orientdb_user }}'
|
become_user: '{{ orientdb_user }}'
|
||||||
file: dest={{ orientdb_home_prefix }}/{{ orientdb_user }}/logs src={{ orientdb_log_dir }} state=link
|
ansible.builtin.file:
|
||||||
|
src: "{{ orientdb_log_dir }}"
|
||||||
|
dest: "{{ orientdb_home_prefix }}/{{ orientdb_user }}/logs"
|
||||||
|
state: link
|
||||||
- name: Remove the old hook jars
|
- name: Remove the old hook jars
|
||||||
shell: rm -f {{ orientdb_install_dir }}/lib/{{ item }}
|
ansible.builtin.shell: rm -f {{ orientdb_install_dir }}/lib/{{ item }}
|
||||||
with_items: '{{ orientdb_hooks_to_be_removed | default([]) }}'
|
loop: '{{ orientdb_hooks_to_be_removed | default([]) }}'
|
||||||
tags: [ 'orientdb', 'orientdb_hooks' ]
|
tags: ['orientdb', 'orientdb_hooks']
|
||||||
|
|
||||||
- name: Fetch and install the hook jars
|
- name: Fetch and install the hook jars
|
||||||
get_url: url='{{ item }}' dest={{ orientdb_install_dir }}/lib
|
ansible.builtin.get_url:
|
||||||
with_items: '{{ orientdb_hooks_jars | default([]) }}'
|
url: "{{ item }}"
|
||||||
|
dest: "{{ orientdb_install_dir }}/lib"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0644"
|
||||||
|
loop: '{{ orientdb_hooks_jars | default([]) }}'
|
||||||
notify: Restart orientdb
|
notify: Restart orientdb
|
||||||
tags: [ 'orientdb', 'orientdb_hooks' ]
|
tags: ['orientdb', 'orientdb_hooks']
|
||||||
|
|
||||||
- name: Install the orientdb default settings
|
- name: Install the orientdb default settings
|
||||||
template: src=orientdb.default.j2 dest=/etc/default/orientdb owner=root group=root mode=0444
|
ansible.builtin.template:
|
||||||
|
src: orientdb.default.j2
|
||||||
|
dest: /etc/default/orientdb
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0444"
|
||||||
notify: Restart orientdb
|
notify: Restart orientdb
|
||||||
|
|
||||||
- name: Fix the pid file path inside the start and shutdown scripts
|
- name: Fix the pid file path inside the start and shutdown scripts
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
dest: '{{ orientdb_install_dir }}/bin/{{ item }}'
|
dest: '{{ orientdb_install_dir }}/bin/{{ item }}'
|
||||||
regexp: "^ORIENTDB_PID=.*$"
|
regexp: "^ORIENTDB_PID=.*$"
|
||||||
line: "ORIENTDB_PID={{ orientdb_pid_dir }}/orientdb.pid"
|
line: "ORIENTDB_PID={{ orientdb_pid_dir }}/orientdb.pid"
|
||||||
insertafter: "^PRG=.*$"
|
insertafter: "^PRG=.*$"
|
||||||
firstmatch: yes
|
firstmatch: true
|
||||||
loop:
|
loop:
|
||||||
- server.sh
|
- server.sh
|
||||||
- shutdown.sh
|
- shutdown.sh
|
||||||
tags: [ 'orientdb', 'orientdb_pid' ]
|
tags: ['orientdb', 'orientdb_pid']
|
||||||
|
|
||||||
- name: Install the orientdb configuration files
|
- name: Install the orientdb configuration files
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: '{{ item }}.j2'
|
src: '{{ item }}.j2'
|
||||||
dest: '{{ orientdb_install_dir }}/config/{{ item }}'
|
dest: '{{ orientdb_install_dir }}/config/{{ item }}'
|
||||||
owner: '{{ orientdb_user }}'
|
owner: '{{ orientdb_user }}'
|
||||||
|
@ -96,8 +127,7 @@
|
||||||
mode: '0640'
|
mode: '0640'
|
||||||
loop: '{{ orientdb_configuration_files }}'
|
loop: '{{ orientdb_configuration_files }}'
|
||||||
notify: Restart orientdb
|
notify: Restart orientdb
|
||||||
tags: [ 'orientdb', 'orientdb_config' ]
|
tags: ['orientdb', 'orientdb_config']
|
||||||
|
|
||||||
- name: Set the permissions of some configuration files
|
- name: Set the permissions of some configuration files
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
dest: '{{ orientdb_install_dir }}/config/{{ item }}'
|
dest: '{{ orientdb_install_dir }}/config/{{ item }}'
|
||||||
|
@ -109,104 +139,133 @@
|
||||||
- security.json
|
- security.json
|
||||||
- orientdb-etl-log.properties
|
- orientdb-etl-log.properties
|
||||||
notify: Restart orientdb
|
notify: Restart orientdb
|
||||||
tags: [ 'orientdb', 'orientdb_config' ]
|
tags: ['orientdb', 'orientdb_config']
|
||||||
|
|
||||||
- name: Install the nagios nrpe configuration
|
- name: Install the nagios nrpe configuration
|
||||||
template: src=orientdb-nrpe.cfg.j2 dest={{ nrpe_include_dir }}/orientdb-nrpe.cfg owner=root group=root mode=0444
|
ansible.builtin.template:
|
||||||
|
src: orientdb-nrpe.cfg.j2
|
||||||
|
dest: "{{ nrpe_include_dir }}/orientdb-nrpe.cfg"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0444"
|
||||||
notify: Reload NRPE server
|
notify: Reload NRPE server
|
||||||
when:
|
when:
|
||||||
- nrpe_include_dir is defined
|
- nrpe_include_dir is defined
|
||||||
- nagios_enabled is defined and nagios_enabled
|
- nagios_enabled is defined and nagios_enabled
|
||||||
tags: [ 'orientdb', 'orientdb_nagios' ]
|
tags: ['orientdb', 'orientdb_nagios']
|
||||||
|
|
||||||
- name: Install the orientdb SYSV startup script
|
- name: Install the orientdb SYSV startup script
|
||||||
template: src=orientdb.init.j2 dest=/etc/init.d/orientdb owner=root group=root mode=0755
|
ansible.builtin.template:
|
||||||
tags: [ 'orientdb', 'orientdb_init' ]
|
src: orientdb.init.j2
|
||||||
|
dest: /etc/init.d/orientdb
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0755"
|
||||||
|
tags: ['orientdb', 'orientdb_init']
|
||||||
when: ansible_service_mgr != 'systemd'
|
when: ansible_service_mgr != 'systemd'
|
||||||
|
|
||||||
- name: Install the orientdb systemd unit
|
- name: Install the orientdb systemd unit
|
||||||
template: src=orientdb.service.j2 dest=/etc/systemd/system/orientdb.service owner=root group=root mode=0644
|
ansible.builtin.template:
|
||||||
tags: [ 'orientdb', 'orientdb_init' ]
|
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'
|
when: ansible_service_mgr == 'systemd'
|
||||||
register: reload_systemd
|
register: reload_systemd
|
||||||
|
|
||||||
- name: Reload the systemd service
|
- name: Reload the systemd service
|
||||||
systemd:
|
ansible.builtin.systemd:
|
||||||
daemon_reload: yes
|
daemon_reload: true
|
||||||
when: reload_systemd is changed
|
when: reload_systemd is changed
|
||||||
|
|
||||||
- name: Ensure that the service is enabled and running
|
- name: Ensure that the service is enabled and running
|
||||||
service: name=orientdb state=started enabled=yes
|
ansible.builtin.service:
|
||||||
|
name: orientdb
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
when: orientdb_enabled
|
when: orientdb_enabled
|
||||||
|
|
||||||
- name: Ensure that the service is stopped and disabled
|
- name: Ensure that the service is stopped and disabled
|
||||||
service: name=orientdb state=stopped enabled=no
|
ansible.builtin.service:
|
||||||
|
name: orientdb
|
||||||
|
state: stopped
|
||||||
|
enabled: false
|
||||||
when: not orientdb_enabled
|
when: not orientdb_enabled
|
||||||
|
- name: Clean up the backups
|
||||||
tags: [ 'orientdb' ]
|
tags: ['orientdb', 'orientdb_backup']
|
||||||
when: orientdb_install
|
when: orientdb_install
|
||||||
|
block:
|
||||||
- block:
|
|
||||||
- name: Install a script that removes the old orientdb backups
|
- name: Install a script that removes the old orientdb backups
|
||||||
template: src=backup-cleaner.sh.j2 dest=/usr/local/bin/orientdb-backup-cleaner owner=root group=root mode=555
|
ansible.builtin.template:
|
||||||
|
src: backup-cleaner.sh.j2
|
||||||
|
dest: /usr/local/bin/orientdb-backup-cleaner
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0555"
|
||||||
- name: Add a cron job that removes the old backups
|
- name: Add a cron job that removes the old backups
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
cron_file: 'orientdb-backup-cleaner'
|
cron_file: orientdb-backup-cleaner
|
||||||
disabled: no
|
disabled: false
|
||||||
job: "/usr/local/bin/orientdb-backup-cleaner >/dev/null 2>&1"
|
job: "/usr/local/bin/orientdb-backup-cleaner >/dev/null 2>&1"
|
||||||
special_time: daily
|
special_time: daily
|
||||||
user: '{{ orientdb_user }}'
|
user: "{{ orientdb_user }}"
|
||||||
name: "Remove old orientdb backups"
|
name: "Remove old orientdb backups"
|
||||||
state: present
|
state: present
|
||||||
|
- name: Manage the Letsencrypt certificates
|
||||||
tags: [ 'orientdb', 'orientdb_backup' ]
|
tags: ['orientdb', 'letsencrypt', 'orientdb_letsencrypt']
|
||||||
when: orientdb_install
|
|
||||||
|
|
||||||
|
|
||||||
- block:
|
|
||||||
- name: Create the acme hooks directory if it does not yet exist
|
|
||||||
file: dest={{ letsencrypt_acme_services_scripts_dir }} state=directory owner=root group=root
|
|
||||||
|
|
||||||
- name: Install a letsencrypt hook to update the orientdb certificate
|
|
||||||
template: src=orientdb-letsencrypt-acme.sh.j2 dest={{ letsencrypt_acme_services_scripts_dir }}/orientdb owner=root group=root mode=4555
|
|
||||||
|
|
||||||
tags: [ 'orientdb', 'letsencrypt', 'orientdb_letsencrypt' ]
|
|
||||||
when:
|
when:
|
||||||
- orientdb_install
|
- orientdb_install
|
||||||
- orientdb_letsencrypt_ssl_enabled
|
- orientdb_letsencrypt_ssl_enabled
|
||||||
|
- letsencrypt_acme_install is defined and letsencrypt_acme_install
|
||||||
|
block:
|
||||||
|
- name: Create the acme hooks directory if it does not yet exist
|
||||||
|
ansible.builtin.file:
|
||||||
|
dest: "{{ letsencrypt_acme_services_scripts_dir }}"
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0755"
|
||||||
|
- name: Install a letsencrypt hook to update the orientdb certificate
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: orientdb-letsencrypt-acme.sh.j2
|
||||||
|
dest: "{{ letsencrypt_acme_services_scripts_dir }}/orientdb"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "4555"
|
||||||
|
|
||||||
- block:
|
- name: Remove OrientDB
|
||||||
- name: Ensure that the service is disabled and stopped
|
tags: ['orientdb']
|
||||||
service: name=orientdb state=stopped enabled=no
|
|
||||||
|
|
||||||
- name: Remove the orientdb SysV startup file
|
|
||||||
file: dest=/etc/init.d/orientdb state=absent
|
|
||||||
when: ansible_service_mgr != 'systemd'
|
|
||||||
|
|
||||||
- name: Remove the orientdb systemd unit
|
|
||||||
file: dest=/usr/lib/systemd/system/orientdb.service state=absent
|
|
||||||
when: ansible_service_mgr == 'systemd'
|
|
||||||
|
|
||||||
- name: Remove the link to the orientdb distribution
|
|
||||||
file: dest={{ orientdb_home_prefix }}/{{ orientdb_user }}/{{ orientdb_dir }} state=absent
|
|
||||||
|
|
||||||
- name: Remove the default options file
|
|
||||||
file: dest=/etc/default/orientdb state=absent
|
|
||||||
|
|
||||||
- name: Remove the backup cleaner script
|
|
||||||
file: dest=/usr/local/bin/orientdb-backup-cleaner state=absent
|
|
||||||
|
|
||||||
- name: Remove the backup cleaner cron job
|
|
||||||
cron:
|
|
||||||
cron_file: 'orientdb-backup-cleaner'
|
|
||||||
disabled: no
|
|
||||||
job: "/usr/local/bin/orientdb-backup-cleaner >/dev/null 2>&1"
|
|
||||||
special_time: daily
|
|
||||||
user: '{{ orientdb_user }}'
|
|
||||||
name: "Remove old orientdb backups"
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
tags: [ 'orientdb' ]
|
|
||||||
when: not orientdb_install
|
when: not orientdb_install
|
||||||
|
block:
|
||||||
|
- name: Ensure that the service is disabled and stopped
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: orientdb
|
||||||
|
state: stopped
|
||||||
|
enabled: false
|
||||||
|
- name: Remove the orientdb SysV startup file
|
||||||
|
ansible.builtin.file:
|
||||||
|
dest: /etc/init.d/orientdb
|
||||||
|
state: absent
|
||||||
|
when: ansible_service_mgr != 'systemd'
|
||||||
|
- name: Remove the orientdb systemd unit
|
||||||
|
ansible.builtin.file:
|
||||||
|
dest: /usr/lib/systemd/system/orientdb.service
|
||||||
|
state: absent
|
||||||
|
when: ansible_service_mgr == 'systemd'
|
||||||
|
- name: Remove the link to the orientdb distribution
|
||||||
|
ansible.builtin.file:
|
||||||
|
dest: "{{ orientdb_home_prefix }}/{{ orientdb_user }}/{{ orientdb_dir }}"
|
||||||
|
state: absent
|
||||||
|
- name: Remove the default options file
|
||||||
|
ansible.builtin.file:
|
||||||
|
dest: /etc/default/orientdb
|
||||||
|
state: absent
|
||||||
|
- name: Remove the backup cleaner script
|
||||||
|
ansible.builtin.file:
|
||||||
|
dest: /usr/local/bin/orientdb-backup-cleaner
|
||||||
|
state: absent
|
||||||
|
- name: Remove the backup cleaner cron job
|
||||||
|
ansible.builtin.cron:
|
||||||
|
cron_file: orientdb-backup-cleaner
|
||||||
|
disabled: false
|
||||||
|
job: "/usr/local/bin/orientdb-backup-cleaner >/dev/null 2>&1"
|
||||||
|
special_time: daily
|
||||||
|
user: '{{ orientdb_user }}'
|
||||||
|
name: "Remove old orientdb backups"
|
||||||
|
state: absent
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
---
|
---
|
||||||
# vars file for ansible-role-template
|
jdk_default: "{{ orientdb_jdk_version }}"
|
||||||
|
|
Loading…
Reference in New Issue