---
# Configure a Buildbot worker
- include: unix.yml

- name: Install grind-specific worker dependencies
  hosts: zcash-ci-worker-unix
  become: true

  vars_files:
    - vars/default.yml

  tasks:
    - name: Get dependencies for distribution
      include_vars: "{{ item }}"
      with_first_found:
        - files:
            - "vars/{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
            - "vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version | int }}.yml"
            - "vars/{{ ansible_distribution }}.yml"
            - "vars/{{ ansible_os_family }}.yml"
          skip: true

    - name: Install required packages
      package:
        name: "{{ item }}"
        state: present
      with_items: "{{ grind_deps }}"
