diff options
author | Sacha Chua <sacha@sachachua.com> | 2022-11-02 13:08:03 -0400 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2022-11-02 13:08:03 -0400 |
commit | c569e02d8ab5ebcbb5a44e10c14799fa097c9bc7 (patch) | |
tree | 05528005f12160fd505696cb5d89f22d30249f32 /roles/obs/tasks | |
parent | 4696aa1fed214fe1084d7c3deecaaa289bc0a1fd (diff) | |
download | emacsconf-ansible-c569e02d8ab5ebcbb5a44e10c14799fa097c9bc7.tar.xz emacsconf-ansible-c569e02d8ab5ebcbb5a44e10c14799fa097c9bc7.zip |
OBS overlays, starting to get publish and edit on res
Diffstat (limited to '')
-rw-r--r-- | roles/obs/tasks/main.yml | 14 | ||||
-rw-r--r-- | roles/obs/tasks/obs-setup.yml | 32 | ||||
-rw-r--r-- | roles/obs/tasks/track.yml | 15 | ||||
-rw-r--r-- | roles/obs/tasks/user.yml | 3 |
4 files changed, 49 insertions, 15 deletions
diff --git a/roles/obs/tasks/main.yml b/roles/obs/tasks/main.yml index 36e14c3..bf856ec 100644 --- a/roles/obs/tasks/main.yml +++ b/roles/obs/tasks/main.yml @@ -1,5 +1,5 @@ - name: Load icecast vars - tags: wip + tags: obs-profile, wip include_vars: file: ../../stream/defaults/main.yml - name: Add repo @@ -53,5 +53,13 @@ regexp: '(AllowUsers(?!.*\b{{ emacsconf_id }}-{{ item.id }}\b).*)$' 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: + content: | + {% for item in emacsconf_tracks %} + {{ emacsconf_user }} ALL=({{ emacsconf_id }}-{{ item.id }}) NOPASSWD: ALL + {% endfor %} + dest: /etc/sudoers.d/50_emacsconf diff --git a/roles/obs/tasks/obs-setup.yml b/roles/obs/tasks/obs-setup.yml index 1da678a..59170f1 100644 --- a/roles/obs/tasks/obs-setup.yml +++ b/roles/obs/tasks/obs-setup.yml @@ -6,13 +6,12 @@ state: directory - name: Create profile directories file: - path: "~{{ emacsconf_user }}/.config/obs-studio/basic/{{ item.name }}" + path: "~{{ emacsconf_user }}/.config/obs-studio/basic/profiles/{{ item.name }}" state: directory owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" mode: 0775 - name: Install OBS global profile - tags: wip template: src: global.ini owner: "{{ emacsconf_user }}" @@ -23,7 +22,7 @@ src: profile.ini owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" - dest: "~{{ emacsconf_user }}/.config/obs-studio/basic/{{ item.name }}/basic.ini" + dest: "~{{ emacsconf_user }}/.config/obs-studio/basic/profiles/{{ item.name }}/basic.ini" mode: 0664 - name: Install OBS scenes tags: obs-scene @@ -32,17 +31,33 @@ owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" dest: "~{{ emacsconf_user }}/.config/obs-studio/basic/scenes/{{ item.id }}.json" +- name: Copy overlay template for video + tags: obs-scene + copy: + src: overlay.svg + dest: "~{{ emacsconf_user }}/video.svg" + owner: "{{ emacsconf_user }}" + group: "{{ emacsconf_group }}" +- name: Copy overlay template for video + tags: obs-scene + copy: + src: overlay.svg + dest: "~{{ emacsconf_user }}/other.svg" + owner: "{{ emacsconf_user }}" + group: "{{ emacsconf_group }}" - name: Create text files for OBS sources copy: content: "Initializing..." owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" - dest: "~{{ emacsconf_user }}/{{ item }}.txt" + dest: "~{{ emacsconf_user }}/{{ filename }}.txt" mode: 0664 loop: - news - url - bottom + loop_control: + loop_var: filename - name: Create OBS scripts for tracks template: src: obs-track @@ -50,4 +65,11 @@ owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" mode: 0775 - +- name: Fix permissions + become: true + become_user: root + file: + path: "~{{ emacsconf_user }}" + owner: "{{ emacsconf_user }}" + group: "{{ emacsconf_group }}" + recurse: true diff --git a/roles/obs/tasks/track.yml b/roles/obs/tasks/track.yml index 93b789d..a0acf16 100644 --- a/roles/obs/tasks/track.yml +++ b/roles/obs/tasks/track.yml @@ -1,5 +1,5 @@ - name: Set vars - tags: wip, obs-scene, mpv + tags: obs-scene, obs-profile, mpv, wip set_fact: old_emacsconf_user: "{{ emacsconf_user }}" old_emacsconf_home: "{{ emacsconf_home }}" @@ -10,7 +10,7 @@ - name: Set up user include: user.yml - name: Set up user-related things - become: "{{ emacsconf_user }}" + become_user: "{{ emacsconf_user }}" block: - name: Set up track bins for addition to paths file: @@ -27,6 +27,7 @@ group: "{{ emacsconf_group }}" state: directory - name: Add MPV profile + tags: mpv-conf template: src: mpv.conf dest: "~{{ emacsconf_user }}/.config/mpv/mpv.conf" @@ -40,8 +41,12 @@ group: "{{ emacsconf_group }}" mode: 0775 - name: Set up OBS profiles and scenes - tags: obs-profile - include: obs-setup.yml + 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 @@ -75,7 +80,7 @@ owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" - name: Reset vars - tags: wip, obs-scene, mpv + tags: obs-scene, obs-profile, mpv, wip set_fact: old_emacsconf_user: "{{ emacsconf_user }}" old_emacsconf_home: "{{ emacsconf_home }}" diff --git a/roles/obs/tasks/user.yml b/roles/obs/tasks/user.yml index a941d7f..caaf2d9 100644 --- a/roles/obs/tasks/user.yml +++ b/roles/obs/tasks/user.yml @@ -2,7 +2,6 @@ group: name: "{{ emacsconf_group }}" - name: Add user - tags: wip user: name: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" @@ -15,10 +14,10 @@ state: directory mode: 700 - name: Set up SSH key access + tags: wip template: src: authorized_keys dest: "/home/{{ emacsconf_user }}/.ssh/authorized_keys" - force: no - name: Change ownership of SSH directory file: path: "/home/{{ emacsconf_user }}/.ssh" |