31 lines
1014 B
YAML
31 lines
1014 B
YAML
---
|
|
- name: "STRESS-SETUP: Build and push yt-dlp docker image"
|
|
hosts: workers
|
|
gather_facts: no
|
|
vars_files:
|
|
- "group_vars/all/vault.yml"
|
|
pre_tasks:
|
|
- name: Set inventory_env fact
|
|
ansible.builtin.set_fact:
|
|
inventory_env: "{{ inventory_file | basename | splitext | first | replace('inventory.', '') }}"
|
|
- name: Load environment-specific variables
|
|
ansible.builtin.include_vars: "{{ item }}"
|
|
with_fileglob:
|
|
- "group_vars/all/generated_vars{{ '.' + inventory_env if inventory_env else '' }}.yml"
|
|
tasks:
|
|
- name: "Build and push yt-dlp image on worker"
|
|
ansible.builtin.shell:
|
|
cmd: |
|
|
cd {{ airflow_worker_dir }}
|
|
if [ -f .env ]; then
|
|
set -a && . ./.env && set +a
|
|
fi
|
|
./bin/build-yt-dlp-image
|
|
register: build_output
|
|
changed_when: true
|
|
|
|
- name: "Display build output"
|
|
ansible.builtin.debug:
|
|
var: build_output.stdout_lines
|
|
when: build_output.stdout_lines is defined
|