---
- name: Update apt cache
  apt: update_cache=yes cache_valid_time=86400

- name: Ensure availability of base packages
  apt: name={{ item }} state=present
  with_items:
    - cowsay
    - curl
    - figlet
    - git
    - git-svn
    - gnupg
    - gnupg-agent
    - htop
    - jq
    - maven
    - netcat-openbsd
    - openjdk-7-jdk
    - realpath
    - subversion
    - tmux
    - tree
    - unattended-upgrades
    - vim
    - wget
    - zsh

- name: Enable vim as default editor
  command: /usr/bin/update-alternatives --set editor /usr/bin/vim.basic

- name: Add cron for unattended-upgrades after reboot
  cron: state=present job=/usr/bin/unattended-upgrades name='Upgrades after Reboot' reboot=yes

- name: Add cron for unattended-upgrades regularly
  cron: state=present job=/usr/bin/unattended-upgrades name='Regular upgrades' hour=11 minute=0

- include: docker.yml

- include: dnsmasq.yml
---
- name: Ensure backports availability
  apt_repository:
    repo: "deb http://http.debian.net/debian {{ansible_distribution_release}}-backports main contrib non-free"
    state: present

- name: Update apt cache
  apt: update_cache=yes cache_valid_time=86400

- name: Ensure availability of base packages
  apt: name={{ item }} state=present
  with_items:
    - curl
    - git
    - git-svn
    - gnupg
    - gnupg-agent
    - htop
    - jq
    - libxml2-utils
    - netcat-openbsd
    - realpath
    - subversion
    - tmux
    - tree
    - unattended-upgrades
    - vim
    - wget
    - zsh

- name: Ensure availability of Java packages
  apt: name={{ item }} state=present default_release="{{ansible_distribution_release}}-backports"
  with_items:
    - maven
    - openjdk-8-jdk

- name: Enable vim as default editor
  command: /usr/bin/update-alternatives --set editor /usr/bin/vim.basic

- name: Add cron for unattended-upgrades after reboot
  cron: state=present job=/usr/bin/unattended-upgrades name='Upgrades after Reboot' reboot=yes

- name: Add cron for unattended-upgrades regularly
  cron: state=present job=/usr/bin/unattended-upgrades name='Regular upgrades' hour=11 minute=0

- include: docker.yml

- include: dnsmasq.yml
Update to openjdk-8 w/ debian-backports
Update to openjdk-8 w/ debian-backports
