consolidate ansible setup into roles dir

This commit is contained in:
Nick Sweeting 2024-09-17 00:48:47 -07:00
parent 25db6826ec
commit c55cd46ecb
No known key found for this signature in database
27 changed files with 763 additions and 91 deletions

View file

@ -0,0 +1,42 @@
#!/usr/bin/env ansible-playbook
---
- name: "Install YT-DLP"
hosts: localhost
gather_facts: no
vars:
YTDLP_VERSION_MIN: '2024.8.6'
tasks:
- include_role:
name: setup_lib_pip
vars:
MIN_PYTHON_VERSION: '3.10.0'
MIN_PIP_VERSION: '22.0'
- name: "Install pip packages: {{install_pip}}"
ansible.builtin.pip:
name: 'yt-dlp'
state: "present"
virtualenv: '{{BINPROVIDERS.pip.virtualenv}}'
virtualenv_python: "{{BINPROVIDERS.pip.virtualenv_python}}"
virtualenv_site_packages: yes
- name: Load YTDLP binary
import_role:
name: load_binary
vars:
name: ytdlp
- name: Load ffmpeg binary
import_role:
name: load_binary
vars:
name: ffmpeg
version_cmd: 'ffmpeg -version'
- name: Check that installed YT-DLP matches expected version
assert:
that: BINARIES.ytdlp.version is version(YTDLP_VERSION_MIN, '>=')
quiet: true
- debug:
msg: "{{ {'BINARIES': BINARIES, 'BINPROVIDERS': BINPROVIDERS} }}"

View file

@ -0,0 +1 @@
../ansible/roles