summaryrefslogtreecommitdiffstats
path: root/roles/obs/tasks/track.yml
blob: 14533df5f6c76b9bef944ab411f24fcb5ae0341b (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
- name: Set vars
  tags: obs-scene, obs-profile, mpv, wip
  set_fact:
    old_emacsconf_user: "{{ emacsconf_user }}"
    old_emacsconf_home: "{{ emacsconf_home }}"
    emacsconf_user: "{{ emacsconf_id }}-{{ item.id }}"
    emacsconf_home: "/home/{{ emacsconf_id }}-{{ item.id }}"
- debug:
    var: emacsconf_home
- name: Set up user
  include: user.yml
- name: Set up user-related things
  become_user: "{{ emacsconf_user }}"
  block:
    - name: Set up track bins for addition to paths
      file:
        path: "~{{ emacsconf_user }}/bin/{{ item.id }}"
        owner: "{{ emacsconf_user }}"
        group: "{{ emacsconf_group }}"
        state: directory
    - name: Set up VNC
      include: tigervnc.yml
    - name: Create MPV profile directory
      file:
        path: "~{{ emacsconf_user }}/.config/mpv"
        owner: "{{ emacsconf_user }}"
        group: "{{ emacsconf_group }}"
        state: directory
    - name: Add MPV profile
      tags: mpv-conf, wip
      template:
        src: mpv.conf
        dest: "~{{ emacsconf_user }}/.config/mpv/mpv.conf"
        owner: "{{ emacsconf_user }}"
        group: "{{ emacsconf_group }}"
    - name: Create mpv scripts for tracks
      template:
        src: mpv-track
        dest: "~{{ emacsconf_user }}/bin/track-mpv"
        owner: "{{ emacsconf_user }}"
        group: "{{ emacsconf_group }}"
        mode: 0775
    - name: Set up OBS profiles and scenes
      tags: obs-profile, obs-scene
      include_tasks:
        file: obs-setup.yml
        apply:
          tags:
            - obs-profile
    - name: Add FFMPEG script for streaming
      template:
        src: stream-desktop-with-ffmpeg.sh
        dest: "~{{ emacsconf_user }}/bin/stream-desktop-with-ffmpeg"
        owner: "{{ emacsconf_user }}"
        group: "{{ emacsconf_group }}"
        mode: 0775
      loop: "{{ emacsconf_tracks }}"
    - name: Copy logo
      copy:
        src: logo.png
        dest: "~{{ emacsconf_user }}/logo.png"
        owner: "{{ emacsconf_user }}"
        group: "{{ emacsconf_group }}"
    # - name: Start jack
    #   shell: jackd -r -ddummy
    #   async: 2592000
    - name: Set up pulse
      include: pulse.yml
      tags: pulse
    - name: Set up I3 directory
      file:
        path: "~{{ emacsconf_user }}/.config/i3"
        state: directory
        owner: "{{ emacsconf_user }}"
        group: "{{ emacsconf_group }}"
    - name: Set up I3
      template:
        src: i3-config
        dest: "~{{ emacsconf_user }}/.config/i3/config"
        owner: "{{ emacsconf_user }}"
        group: "{{ emacsconf_group }}"        
    - name: Set up Emacs configuration
      tags: wip
      include: emacs.yml
- name: Reset vars
  tags: obs-scene, obs-profile, mpv, wip
  set_fact:
    old_emacsconf_user: "{{ emacsconf_user }}"
    old_emacsconf_home: "{{ emacsconf_home }}"
    emacsconf_user: "{{ old_emacsconf_user }}"
    emacsconf_home: "{{ old_emacsconf_home }}"