summaryrefslogtreecommitdiffstats
path: root/roles/caption/tasks/main.yml
blob: 353b83b80ad233f7d9f8a51ca86cc0773666ed64 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
- name: Install packages
  package:
    name:
      - python3-pip
      - ffmpeg
      - cmake
      - jq
      - inotify-tools
- name: Install whisper
  ansible.builtin.pip:
    name: git+https://github.com/openai/whisper.git
- name: Install Python packages
  ansible.builtin.pip:
    name:
      - lhotse
      - webvtt-py
      - tqdm
      - torchaudio
      - num2words
- 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
  template:
    src: process-captions.py
    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: "{{ 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
  file:
    dest: "{{ emacsconf_caption_dir }}"
    group: "{{ emacsconf_group }}"
    mode: "g+rwX"
    recurse: true
- name: Restart caption monitoring service
  become: true
  service:
    name: captions
    enabled: true
    state: started