From d630700049ea7563fca2813f4a0f3a4c9b52598b Mon Sep 17 00:00:00 2001 From: Wolfgang Date: Tue, 5 Dec 2023 15:43:59 +0100 Subject: [PATCH] Switch from lineinfile to native service module --- tasks/solr.yaml | 9 +++------ tasks/tika.yaml | 11 ++--------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/tasks/solr.yaml b/tasks/solr.yaml index 7b9c303..2900545 100644 --- a/tasks/solr.yaml +++ b/tasks/solr.yaml @@ -96,10 +96,7 @@ notify: Restart Solr - name: Enable Solr service - ansible.builtin.lineinfile: - path: "{{ item }}" - regexp: "^solr_enable=" - line: 'solr_enable="YES"' - with_items: - - /etc/rc.conf + ansible.builtin.service: + name: solr + enabled: yes notify: Start Solr diff --git a/tasks/tika.yaml b/tasks/tika.yaml index bdf4e26..20042fd 100644 --- a/tasks/tika.yaml +++ b/tasks/tika.yaml @@ -31,22 +31,15 @@ - Start Tika - Restart Tika -- name: Stop the native rc.d Tika service +- name: Stop and disable the native rc.d Tika service ansible.builtin.service: name: tika state: stopped + enabled: no notify: - Start Tika - Restart Tika -- name: Disable the native rc.d Tika service - ansible.builtin.lineinfile: - path: "{{ item }}" - regexp: "^tika_enable=" - line: 'tika_enable="NO"' - with_items: - - /etc/rc.conf - - name: Install Tika service ansible.builtin.template: src: supervisord.d/tika.conf