45 lines
1.9 KiB
YAML
45 lines
1.9 KiB
YAML
---
|
|
- name: Install Local Development Packages
|
|
hosts: airflow_workers, airflow_master
|
|
gather_facts: no
|
|
vars_files:
|
|
- "{{ inventory_dir }}/group_vars/all/generated_vars.yml"
|
|
|
|
tasks:
|
|
- name: Ensure python3-pip is installed
|
|
ansible.builtin.apt:
|
|
name: python3-pip
|
|
state: present
|
|
update_cache: yes
|
|
become: yes
|
|
|
|
- name: Upgrade pip to the latest version (for systems without PEP 668)
|
|
ansible.builtin.command: python3 -m pip install --upgrade pip
|
|
register: pip_upgrade_old_systems
|
|
changed_when: "'Requirement already satisfied' not in pip_upgrade_old_systems.stdout"
|
|
failed_when: false # This task will fail on newer systems, which is expected.
|
|
become: yes
|
|
become_user: "{{ ansible_user }}"
|
|
|
|
- name: Upgrade pip to the latest version (for systems with PEP 668)
|
|
ansible.builtin.command: python3 -m pip install --upgrade pip --break-system-packages
|
|
when: pip_upgrade_old_systems.rc != 0 and 'externally-managed-environment' in pip_upgrade_old_systems.stderr
|
|
changed_when: "'Requirement already satisfied' not in pip_upgrade_new_systems.stdout"
|
|
register: pip_upgrade_new_systems
|
|
become: yes
|
|
become_user: "{{ ansible_user }}"
|
|
|
|
- name: Install or upgrade yt-dlp to the latest nightly version
|
|
ansible.builtin.command: python3 -m pip install -U --pre "yt-dlp[default]" --break-system-packages
|
|
register: ytdlp_install
|
|
changed_when: "'Requirement already satisfied' not in ytdlp_install.stdout"
|
|
become: yes
|
|
become_user: "{{ ansible_user }}"
|
|
|
|
- name: Install requests library
|
|
ansible.builtin.command: python3 -m pip install requests==2.31.0 --break-system-packages
|
|
register: requests_install
|
|
changed_when: "'Requirement already satisfied' not in requests_install.stdout"
|
|
become: yes
|
|
become_user: "{{ ansible_user }}"
|