---
- name: setup jenkins slaves
  hosts: simtester
  user: root
  tasks:
    - name: apt-get update
      apt:
        cache_valid_time: 3600
        update_cache: yes

    - name: install common utilities
      apt:
        name:
          - vim
          - ca-certificates
          - python3-minimal
          - python3-setuptools
          - python3-pip
          - python3-serial
          - python3-pyscard
          - tshark
          - virtualenv
        install_recommends: no

    - name: "pysim: get requirements.txt"
      get_url:
        url: https://gitea.osmocom.org/sim-card/pysim/raw/branch/master/requirements.txt
        dest: /tmp/pysim_requirements.txt

    - name: "pysim: install deps from requirements.txt"
      pip:
        executable: pip3
        requirements: /tmp/pysim_requirements.txt

  roles:
    - name: osmocom-jenkins-slave
      generic_slave: false
      install_jenkins_utilities: false
      ttcn3_slave: false
      tags:
        - jenkins-slave
