---
# ------------------------------------------------------------------------------
# These tasks run for any Debian/Ubuntu server (physical or virtual)
# ------------------------------------------------------------------------------

# Copy Debian 9 sources.list
- name: Copying Debian 9 apt/sources.list
  copy: src=debian/9/sources.list dest=/etc/apt/sources.list
  when: ansible_os_family == "Debian" and ansible_distribution_major_version == "9"

# Copy Debian 10 sources.list
- name: Copying Debian 10 apt/sources.list
  copy: src=debian/10/sources.list dest=/etc/apt/sources.list
  when: ansible_os_family == "Debian" and ansible_distribution_major_version == "10"

  # Copy Ubuntu 16.04 sources.list
- name: Copying Ubuntu 16.04 apt/sources.list
  copy: src=ubuntu/16.04/sources.list dest=/etc/apt/sources.list
  when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "16.04"

# Ignore apt translations
- name: Ignoring apt tranlations
  copy: src=debian/99translations dest=/etc/apt/apt.conf.d/99translations

# Install common apps for all debian machines
- name: Installing common Debian/Ubuntu applications
  apt:
    update_cache: yes
    state: present
    name:
      - apt-transport-https # For https apt repos
      - openssh-server      # SSH server
      - sudo                # Sudo access for users
      - net-tools           # Deprecated ifconfig
      - nmap                # Port scanner
      - ethtool             # LAN information for debugging
      - iperf               # Network performance for debugging
      - sysstat             # Performance stats
      - iotop               # Data I/O top (for hard drive read/write analysis)
      - iftop               # Network top to watch network usage
      - vim                 # Vim text editor
      - nano                # Nano text editor
      - rsync               # Rsync protocol
      - curl                # Web downloader
      - wget                # Web downloader
      - htop                # Graphical top alternative
      - mlocate             # Full-text search for all files
      - ntp                 # Date sync
      - zip                 # Zip utility
      - unzip               # Unzip utility
      - gzip                # Gzip utility
      - git                 # Git source control
      - nfs-common          # Connect to a NFS server
      - cifs-utils          # Connect to a Samba server
      - dos2unix            # Convert dos line endings to unix and visa versa
      - acl                 # I customize directories often with ACL
      - dnsutils            # Dig command and other dns commands
