From e42e761dca58557799084ceafdf2088d85fe40c5 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Tue, 25 Oct 2022 11:13:23 -0400 Subject: Caption daemon --- roles/caption/tasks/main.yml | 60 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 10 deletions(-) (limited to 'roles/caption/tasks/main.yml') diff --git a/roles/caption/tasks/main.yml b/roles/caption/tasks/main.yml index 6396339..7fe1570 100644 --- a/roles/caption/tasks/main.yml +++ b/roles/caption/tasks/main.yml @@ -5,10 +5,11 @@ - ffmpeg - cmake - jq + - inotify-tools - name: Install whisper ansible.builtin.pip: name: git+https://github.com/openai/whisper.git -- name: Install lhotse +- name: Install Python packages ansible.builtin.pip: name: - lhotse @@ -16,18 +17,57 @@ - tqdm - torchaudio - num2words -- name: Copy the shell script - tags: process-captions +- name: Create group + group: + name: "{{ emacsconf_group }}" + state: present +- name: Create user + user: + name: "{{ emacsconf_user }}" + group: "{{ emacsconf_group }}" + state: present +- name: Ensure the directory exists + file: + path: "{{ emacsconf_caption_dir }}" + state: directory +- name: Copy the script for processing the files + tags: process-captions, wip template: src: process-captions.py - dest: /data/emacsconf/{{ emacsconf_year }}/process-captions.py - mode: 0755 - owner: sachac - group: org + dest: "{{ emacsconf_caption_dir }}/process-captions.py" + mode: 0775 +- name: Copy the inotify script + tags: process-captions + template: + src: inotify-process-captions.sh + dest: "{{ emacsconf_caption_dir }}/inotify-process-captions.sh" + mode: 0775 - name: Copy talks.json tags: talks-json template: src: talks.json - dest: /data/emacsconf/{{ emacsconf_year }}/talks.json - owner: sachac - group: org + dest: "{{ emacsconf_caption_dir }}/talks.json" + mode: 0664 +- name: Install init.d configuration + tags: system + become: true + template: + src: captions.init.d + dest: /etc/init.d/captions + owner: root + group: root + mode: 0755 +- name: Change the group for all the files + tags: wip + file: + dest: "{{ emacsconf_caption_dir }}" + group: "{{ emacsconf_group }}" + mode: "g+rwX" + recurse: true +- name: Restart caption monitoring service + become: true + tags: wip + service: + name: captions + enabled: true + state: started -- cgit v1.2.3