- name: "Install 10 yum/dnf packages: avahi, avahi-tools, createrepo, linux-firmware, nss-mdns, openssl, syslog, wpa_supplicant, xml-common, yum-utils (redhat)"
  package:
    name:
      - avahi
      - avahi-tools
      - createrepo
      - linux-firmware
      - nss-mdns
      - openssl    # FC 18 does not supply, but pear requires
      - syslog
      - wpa_supplicant
      - xml-common
      - yum-utils
    state: present
  when: is_redhat | bool

- name: Install {{ iiab_download_url }}/usbmount_0.0.14.1_all.deb, missing from Debian (debian-9 or debian-10, if NOT rpi)
  apt:
    deb: "{{ iiab_download_url }}/usbmount_0.0.14.1_all.deb"
    #timeout: "{{ download_timeout }}"    # Ansible's apt module doesn't support timeout parameter; that's ok as usbmount_0.0.14.1_all.deb is only 10KB
  when: internet_available and (is_debian_9 or is_debian_10) and not is_rpi

- name: "Install 7 deb/apt packages: avahi-daemon, avahi-discover, exfat-fuse, exfat-utils, inetutils-syslogd, libnss-mdns, wpasupplicant (debuntu)"
  package:
    name:
      - avahi-daemon
      - avahi-discover
      - exfat-fuse
      - exfat-utils
      - inetutils-syslogd
      - libnss-mdns
      - wpasupplicant
    state: present
  when: is_debuntu | bool

- name: "Install 23 common packages: acpid, bridge-utils, bzip2, curl, gawk, hostapd, htop, i2c-tools, logrotate, make, mlocate, netmask, net-tools, ntfs-3g, pandoc, pastebinit, rsync, sudo, tar, unzip, usbmount, usbutils, wget"
  package:
    name:
      - acpid
      - bridge-utils
      - bzip2
      - curl
      #- etckeeper    # "nobody is really using etckeeper and it's bloating the filesystem every time apt runs" per @jvonau at https://github.com/iiab/iiab/issues/1146
      - gawk
      - hostapd
      - htop
      - i2c-tools
      - logrotate
      #- lynx    # already installed by 1-prep's roles/iiab-admin/tasks/access.yml
      - make
      - mlocate
      - netmask
      - net-tools
      - ntfs-3g
      #- openssh-server    # ssh (Raspbian) or openssh-server (other OS's) already installed by 1-prep's roles/sshd/tasks/main.yml
      - pandoc
      - pastebinit
      - rsync
      - sudo
      - tar
      - unzip
      - usbmount
      - usbutils
      - wget
    state: present

- name: "Install 4 common Python packages: python-passlib, python-pip, python-setuptools, python-virtualenv"
  package:
    name:
      - python-passlib
      - python-pip
      - python-setuptools
      - python-virtualenv
    state: present
