---
- name: Update apt
  sudo: yes
  apt: update_cache=yes
  when: server.prevent_update is not defined

- name: Install System Packages
  sudo: yes
  apt: pkg={{ item }} state=latest
  with_items:
    - curl
    - wget
    - python-software-properties

- name: Install Extra Packages
  sudo: yes
  apt: pkg={{ item }} state=latest
  with_items: '{{ server.packages }}'
  when: server.packages is defined

- name: Pip install ndg-httpsclient
  shell: pip install ndg-httpsclient
  sudo: yes

- name: Configure the timezone
  sudo: yes
  template: src=timezone.j2 dest=/etc/timezone

- name: More Configure the timezone
  sudo: yes
  file: src=/usr/share/zoneinfo/{{server.timezone}} dest=/etc/localtime state=link force=yes backup=yes

- name: Set default system language pack
  shell: locale-gen {{ server.locales|join(' ') }}
  sudo: yes

