summaryrefslogblamecommitdiffstats
path: root/roles/caption/tasks/main.yml
blob: a69d848ac5ceca9e419dfff2eab7bf2285523e4a (plain) (tree)
1
2
3
4
5
6
7
8




                        

             
                     


                                                   
                               






                      

                     










                                   
                                               
                    



                                  
           




                                                          
              



                                   
           



                                                          
              











                                                                     



                       











                                                  




                                       





                                            
- 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: Set up aeneas
  include: aeneas.yml
- 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 }}/scripts"
    state: directory
    owner: "{{ emacsconf_user }}"
    group: "{{ emacsconf_group }}"
- name: Recreate encoding script
  tags: process-prerec
  template:
    src: "{{ item }}"
    dest: "{{ emacsconf_caption_dir }}/scripts/{{ item }}"
    owner: "{{ emacsconf_user }}"
    group: "{{ emacsconf_group }}"
    force: no
    mode: 0775
  loop:
    - reencode.sh
- name: Copy scripts for processing
  tags: process-prerec
  template:
    src: "{{ item }}"
    dest: "{{ emacsconf_caption_dir }}/scripts/{{ item }}"
    owner: "{{ emacsconf_user }}"
    group: "{{ emacsconf_group }}"
    mode: 0775
  loop:
    - process-captions.py
    - process-prerec.sh
    - update-task-status.sh
    - upload.sh
    - run-aeneas.sh
# - 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