---
- hosts: chromebooks

  vars: 
    home_dir: "{{ ansible_env.HOME }}/git/home"
    logbook_dir: "{{ ansible_env.HOME }}/git/logbook"
    terminus_font_file: "ter-powerline-v12n.psf.gz"

  tasks:  
  - name: apt - update && upgrade && autoremove
    apt:
      update_cache: yes
      cache_valid_time: 3600
      upgrade: full
      autoremove: yes
    become: True
    tags: apt

  - name: apt - utilities
    apt: 
      name: "{{ item }}"
      state: latest
    become: True
    tags: apt
    with_items:
    # misc tools
    - man
    - htop
    - tmux
    - vim
    - git
    - apt-file # search apt for header files
    - curl
    - mtr-tiny
    - elinks
    # GPG
    - gnupg2 
    - gnupg-agent
    - pinentry-tty 
    - scdaemon 
    - pcscd
    # Ansible
    - python3 
    - python3-pip
    # Wireless
    - iw
    - wpasupplicant
    # laptop tools
    - powertop

  - name: apt - utilities
    apt: 
      name: "{{ item }}"
      state: latest
    become: True
    tags: apt
    with_items:
    - firmware-iwlwifi # reboot is easist way to enable, only on debian
    when: ansible_distribution == 'Debian'
  
  - include: tasks/home.yml
  - include: tasks/logbook.yml
  - include: tasks/battery.yml
  - include: tasks/consolefont.yml
  - include: tasks/keyboard.yml
  - include: tasks/git.yml
  - include: tasks/systemd.yml
