Add a media role for image/video viewers/editors.
This commit is contained in:
32
ansible/roles/media/tasks/common.yaml
Normal file
32
ansible/roles/media/tasks/common.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
- name: Install packages
|
||||
package:
|
||||
name:
|
||||
- ffmpeg # for cast_file
|
||||
state: present
|
||||
|
||||
- name: Install packages
|
||||
when: install_graphics
|
||||
package:
|
||||
name:
|
||||
- mpv
|
||||
- evince
|
||||
- gimp
|
||||
- imv # image viewer
|
||||
state: present
|
||||
|
||||
- include_tasks: "tasks/{{graphics_driver}}.yaml"
|
||||
|
||||
- import_tasks: tasks/freebsd.yaml
|
||||
when: 'os_flavor == "freebsd"'
|
||||
|
||||
- import_tasks: tasks/linux.yaml
|
||||
when: 'os_flavor == "linux"'
|
||||
|
||||
- include_tasks:
|
||||
file: tasks/peruser.yaml
|
||||
apply:
|
||||
become: yes
|
||||
become_user: "{{ initialize_user }}"
|
||||
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
|
||||
loop_control:
|
||||
loop_var: initialize_user
|
||||
7
ansible/roles/media/tasks/freebsd.yaml
Normal file
7
ansible/roles/media/tasks/freebsd.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
- name: Install packages
|
||||
package:
|
||||
name:
|
||||
# Have to use yt-dlp instead of youtube_dl because of mpv
|
||||
# - youtube_dl
|
||||
- yt-dlp
|
||||
state: present
|
||||
10
ansible/roles/media/tasks/intel.yaml
Normal file
10
ansible/roles/media/tasks/intel.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
- name: Install scripts
|
||||
copy:
|
||||
src: "files/{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: wheel
|
||||
loop:
|
||||
- src: cast_file_intel
|
||||
dest: /usr/local/bin/cast_file
|
||||
5
ansible/roles/media/tasks/linux.yaml
Normal file
5
ansible/roles/media/tasks/linux.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
- name: Install packages
|
||||
package:
|
||||
name:
|
||||
- youtube-dl
|
||||
state: present
|
||||
1
ansible/roles/media/tasks/main.yaml
Normal file
1
ansible/roles/media/tasks/main.yaml
Normal file
@@ -0,0 +1 @@
|
||||
- import_tasks: tasks/common.yaml
|
||||
29
ansible/roles/media/tasks/peruser.yaml
Normal file
29
ansible/roles/media/tasks/peruser.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
- include_role:
|
||||
name: per_user
|
||||
|
||||
- name: Create directories
|
||||
file:
|
||||
name: "{{ account_homedir.stdout }}/{{ item }}"
|
||||
state: directory
|
||||
mode: 0700
|
||||
owner: "{{ account_name.stdout }}"
|
||||
group: "{{ group_name.stdout }}"
|
||||
loop:
|
||||
- ".config/mpv"
|
||||
|
||||
- name: Copy files
|
||||
copy:
|
||||
src: "files/{{ item.src }}"
|
||||
dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
|
||||
mode: 0600
|
||||
owner: "{{ account_name.stdout }}"
|
||||
group: "{{ group_name.stdout }}"
|
||||
loop:
|
||||
- src: mpv.conf
|
||||
dest: .config/mpv/mpv.conf
|
||||
|
||||
- import_tasks: tasks/peruser_freebsd.yaml
|
||||
when: 'os_flavor == "freebsd"'
|
||||
|
||||
- import_tasks: tasks/peruser_linux.yaml
|
||||
when: 'os_flavor == "linux"'
|
||||
0
ansible/roles/media/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/media/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/media/tasks/peruser_linux.yaml
Normal file
0
ansible/roles/media/tasks/peruser_linux.yaml
Normal file
Reference in New Issue
Block a user