summaryrefslogtreecommitdiffstats
path: root/roles/obs/tasks/main.yml
blob: 946d1d7df7a3604b2e375626b9dd0976c7da0ebd (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
92
93
94
- name: Load icecast vars
  tags: obs-profile, wip
  include_vars:
    file: ../../stream/defaults/main.yml
- name: Add repo
  apt_repository:
    repo: ppa:obsproject/obs-studio
  when: ansible_distribution == "Ubuntu"
- name: Add packages
  apt:
    name:
      - xserver-xorg-video-dummy
      - i3
      - inkscape  # OBS overlaying PNG is prettier than SVG
      - socat
      - ffmpeg
      - pulseaudio
      - jackd2
      - kitty
      - kitty-terminfo
      - alsa-utils
      - dbus-x11
      - obs-studio
      - mumble
      - xserver-xorg-dev
      - xdotool
    update_cache: yes
- name: Add Firefox
  apt:
    name: firefox-esr
  when: ansible_distribution == "Debian"
- name: Add Firefox
  apt:
    name: firefox-esr
  when: ansible_distribution == "Ubuntu"
- name: Copy X11 config
  template:
    src: xorg.conf
    dest: /etc/X11/xorg.conf
- name: Set up MPV and MPVC
  tags: mpv
  include: mpv.yml
- name: Set up track-specific things
  include: track.yml
  loop: "{{ emacsconf_tracks }}"
- debug:
    var: emacsconf_home
- name: Add packages
  apt:
    name:
      - tigervnc-standalone-server
      - tigervnc-common
  tags: vnc
- name: Allow SSH for the users
  replace:
    dest: /etc/ssh/sshd_config.d/emacsconf_ssh.conf
    regexp: '(AllowUsers(?!.*\b{{ emacsconf_id }}-{{ item.id }}\b).*)$'
    replace: \1 {{ emacsconf_id }}-{{ item.id }}
  loop: "{{ emacsconf_tracks }}"

- name: Set emacsconf_user timezone
  lineinfile:
    line: export TZ={{ emacsconf_timezone }}
    dest: "/home/{{ emacsconf_user }}/.bashrc"
- name: Allow sudo from {{ emacsconf_user }} to the stream users
  become: true
  become_user: root
  copy:
    content: |
      {% for item in emacsconf_tracks %}
        {{ emacsconf_user }}  ALL=({{ emacsconf_id }}-{{ item.id }}) NOPASSWD: ALL
      {% endfor %}    
    dest: /etc/sudoers.d/50_emacsconf
- name: Create directories
  file:
    owner: "{{ emacsconf_user }}"
    group: "{{ emacsconf_group }}"
    path: "{{ emacsconf_asset_dir }}"
    state: directory
    mode: 0775
- name: Set up scripts
  tags: wip
  template:
    src: "{{ item }}"
    dest: /usr/local/bin
    mode: 0755
  loop:
    - overlay
    - music
    - play
    - play-with-intro
    - intro
    - bbb
    - pad