summaryrefslogtreecommitdiffstats
path: root/roles/obs/tasks
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-11-05 07:55:34 -0400
committerSacha Chua <sacha@sachachua.com>2022-11-05 07:55:34 -0400
commitd33a5923c335332f7401826e01eb2033af717a76 (patch)
tree35a726b46d81a86662bb2e1cf10b1e53c94c9df6 /roles/obs/tasks
parent0b07963c81155b621dd45b878b869a78b8c9de49 (diff)
downloademacsconf-ansible-d33a5923c335332f7401826e01eb2033af717a76.tar.xz
emacsconf-ansible-d33a5923c335332f7401826e01eb2033af717a76.zip
Publishing and streaming
Diffstat (limited to 'roles/obs/tasks')
-rw-r--r--roles/obs/tasks/emacs.yml39
-rw-r--r--roles/obs/tasks/main.yml13
-rw-r--r--roles/obs/tasks/obs-setup.yml6
-rw-r--r--roles/obs/tasks/track.yml5
-rw-r--r--roles/obs/tasks/user.yml1
5 files changed, 59 insertions, 5 deletions
diff --git a/roles/obs/tasks/emacs.yml b/roles/obs/tasks/emacs.yml
new file mode 100644
index 0000000..0b013b3
--- /dev/null
+++ b/roles/obs/tasks/emacs.yml
@@ -0,0 +1,39 @@
+- name: Check out emacsconf-el
+ ansible.builtin.git:
+ repo: https://git.emacsconf.org/emacsconf-el
+ dest: "~{{ emacsconf_user }}/emacsconf-el"
+ register: elisp
+ failed_when:
+ - elisp.failed
+ - not 'Local modifications exist in repository' in elisp.msg
+ - not 'Failed to checkout branch' in elisp.msg
+ debugger: on_failed
+- name: Install Emacs packages
+ become_user: "{{ emacsconf_user }}"
+ shell: |
+ emacs --batch --exec "(progn (require 'package)
+ (let ((packages (seq-remove #'package-installed-p '({% for package in packages %}{{ package }} {% endfor %}))))
+ (when packages
+ (package-refresh-contents)
+ (mapc #'package-install packages))))"
+ vars:
+ packages:
+ - modus-themes
+ - vertico
+ - orderless
+- name: Set up Emacs configuration for interactive editing
+ template:
+ src: emacsconf-stream-config.el
+ dest: "{{ emacs_config_dir }}/emacsconf-stream-config.el"
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+- name: Add to Emacs configuration
+ lineinfile:
+ dest: "{{ emacs_config_dir }}/init.el"
+ state: present
+ regexp: "emacsconf-stream-config"
+ line: "(load-file \"{{ emacs_config_dir }}/emacsconf-stream-config.el\")"
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+ create: yes
+
diff --git a/roles/obs/tasks/main.yml b/roles/obs/tasks/main.yml
index bf856ec..8c1e059 100644
--- a/roles/obs/tasks/main.yml
+++ b/roles/obs/tasks/main.yml
@@ -11,6 +11,7 @@
name:
- xserver-xorg-video-dummy
- i3
+ - inkscape # OBS overlaying PNG is prettier than SVG
- socat
- ffmpeg
- pulseaudio
@@ -54,7 +55,6 @@
replace: \1 {{ emacsconf_id }}-{{ item.id }}
loop: "{{ emacsconf_tracks }}"
- name: Allow sudo from {{ emacsconf_user }} to the stream users
- tags: wip
become: true
become_user: root
copy:
@@ -63,3 +63,14 @@
{{ 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: "{{ item }}"
+ state: directory
+ mode: 0775
+ loop:
+ - /data/{{ emacsconf_id }}/stream
+ - /data/{{ emacsconf_id }}/overlays
+
diff --git a/roles/obs/tasks/obs-setup.yml b/roles/obs/tasks/obs-setup.yml
index 59170f1..911f609 100644
--- a/roles/obs/tasks/obs-setup.yml
+++ b/roles/obs/tasks/obs-setup.yml
@@ -32,19 +32,21 @@
group: "{{ emacsconf_group }}"
dest: "~{{ emacsconf_user }}/.config/obs-studio/basic/scenes/{{ item.id }}.json"
- name: Copy overlay template for video
- tags: obs-scene
+ tags: obs-scene, wip
copy:
src: overlay.svg
dest: "~{{ emacsconf_user }}/video.svg"
owner: "{{ emacsconf_user }}"
group: "{{ emacsconf_group }}"
+ mode: 0664
- name: Copy overlay template for video
- tags: obs-scene
+ tags: obs-scene, wip
copy:
src: overlay.svg
dest: "~{{ emacsconf_user }}/other.svg"
owner: "{{ emacsconf_user }}"
group: "{{ emacsconf_group }}"
+ mode: 0664
- name: Create text files for OBS sources
copy:
content: "Initializing..."
diff --git a/roles/obs/tasks/track.yml b/roles/obs/tasks/track.yml
index a0acf16..14533df 100644
--- a/roles/obs/tasks/track.yml
+++ b/roles/obs/tasks/track.yml
@@ -27,7 +27,7 @@
group: "{{ emacsconf_group }}"
state: directory
- name: Add MPV profile
- tags: mpv-conf
+ tags: mpv-conf, wip
template:
src: mpv.conf
dest: "~{{ emacsconf_user }}/.config/mpv/mpv.conf"
@@ -79,6 +79,9 @@
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:
diff --git a/roles/obs/tasks/user.yml b/roles/obs/tasks/user.yml
index caaf2d9..fae7d9f 100644
--- a/roles/obs/tasks/user.yml
+++ b/roles/obs/tasks/user.yml
@@ -14,7 +14,6 @@
state: directory
mode: 700
- name: Set up SSH key access
- tags: wip
template:
src: authorized_keys
dest: "/home/{{ emacsconf_user }}/.ssh/authorized_keys"