- name: Setup FFX node hosts: all vars: ffxRepoUrl: https://gitea.maveno.de/Javanaut/ffx.git tasks: - name: Update system and install packages become: true ansible.builtin.apt: name: - python3-virtualenv - ffmpeg - git - screen update_cache: yes - name: Create sync dir become: true file: path: "{{ ffxHomeDirectory }}/.local/var/sync/ffx" state: directory owner: "{{ ffxSystemUsername }}" group: "{{ ffxSystemUsername }}" mode: 0755 - name: Ensure local etc directory become: true file: path: "{{ ffxHomeDirectory }}/.local/etc" state: directory owner: "{{ ffxSystemUsername }}" group: "{{ ffxSystemUsername }}" mode: 0755 - name: Ensure local src directory become: true file: path: "{{ ffxHomeDirectory }}/.local/src" state: directory owner: "{{ ffxSystemUsername }}" group: "{{ ffxSystemUsername }}" mode: 0755 - name: Ensure local share directory become: true file: path: "{{ ffxHomeDirectory }}/.local/share" state: directory owner: "{{ ffxSystemUsername }}" group: "{{ ffxSystemUsername }}" mode: 0755 - name: Prepare ffx virtualenv become: true become_user: "{{ ffxSystemUsername }}" ansible.builtin.pip: name: - click - textual - sqlalchemy - requests virtualenv: "{{ ffxHomeDirectory }}/.local/share/ffx.venv" - name: Clone ffx repository become: true become_user: "{{ ffxSystemUsername }}" ansible.builtin.git: repo: "{{ ffxRepoUrl }}" dest: "{{ ffxHomeDirectory }}/.local/src/ffx" version: dev - name: Add TMDB API token placeholer to .bashrc become: true become_user: "{{ ffxSystemUsername }}" ansible.builtin.lineinfile: path: "{{ ffxHomeDirectory }}/.bashrc" insertbefore: BOF line: >- export TMDB_API_KEY="" - name: Add ffx alias to .bashrc become: true become_user: "{{ ffxSystemUsername }}" ansible.builtin.lineinfile: path: "{{ ffxHomeDirectory }}/.bashrc" insertbefore: BOF line: >- alias ffx="{{ ffxHomeDirectory }}/.local/share/ffx.venv/bin/python {{ ffxHomeDirectory }}/.local/src/ffx/bin/ffx.py" - name: Ensure local sync directory become: true file: path: "{{ ffxHomeDirectory }}/.local/var/sync/ffx" state: directory owner: "{{ ffxSystemUsername }}" group: "{{ ffxSystemUsername }}" mode: 0755 - name: Create ffx config file become: true become_user: "{{ ffxSystemUsername }}" vars: ffxConfiguration: databasePath: "{{ ffxHomeDirectory }}/.local/var/sync/ffx/ffx.db" ansible.builtin.copy: content: "{{ ffxConfiguration | to_json }}" dest: "{{ ffxHomeDirectory }}/.local/etc/ffx.json" owner: "{{ ffxSystemUsername }}" group: "{{ ffxSystemUsername }}" mode: 0644