---
- name: set up apt repo
  template: src=sources.list.j2 dest=/etc/apt/sources.list force=yes

- name: Update apt cache
  apt: update_cache=yes
  changed_when: "false"

- name: Upgrade packages
  apt: upgrade=dist

# TODO: only install open-vm-tools for VMware platforms
- name: Install common tools / clients
  apt: name={{ item }} state=present
  with_items:
    - sudo
    - bash
    - zsh
    - vim
    - locales-all
    - open-vm-tools
    - open-vm-tools-dkms
    - curl

- name: remove unneccessary packages
  apt: name={{ item }} state=absent
  with_items:
    - nfs-common
    - cloud-init

# apt module doesn't support autoremove very well, yet
- name: Remove obsolete packages
  command: "/usr/bin/apt --yes --purge autoremove"
  register: result
  changed_when: "'0 upgraded, 0 newly installed, 0 to remove' not in result.stdout"


---
- name: set up apt repo
  template: src=sources.list.j2 dest=/etc/apt/sources.list force=yes

- name: Update apt cache
  apt: update_cache=yes
  changed_when: "false"

- name: Upgrade packages
  apt: upgrade=dist

# TODO: only install open-vm-tools for VMware platforms
- name: Install common tools / clients
  apt: name={{ item }} state=present
  with_items:
    - sudo
    - bash
    - zsh
    - vim
    - locales-all
    - open-vm-tools
    - open-vm-tools-dkms
    - curl
    - net-tools

- name: remove unneccessary packages
  apt: name={{ item }} state=absent
  with_items:
    - nfs-common
    - cloud-init

# apt module doesn't support autoremove very well, yet
- name: Remove obsolete packages
  command: "/usr/bin/apt --yes --purge autoremove"
  register: result
  changed_when: "'0 upgraded, 0 newly installed, 0 to remove' not in result.stdout"


Install net-tools (netstat etc) by default
Install net-tools (netstat etc) by default
